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 computationFri, 13 Nov 2009 06:20:02 -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/2009/Nov/13/t1258118501lpnlavo9f70vq66.htm/, Retrieved Sun, 05 May 2024 15:33:54 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=56590, Retrieved Sun, 05 May 2024 15:33:54 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact118
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Back to Back Histogram] [3/11/2009] [2009-11-02 21:58:53] [b98453cac15ba1066b407e146608df68]
- RM D    [Box-Cox Linearity Plot] [] [2009-11-13 13:20:02] [2f6049721194fa571920c3539d7b729e] [Current]
Feedback Forum

Post a new message
Dataseries X:
2.155
2.172
2.15
2.533
2.058
2.16
2.26
2.498
2.695
2.799
2.947
2.93
2.318
2.54
2.57
2.669
2.45
2.842
3.44
2.678
2.981
2.26
2.844
2.546
2.456
2.295
2.379
2.479
2.057
2.28
2.351
2.276
2.548
2.311
2.201
2.725
2.408
2.139
1.898
2.537
2.069
2.063
2.524
2.437
2.189
2.793
2.074
2.622
2.278
2.144
2.427
2.139
1.828
2.072
1.8
1.758
2.246
1.987
1.868
2.514
2.121
Dataseries Y:
12.7
12.3
11.9
22.782
19.169
13.807
29.743
25.591
29.096
26.482
22.405
27.044
17.97
18.73
19.684
19.785
18.479
10.698
31.956
29.506
34.506
27.165
26.736
23.691
18.157
17.328
18.205
20.995
17.382
9.367
31.124
26.551
30.651
25.859
25.1
25.778
20.418
18.688
20.424
24.776
19.814
12.738
31.566
30.111
30.019
31.934
25.826
26.835
20.205
17.789
20.52
22.518
15.572
11.509
25.447
24.09
27.786
26.195
20.516
22.759
19.028
16.971
20.036
22.485




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time0 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135
R Engine error message
Error in cor(x1, y) : incompatible dimensions
Execution halted

\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 & 0 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
R Engine error message & 
Error in cor(x1, y) : incompatible dimensions
Execution halted
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=56590&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]0 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[ROW][C]R Engine error message[/C][C]
Error in cor(x1, y) : incompatible dimensions
Execution halted
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=56590&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=56590&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 time0 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135
R Engine error message
Error in cor(x1, y) : incompatible dimensions
Execution halted



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