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 computationThu, 13 Nov 2008 02:09:05 -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/13/t1226567413l3dagkrdsy7nalf.htm/, Retrieved Sun, 19 May 2024 10:11:34 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=24499, Retrieved Sun, 19 May 2024 10:11:34 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsBox Cox Linearity Plot
Estimated Impact172
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-13 09:09:05] [3bdbbe597ac6c61989658933956ee6ac] [Current]
Feedback Forum
2008-11-14 15:11:29 [c798c834ef86cb6aaf2fcb10ea683230] [reply
Op de y-as van de eerste grafiek kan de correlatie afgelezen worden. op de x-as staat lambda, lambda ligt tussen -2 en 2. de optimale waarde van lambda is hier 2.
In de scatterplot wordt het verband van de 2 variabelen getoond, door de punten van de scatterplot wordt een lijn getrokken die de wetmatigheid aanduidt.
Bij de originele data liggen de punten niet op een lijn, vandaar ook de kromme in de eerste grafiek.
Door de transformatie komen de punten dichter op een lijn te liggen, maar de correlatie wordt niet echt verhoogt door de transformatie.Ht is dus geen zinvolle transformatie, er wordt ook geen maximum correlatie bereikt.
2008-11-23 16:43:59 [Peter Van Doninck] [reply
De student heeft goed verwoord dat de transformatie van x hier eigenlijk min of meer zinloos is. De gegevens voor en na de transformatie zijn toch min of meer dezelfde, waardoor we kunnen besluiten dat de scatterplot niet lineairder geworden is. Wel zien we dat de box-cox linearity plot een maximum bereikt voor een lambda gelijk aan 1,87.
2008-11-24 14:34:48 [Vincent Dolhain] [reply
De box-cox linearity plot geeft een grafiek die de correlatie weergeeft van de mogelijke transformaties van X, de transformatievariabele is lambda en ligt tussen -2 en 2. Hierdoor kan je de optimale transformatie kiezen, dit is namelijk het maximum. Als de grafiek een rechte is, wijst dit er op dat er geen zinnige transformatie is.

Post a new message
Dataseries X:
66,9
108,8
113,2
105,5
77,8
102,1
97
95,5
99,3
86,4
92,4
85,7
61,9
104,9
107,9
95,6
79,8
94,8
93,7
108,1
96,9
88,8
106,7
86,8
69,8
110,9
105,4
99,2
84,4
87,2
91,9
97,9
94,5
85
100,3
78,7
65,8
104,8
96
103,3
82,9
91,4
94,5
109,3
92,1
99,3
109,6
87,5
73,1
110,7
111,6
110,7
84
101,6
102,1
113,9
99
100,4
109,5
93,1
77
108
119,9
105,9
78,2
100,3
102,2
97
101,3
89,2
93,3
88,5
62,2
Dataseries Y:
91
120,7
127,9
112,4
93,1
107,5
107,3
114,8
120,8
112,2
123,3
100,6
86,7
123,6
125,3
111,1
98,4
102,3
105
128,2
124,7
116,1
131,2
97,7
88,8
132,8
113,9
112,6
104,3
107,5
106
117,3
123,1
114,3
132
92,3
93,7
121,3
113,6
116,3
98,3
111,9
109,3
133,2
118
131,6
134,1
96,7
99,8
128,3
134,9
130,7
107,3
121,6
120,6
140,5
124,8
129,9
159,4
111
110,1
132,7
135
118,6
94
117,9
114,7
113,6
130,6
117,1
123,2
106,1
87,9




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 2 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=24499&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=24499&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=24499&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 time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24







Box-Cox Linearity Plot
# observations x73
maximum correlation0.852841013339555
optimal lambda(x)1.87
Residual SD (orginial)7.54705618547576
Residual SD (transformed)7.48524452950582

\begin{tabular}{lllllllll}
\hline
Box-Cox Linearity Plot \tabularnewline
# observations x & 73 \tabularnewline
maximum correlation & 0.852841013339555 \tabularnewline
optimal lambda(x) & 1.87 \tabularnewline
Residual SD (orginial) & 7.54705618547576 \tabularnewline
Residual SD (transformed) & 7.48524452950582 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=24499&T=1

[TABLE]
[ROW][C]Box-Cox Linearity Plot[/C][/ROW]
[ROW][C]# observations x[/C][C]73[/C][/ROW]
[ROW][C]maximum correlation[/C][C]0.852841013339555[/C][/ROW]
[ROW][C]optimal lambda(x)[/C][C]1.87[/C][/ROW]
[ROW][C]Residual SD (orginial)[/C][C]7.54705618547576[/C][/ROW]
[ROW][C]Residual SD (transformed)[/C][C]7.48524452950582[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=24499&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=24499&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 x73
maximum correlation0.852841013339555
optimal lambda(x)1.87
Residual SD (orginial)7.54705618547576
Residual SD (transformed)7.48524452950582



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')