Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_boxcoxlin.wasp
Title produced by softwareBox-Cox Linearity Plot
Date of computationThu, 13 Nov 2008 03:16:40 -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/t122657154280o8lvpy54eaa3r.htm/, Retrieved Sun, 19 May 2024 11:10:50 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=24549, Retrieved Sun, 19 May 2024 11:10:50 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact146
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F       [Box-Cox Linearity Plot] [boxcox] [2008-11-13 10:16:40] [80e37024345c6a903bf645806b7fbe14] [Current]
Feedback Forum
2008-11-15 12:35:45 [Ken Wright] [reply
De box cox gaat proberen door een bepaalde berekening (met lambda) l de correlatie meer lineair maken. In de berekening gaat hij de lambda verschillende waarden laten aannemen tussen -2 en 2. De eerste grafiek laat zien voor welke waarde lambda optimaal is. In dit geval waarschijnlijk 2 je kan de grafiek een beetje zien als een hyperbool die bij waarde 2 terug gaat dalen. Dus 2 stelt het maximum voor. Maar inderdaad in dit voorbeeld heeft de box cox linearity plot weinig invloed gehad, standaard afwijking blijft nagenoeg hetzelfde en de puntenwolk ik ook zo goed als niet van vorm veranderd.
2008-11-19 15:25:12 [Glenn Maras] [reply
De box-cox tranformatie gaat de scatterplots meer benaderbaar proberen te maken voor een rechte. De student concludeert hier correct dat de transformatie de correlatie tussen de 2variabelen niet verbeterd. Dit is ook te zien aan de standaardeviatie die bijna hetzelfde blijft.
Wat hij/zij nog kon zeggen was dat de box-cox linearity plot ergens een maximum zou moeten vertonen. Dit doet hij ook bij: lambda= 1.5

Post a new message
Dataseries X:
1846,5
2796,3
2895,6
2472,2
2584,4
2630,4
2663,1
3176,2
2856,7
2551,4
3088,7
2628,3
2226,2
3023,6
3077,9
3084,1
2990,3
2949,6
3014,7
3517,7
3121,2
3067,4
3174,6
2676,3
2424
3195,1
3146,6
3506,7
3528,5
3365,1
3153
3843,3
3123,2
3361,1
3481,9
2970,5
2537
3257,6
3301,3
3391,6
2933,6
3283,2
3139,7
3486,4
3202,2
3294,4
3550,3
3279,3
2678,6
3451,4
3977,1
3814,8
3310,5
3971,8
4051,9
4057,6
4391,4
3628,9
4092,2
3822,5
Dataseries Y:
1530,9
2220,6
2161,5
1863,6
1955,1
1907,4
1889,4
2246,3
2213
1965
2285,6
1983,8
1872,4
2371,4
2287
2198,2
2330,4
2014,4
2066,1
2355,8
2232,5
2091,7
2376,5
1931,9
2025,7
2404,9
2316,1
2368,1
2282,5
2158,6
2174,8
2594,1
2281,4
2547,9
2606,3
2190,8
2262,3
2423,8
2520,4
2482,9
2215,9
2441,9
2333,8
2670,2
2431
2559,3
2661,4
2404,6
2378,3
2489,2
2959
2713,5
2341,3
2833,2
2849,7
2871,7
3058,3
2855,1
3083,6
2828,3




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=24549&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]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=24549&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=24549&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'George Udny Yule' @ 72.249.76.132







Box-Cox Linearity Plot
# observations x60
maximum correlation0.92065525247896
optimal lambda(x)1.55
Residual SD (orginial)126.435190134419
Residual SD (transformed)125.139479994807

\begin{tabular}{lllllllll}
\hline
Box-Cox Linearity Plot \tabularnewline
# observations x & 60 \tabularnewline
maximum correlation & 0.92065525247896 \tabularnewline
optimal lambda(x) & 1.55 \tabularnewline
Residual SD (orginial) & 126.435190134419 \tabularnewline
Residual SD (transformed) & 125.139479994807 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=24549&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.92065525247896[/C][/ROW]
[ROW][C]optimal lambda(x)[/C][C]1.55[/C][/ROW]
[ROW][C]Residual SD (orginial)[/C][C]126.435190134419[/C][/ROW]
[ROW][C]Residual SD (transformed)[/C][C]125.139479994807[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=24549&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=24549&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.92065525247896
optimal lambda(x)1.55
Residual SD (orginial)126.435190134419
Residual SD (transformed)125.139479994807



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