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 computationMon, 18 Jul 2011 10:46:24 -0400
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Jul/18/t1311000506rj0n7g88idhzq0i.htm/, Retrieved Thu, 16 May 2024 17:29:51 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=123073, Retrieved Thu, 16 May 2024 17:29:51 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact259
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Box-Cox Linearity Plot] [year versus cost ...] [2011-07-18 14:46:24] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
197632
238592
716800
348160
471040
307200
302080
295936
195584
155648
141312
266240
323584
276480
194560
179200
168960
134144
121856
286720
276480
174080
163840
143360
136192
122880
120832
306176
289792
219136
204800
185344
168960
161792
143360
121856
110592
81920
72704
92160
61440
46080
40960
33792
27648
30720
16384
54272
36864
12288
9216
7168
4096
2048
972.8
870.4
901.12
829.44
1013.76
1290.24
944.128
905.216
685.056
774.144
702.464
302.08
269.312
265.216
211.968
177.152
185.344
151.552
144.384
156.672
124.928
120.832
120.832
106.496
112.64
106.496
104.448
103.424
99.9424
87.4496
81.92
103.424
101.1712
99.4304
97.5872
95.3344
97.4848
95.8464
88.3712
85.9136
80.384
80.0768
87.7568
87.6544
76.0832
62.5664
79.0528
78.1312
68.096
67.8912
65.3312
77.2096
74.9568
67.6864
64.4096
60.7232
83.5584
70.3488
67.6864
60.3136
61.952
62.464
54.784
56.4224
60.5184
57.0368
54.0672
53.5552
53.5552
55.9104
47.5136
53.1456
51.5072
53.248
48.5376
49.0496
43.6224
44.1344
38.6048
37.376
31.4368
35.4304
34.5088
32.9728
32.8704
32.256
32.1536
30.3104
28.9792
33.0752
28.2624
27.7504
25.088
29.4912
28.0576
26.9312
18.944
21.6064
21.0944
20.3776
22.9376
21.6064
21.0944
21.0944
18.944
22.8352
22.528
21.8112
21.8112
18.8416
17.7152
17.3056
16.896
16.6912
15.36
19.73
16.86
16.83
16.76
16.73
16.45
15.82
15.8
15.44
14.29
11.95
15.65
15.06
14.89
14.72
14.58
14.33
14.29
13.88
13.8
13.63
13.47
12.95
12.74
12.54
12.48
11.81
15.22
12.27
11.5
14.57
12.42
11.24
10.06
10.91
10.82
10.41
9.25
8.02
11.5
10.06
9.58
9.14
8.94
7.45
7.27
7.27
7.14
7.88
7.25
6.9
7.31
7.26
6.84
7.48
6.48
5.72
6.82
6.56
6.49
5.87
6.33
6.33
5.75
4.41
2.99
4.57
4.31
3.71
2.65
2.88
3.74
2.59
2.07
2.59
2.88
2.59
2.68
2.58
1.51
1.93
1.78
1.61
1.51
1.42
1.39
1.94
1.94
1.7
1.57
1.41
1.38
1.24
1.22
1.15
1.24
1.21
1.2
0.671
0.598
0.719
0.719
0.719
0.575
0.598
0.426
0.411
0.377
0.371
0.367
0.35
0.333
0.306
0.302
0.287
0.164
0.134
0.0909
0.0688
0.115
0.113
0.0821
Dataseries Y:
1980
1980
1981
1981
1981
1981
1981
1981
1981
1981
1981
1982
1983
1983
1983
1983
1983
1983
1983
1984
1984
1984
1984
1984
1984
1984
1984
1984
1984
1984
1984
1984
1984
1984
1984
1984
1984
1984
1985
1987
1987
1987
1988
1988
1988
1988
1988
1989
1989
1989
1990
1991
1992
1993
1994
1995
1995
1995
1995
1995
1995
1995
1995
1995
1995
1996
1996
1996
1996
1996
1997
1997
1997
1997
1997
1997
1997
1997
1997
1997
1997
1997
1997
1997
1997
1997
1997
1997
1997
1997
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1998
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
1999
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2001
2001
2001
2001
2001
2001
2001
2001
2001
2001
2001
2001
2001
2001
2001
2001
2002
2002
2002
2002
2002
2002
2002
2002
2002
2002
2002
2003
2003
2003
2003
2003
2003
2003
2003
2004
2004
2004
2004
2004
2004
2004
2004
2004
2004
2004
2004
2004
2004
2005
2005
2005
2005
2005
2007
2007
2007
2007
2007
2007
2007
2007
2007
2007
2010
2010
2010
2010
2010
2010
2010




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net

\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 & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=123073&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]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=123073&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=123073&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'Herman Ole Andreas Wold' @ wold.wessa.net







Box-Cox Linearity Plot
# observations x291
maximum correlation0.990759151532932
optimal lambda(x)0.02
Residual SD (orginial)4.43033181870186
Residual SD (transformed)0.927310633806436

\begin{tabular}{lllllllll}
\hline
Box-Cox Linearity Plot \tabularnewline
# observations x & 291 \tabularnewline
maximum correlation & 0.990759151532932 \tabularnewline
optimal lambda(x) & 0.02 \tabularnewline
Residual SD (orginial) & 4.43033181870186 \tabularnewline
Residual SD (transformed) & 0.927310633806436 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=123073&T=1

[TABLE]
[ROW][C]Box-Cox Linearity Plot[/C][/ROW]
[ROW][C]# observations x[/C][C]291[/C][/ROW]
[ROW][C]maximum correlation[/C][C]0.990759151532932[/C][/ROW]
[ROW][C]optimal lambda(x)[/C][C]0.02[/C][/ROW]
[ROW][C]Residual SD (orginial)[/C][C]4.43033181870186[/C][/ROW]
[ROW][C]Residual SD (transformed)[/C][C]0.927310633806436[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=123073&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=123073&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 x291
maximum correlation0.990759151532932
optimal lambda(x)0.02
Residual SD (orginial)4.43033181870186
Residual SD (transformed)0.927310633806436



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