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 04:04:41 -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/t1226574338l44oclb81thgyyf.htm/, Retrieved Sun, 19 May 2024 06:13:36 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=24570, Retrieved Sun, 19 May 2024 06:13:36 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsEigen tijdreeksen H8
Estimated Impact129
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F       [Box-Cox Linearity Plot] [loïqueverhasselt] [2008-11-13 11:04:41] [6440ec5a21e5d35520cb2ae6b4b70e45] [Current]
Feedback Forum
2008-11-18 12:05:15 [Loïque Verhasselt] [reply
Variabelen transformeren voor ze zo meer lineair te maken. Elke lambda uitproberen van -2 tot 2, en dan zien welke de beste correlatie heeft. Rechte lambda grafiek = geen goede transformatie, eentje met een maximum wel).
2008-11-20 11:49:55 [Thomas Plasschaert] [reply
goede grafiek, maar je uitleg is niet echt volledig. Een geschikte box cox transformatie kan de geschiktheid van de gegevens verbeteren. Bij de Cox Box transformatie wordt X getransformeerd en wordt een transformatorparameter Lambda gebruikt, wanneer lambda gelijk is aan 0 wordt gewoon de oorspronkelijke waarde van X genomen. Aan de Box Cox linearity plot kan je zien welke de optimale waarde is voor de parameter Lambda, nl de waarde voor lambda bij de top van de grafiek. Waaneer geen top bereikt wordt in deze grafiek is er ook geen optimale waarde voor lambda te bepalen en zal het effect van de transformatie 0 zijn. Wanneer wel een optimale waarde bereikt wordt, zal de transformatie geen groot effect hebben.

Post a new message
Dataseries X:
97,4
95,3
93,6
91,5
93,1
91,7
94,3
93,9
90,9
88,3
91,3
91,7
92,4
92
95,6
95,8
96,4
99
107
109,7
116,2
115,9
113,8
112,6
113,7
115,9
110,3
111,3
113,4
108,2
104,8
106
110,9
115
118,4
121,4
128,8
131,7
141,7
142,9
139,4
134,7
125
113,6
111,5
108,5
112,3
116,6
115,5
120,1
132,9
128,1
129,3
132,5
131
124,9
120,8
122
122,1
127,4
Dataseries Y:
93
98,4
92,6
94,6
99,5
97,6
91,3
93,6
93,1
78,4
70,2
69,3
71,1
73,5
85,9
91,5
91,8
88,3
91,3
94
99,3
96,7
88
96,7
106,8
114,3
105,7
90,1
91,6
97,7
100,8
104,6
95,9
102,7
104
107,9
113,8
113,8
123,1
125,1
137,6
134
140,3
152,1
150,6
167,3
153,2
142
154,4
158,5
180,9
181,3
172,4
192
199,3
215,4
214,3
201,5
190,5
196




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=24570&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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=24570&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=24570&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 time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







Box-Cox Linearity Plot
# observations x60
maximum correlation0.66805804898069
optimal lambda(x)-0.99
Residual SD (orginial)30.2826122781399
Residual SD (transformed)29.9954531764413

\begin{tabular}{lllllllll}
\hline
Box-Cox Linearity Plot \tabularnewline
# observations x & 60 \tabularnewline
maximum correlation & 0.66805804898069 \tabularnewline
optimal lambda(x) & -0.99 \tabularnewline
Residual SD (orginial) & 30.2826122781399 \tabularnewline
Residual SD (transformed) & 29.9954531764413 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=24570&T=1

[TABLE]
[ROW][C]Box-Cox Linearity Plot[/C][/ROW]
[ROW][C]# observations x[/C][C]60[/C][/ROW]
[ROW][C]maximum correlation[/C][C]0.66805804898069[/C][/ROW]
[ROW][C]optimal lambda(x)[/C][C]-0.99[/C][/ROW]
[ROW][C]Residual SD (orginial)[/C][C]30.2826122781399[/C][/ROW]
[ROW][C]Residual SD (transformed)[/C][C]29.9954531764413[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=24570&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=24570&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 x60
maximum correlation0.66805804898069
optimal lambda(x)-0.99
Residual SD (orginial)30.2826122781399
Residual SD (transformed)29.9954531764413



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