Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_boxcoxlin.wasp
Title produced by softwareBox-Cox Linearity Plot
Date of computationWed, 12 Nov 2008 05:14:45 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2008/Nov/12/t1226492997wvv9gggwxgiy4om.htm/, Retrieved Sun, 19 May 2024 06:27:34 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=24153, Retrieved Sun, 19 May 2024 06:27:34 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact157
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F       [Box-Cox Linearity Plot] [box-cox linearity...] [2008-11-12 12:14:45] [a16dfd7e948381d8b6391003c5d09447] [Current]
Feedback Forum
2008-11-16 17:34:23 [006ad2c49b6a7c2ad6ab685cfc1dae56] [reply
De Box-Cox linearity plot is een transformatie die gebruikt wordt om de scatterplots van de gegevens lineairder te maken. De bedoeling is dat je uiteindelijk een curve te zien krijgt die ergens een maximum vertoont. Dit maximum komt overeen met de beste transformatie. In dit geval wordt er een maximum bereikt bij lambda=-2. Deze waarde voor lambda geeft dus de beste transformatie.

2008-11-20 12:37:49 [Carole Thielens] [reply
Uitleg over wat een Box-cox linearity plot is, ontbreekt. De Box-cox linearity plot is een handige grafische techniek om zonder trial and error het effect van de Box- cox transformatie op de X- waarden weer te geven, welke de maximale correlatie tussen twee variabelen tracht te verwezenlijken. Op de horizontale as staat de transformatieparameter lambda, terwijl op de Y-as de correlatiecoëfficiënt tussen Y en de getransformeerde X. De optimale Lambda is deze waarvoor een positieve correlatie maximaal wordt en een negatieve correlatie minimaal wordt. Deze lambda(x) bedraagt -2. Om het effect van de transformatie te zien, moet je beoordelen in welke mate dat de correlatie gestegen is. Dit kan waargenomen worden op de scatterplots en tabel. Duidelijk verbeterde de correlatie niet sterk. Op de nieuwe scatterplot liggen de punten immers niet opmerkelijk beter verdeeld rond de rechte en uit de tabel blijkt dat de standaarddeviatie niet veel verminderd is.
De studente merkte uitsluitend op dat de correlatie dankzij de transformatie niet verbeterde, wat uiteraard verkeerd is. De correlatie verbeterde WEL, maar slechts heel zwak.
2008-11-22 10:36:08 [Stephanie Vanderlinden] [reply
De box-cox linearity plot probeert de variabelen te lineariseren om zo een lineair verband te ontdekken. De transformatieparameter is lambda, deze varieert van -2 tot +2. Elke mogelijke transformatie wordt getoond. Je moet zoeken naar het maximum van de curve, dat maximum levert de beste transformatie. Als er geen zinnige transformatie bestaat vertoont de grafiek een stijgende of een dalende rechte. Hier is de correlatie niet sterk verbeterd. Op de nieuwe scatterplots zijn de de punten niet opmerkelijk beter verdeeld rond de rechte. De correlatie is dus wel verbeterd, maar slechts zeer zwak.

Post a new message
Dataseries X:
15,9
15,5
15,3
14,5
14,4
14,7
19,1
21,6
20,2
17,9
15,7
14,5
14,1
13,9
14,2
15,3
15,4
15,2
16,5
18,2
18,6
21
19,2
18,7
18,4
17,8
17,2
16,2
15,5
15,3
18,3
19,2
19
18,7
18,1
18,5
21,1
21
20,4
19,5
18,6
18,8
23,7
24,8
25
23,6
22,3
21,8
20,8
19,7
18,3
17,4
17
18,1
23,9
25,6
25,3
23,6
21,9
21,4
20,6
20,5
20,2
20,6
19,7
19,3
22,8
23,5
23,8
22,6
22
21,7
20,7
20,2
19,1
19,5
18,7
18,6
22,2
23,2
23,5
21,3
20
18,7
18,9
18,3
18,4
19,9
19,2
18,5
20,9
20,5
19,4
18,1
17
17
17,3
16,7
15,5
15,3
13,7
14,1
17,3
18,1
18,1
Dataseries Y:
6,6
6,4
6
5,8
5,5
5,4
5,4
5,6
5,5
5,8
5,8
5,7
5,5
5,3
5,2
5,3
5,3
5
4,8
4,9
5,3
6
6,2
6,4
6,4
6,4
6,2
6,1
6
5,9
6,2
6,2
6,4
6,8
6,9
7
7
6,9
6,7
6,6
6,5
6,4
6,5
6,5
6,6
6,7
6,8
7,2
7,6
7,6
7,3
6,4
6,1
6,3
7,1
7,5
7,4
7,1
6,8
6,9
7,2
7,4
7,3
6,9
6,9
6,8
7,1
7,2
7,1
7
6,9
7
7,4
7,5
7,5
7,4
7,3
7
6,7
6,5
6,5
6,5
6,6
6,8
6,9
6,9
6,8
6,8
6,5
6,1
6
5,9
5,8
5,9
5,9
6,2
6,3
6,2
6
5,8
5,5
5,5
5,7
5,8
5,7




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 5 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=24153&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]5 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=24153&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=24153&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







Box-Cox Linearity Plot
# observations x105
maximum correlation0.66103745900176
optimal lambda(x)-2
Residual SD (orginial)0.52527610783304
Residual SD (transformed)0.50943761616914

\begin{tabular}{lllllllll}
\hline
Box-Cox Linearity Plot \tabularnewline
# observations x & 105 \tabularnewline
maximum correlation & 0.66103745900176 \tabularnewline
optimal lambda(x) & -2 \tabularnewline
Residual SD (orginial) & 0.52527610783304 \tabularnewline
Residual SD (transformed) & 0.50943761616914 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=24153&T=1

[TABLE]
[ROW][C]Box-Cox Linearity Plot[/C][/ROW]
[ROW][C]# observations x[/C][C]105[/C][/ROW]
[ROW][C]maximum correlation[/C][C]0.66103745900176[/C][/ROW]
[ROW][C]optimal lambda(x)[/C][C]-2[/C][/ROW]
[ROW][C]Residual SD (orginial)[/C][C]0.52527610783304[/C][/ROW]
[ROW][C]Residual SD (transformed)[/C][C]0.50943761616914[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=24153&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=24153&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Box-Cox Linearity Plot
# observations x105
maximum correlation0.66103745900176
optimal lambda(x)-2
Residual SD (orginial)0.52527610783304
Residual SD (transformed)0.50943761616914



Parameters (Session):
Parameters (R input):
R code (references can be found in the software module):
n <- length(x)
c <- array(NA,dim=c(401))
l <- array(NA,dim=c(401))
mx <- 0
mxli <- -999
for (i in 1:401)
{
l[i] <- (i-201)/100
if (l[i] != 0)
{
x1 <- (x^l[i] - 1) / l[i]
} else {
x1 <- log(x)
}
c[i] <- cor(x1,y)
if (mx < abs(c[i]))
{
mx <- abs(c[i])
mxli <- l[i]
}
}
c
mx
mxli
if (mxli != 0)
{
x1 <- (x^mxli - 1) / mxli
} else {
x1 <- log(x)
}
r<-lm(y~x)
se <- sqrt(var(r$residuals))
r1 <- lm(y~x1)
se1 <- sqrt(var(r1$residuals))
bitmap(file='test1.png')
plot(l,c,main='Box-Cox Linearity Plot',xlab='Lambda',ylab='correlation')
grid()
dev.off()
bitmap(file='test2.png')
plot(x,y,main='Linear Fit of Original Data',xlab='x',ylab='y')
abline(r)
grid()
mtext(paste('Residual Standard Deviation = ',se))
dev.off()
bitmap(file='test3.png')
plot(x1,y,main='Linear Fit of Transformed Data',xlab='x',ylab='y')
abline(r1)
grid()
mtext(paste('Residual Standard Deviation = ',se1))
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Box-Cox Linearity Plot',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'# observations x',header=TRUE)
a<-table.element(a,n)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'maximum correlation',header=TRUE)
a<-table.element(a,mx)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'optimal lambda(x)',header=TRUE)
a<-table.element(a,mxli)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Residual SD (orginial)',header=TRUE)
a<-table.element(a,se)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Residual SD (transformed)',header=TRUE)
a<-table.element(a,se1)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')