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 computationMon, 10 Nov 2008 07:07:38 -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/10/t1226326387tso1o43ucomm1am.htm/, Retrieved Sun, 19 May 2024 10:22:49 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=23072, Retrieved Sun, 19 May 2024 10:22:49 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact195
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Kernel Density Estimation] [Q1 bivariate dens...] [2008-11-10 13:19:59] [c5a66f1c8528a963efc2b82a8519f117]
- RMPD  [Partial Correlation] [Q1
F RM D      [Box-Cox Linearity Plot] [Q3 box-cox ] [2008-11-10 14:07:38] [b4fc5040f26b33db57f84cfb8d1d2b82] [Current]
-             [Box-Cox Linearity Plot] [Q3] [2008-11-11 19:16:07] [a0d819c22534897f04a2f0b92f1eb36a]
Feedback Forum
2008-11-18 21:08:40 [Glenn De Maeyer] [reply
Hier wordt in de R-code een nieuwe variabele gecreeerd x1. Deze X1 is eigenlijk de oorspronkelijke variabele x verheven tot de macht lambda -1 en dit opnieuw delen door lambda. Met deze formule kan je tijdreeksen transformeren. Je moet op zoek gaan naar de optimale lambda om de tijdreeks te transformeren. De optimale lambda hier is 0.23.
2008-11-23 15:11:02 [Sanne Kerckhofs] [reply
De Box-Cox geeft alle mogelijke transformaties weer. Het gaat hier om scatterplots waarvan we een niet-lineair verband vermoeden. Via transformatie gaan we het lineair verband zoeken. We kiezen dan het getal met de grootste lambda waarde.

Post a new message
Dataseries X:
1515
1510
1225
1577
1417
1224
1693
1633
1639
1914
1586
1552
2081
1500
1437
1470
1849
1387
1592
1589
1798
1935
1887
2027
2080
1556
1682
1785
1869
1781
2082
2570
1862
1936
1504
1765
1607
1577
1493
1615
1700
1335
1523
1623
1540
1637
1524
1419
1821
1593
1357
1263
1750
1405
1393
1639
1679
1551
1744
1429
1784
Dataseries Y:
2718
2646
2551
2712
2606
2365
3533
3509
2912
3599
2719
2869
4085
2686
2545
3071
3388
2652
3190
2884
3295
3818
3226
3953
3810
2877
3515
3708
3450
3360
4110
4384
3729
4263
3505
3674
3911
2951
3317
3417
3498
2768
2899
3179
3011
3481
3015
2606
3530
2827
3120
2557
3645
2865
2587
2887
3429
2956
3098
2934
3269




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=23072&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=23072&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=23072&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 x61
maximum correlation0.846988081441556
optimal lambda(x)0.23
Residual SD (orginial)259.178502954126
Residual SD (transformed)256.309035952752

\begin{tabular}{lllllllll}
\hline
Box-Cox Linearity Plot \tabularnewline
# observations x & 61 \tabularnewline
maximum correlation & 0.846988081441556 \tabularnewline
optimal lambda(x) & 0.23 \tabularnewline
Residual SD (orginial) & 259.178502954126 \tabularnewline
Residual SD (transformed) & 256.309035952752 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=23072&T=1

[TABLE]
[ROW][C]Box-Cox Linearity Plot[/C][/ROW]
[ROW][C]# observations x[/C][C]61[/C][/ROW]
[ROW][C]maximum correlation[/C][C]0.846988081441556[/C][/ROW]
[ROW][C]optimal lambda(x)[/C][C]0.23[/C][/ROW]
[ROW][C]Residual SD (orginial)[/C][C]259.178502954126[/C][/ROW]
[ROW][C]Residual SD (transformed)[/C][C]256.309035952752[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=23072&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=23072&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 x61
maximum correlation0.846988081441556
optimal lambda(x)0.23
Residual SD (orginial)259.178502954126
Residual SD (transformed)256.309035952752



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