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 computationSun, 09 Nov 2008 05:31:54 -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/09/t1226233979vwufwc2crfjo9m8.htm/, Retrieved Mon, 20 May 2024 08:38:44 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=22724, Retrieved Mon, 20 May 2024 08:38:44 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact205
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [Partial Correlation] [Partial correlation] [2008-11-08 12:17:14] [82d201ca7b4e7cd2c6f885d29b5b6937]
F RM D    [Box-Cox Linearity Plot] [Box Cox Linearity...] [2008-11-09 12:31:54] [00a0a665d7a07edd2e460056b0c0c354] [Current]
- RMPD      [Maximum-likelihood Fitting - Normal Distribution] [Maximum-likelihoo...] [2008-11-09 12:55:12] [82d201ca7b4e7cd2c6f885d29b5b6937]
F    D        [Maximum-likelihood Fitting - Normal Distribution] [Maximum-likelihoo...] [2008-11-09 12:58:19] [82d201ca7b4e7cd2c6f885d29b5b6937]
F               [Maximum-likelihood Fitting - Normal Distribution] [maximum likelihoo...] [2008-11-10 22:36:30] [8d78428855b119373cac369316c08983]
- RMPD          [Testing Mean with known Variance - Critical Value] [critical value] [2008-11-11 00:28:19] [8d78428855b119373cac369316c08983]
F RMPD          [Testing Mean with known Variance - p-value] [p-value] [2008-11-11 00:48:00] [8d78428855b119373cac369316c08983]
- RMPD          [Testing Mean with known Variance - Type II Error] [type 2 error] [2008-11-11 01:19:31] [8d78428855b119373cac369316c08983]
- RMPD          [Testing Mean with known Variance - Sample Size] [sample size] [2008-11-11 01:44:50] [8d78428855b119373cac369316c08983]
F RMPD          [Testing Population Mean with known Variance - Confidence Interval] [confidence interval] [2008-11-11 01:58:15] [8d78428855b119373cac369316c08983]
F RMPD          [Testing Sample Mean with known Variance - Confidence Interval] [confidence interval] [2008-11-11 02:12:01] [8d78428855b119373cac369316c08983]
-    D          [Maximum-likelihood Fitting - Normal Distribution] [Maximum-likelihoo...] [2008-12-10 19:20:50] [82d201ca7b4e7cd2c6f885d29b5b6937]
F           [Box-Cox Linearity Plot] [Box-Cox] [2008-11-10 22:18:08] [8d78428855b119373cac369316c08983]
Feedback Forum
2008-11-21 21:46:49 [Kim Wester] [reply
De Box-Cox transformatie is bedoeld om tijdreeksen te transformeren die problemen opleveren (geen lineair verband tonen). Het lambda getal transformeert de reeks zodat er een lineair verband = rechte ontstaat. Wanneer er door deze lambda rechte (Box-Cox Linearity Plot) geen max wordt bereikt kunnen er geen besluiten worden genomen. Een oplossing zou het vergroten van de lambda waarden zijn (dit kan door een aanpassing te doen in de R-code).

In dit geval is er visueel geen duidelijk verschil waar te nemen tussen de reeksen voor en na de transformatie. De Box-Cox Linearity Plot weergeeft geen maximum.
2008-11-23 10:58:48 [Inge Meelberghs] [reply
Als we kijken naar de grafiek van de originele data en de grafiek van de getransformeerde data kunnen we inderdaad stellen dat er praktisch geen verschil te zien is.

Op de Box - Cox Linearity Plot kunnen we ziet dat er zich geen maximum voordoet waardoor we geen besluit kunnen trekken. Dit kunnen we oplossen door de lambda waarde te vergroten door aanpassing van de R-code. De optimale lambda waarde bedraagt 2. Als we de grafiek zouden vergroten door de maximum correlatie aante passen dan zou het misschien wel kunnen dat dit maximum inderdaad plaatsvindt in 2. In de grafiek zie je dit ook dat de stijgende rechte stopt in 2.
2008-11-23 17:17:08 [Michaël De Kuyer] [reply
Ik sluit mij aan bij Kim. Men probeert de samenhang tussen twee tijdreeksen te optimaliseren door transformaties van de tijdreeksen door te voeren. Op de grafieken ziet men ook dat de standaardafwijking slechts in beperkte mate is afgenomen. Dit wijst erop dat er slechts een zeer beperkte transformatie is geweest.
2008-11-24 12:11:59 [Bonifer Spillemaeckers] [reply
Met het Box-Cox Linearity Plot gaan we bepaalde data transformeren, om niet-lineaire verbanden toch lineair te maken. Dit moeten we doen door te zoeken naar de maximale lambdawaarde. Als er geen maximum wordt bereikt, kan geen besluit worden genomen. Als we dan de grafiek van de oorspronkelijke data gaan vergelijken met de grafiek van de getransformeerde data kunnen we weinig verschil bemerken.

Post a new message
Dataseries X:
116,1
102,5
102,0
101,3
100,6
100,9
104,2
108,3
108,9
109,9
106,8
112,7
113,4
101,3
97,8
95,0
93,8
94,5
101,4
105,8
106,6
109,7
108,8
113,4
113,7
103,6
98,2
95,5
94,4
95,9
103,2
104,1
127,6
130,3
133,0
140,4
123,5
116,9
115,9
113,1
112,1
112,4
118,9
117,4
115,6
120,7
114,9
122,0
119,6
114,6
118,4
110,9
111,6
114,6
112,1
117,4
114,8
123,4
118,1
121,9
123,3
Dataseries Y:
118,9
108,8
115,6
95,0
92,8
108,9
109,8
106,1
102,8
98,4
85,7
114,6
129,4
117,7
126,6
103,8
101,5
118,7
119,6
114,8
109,9
106,3
95,0
124,5
140,4
128,8
137,5
113,3
110,3
129,1
128,4
120,3
113,6
96,9
124,7
126,4
131,9
122,5
113,1
99,8
116,0
115,0
114,0
111,0
91,7
90,6
103,3
106,7
111,2
102,9
126,5
115,1
110,2
110,1
103,3
107,7
103,9
114,0
117,2
117,0
116,5




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 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 & 3 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=22724&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]3 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=22724&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=22724&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 time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24







Box-Cox Linearity Plot
# observations x61
maximum correlation0.0531956886609767
optimal lambda(x)2
Residual SD (orginial)11.6976757002259
Residual SD (transformed)11.6914879013575

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=22724&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.0531956886609767
optimal lambda(x)2
Residual SD (orginial)11.6976757002259
Residual SD (transformed)11.6914879013575



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