Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
107.2 107 119 110.4 101.7 102.4 98.8 105.6 104.4 106.3 107.2 108.5 106.9 114.2 125.9 110.6 110.5 106.7 104.7 107.4 109.8 103.4 114.8 114.3 109.6 118.3 127.3 112.3 114.9 108.2 105.4 122.1 113.5 110 125.3 114.3 115.6 127.1 123 122.2 126.4 112.7 105.8 120.9 116.3 115.7 127.9 108.3 121.1 128.6 123.1 127.7 126.6 118.4 110 129.6 115.8 125.9 128.4 114 125.6 128.5 136.6 133.1 124.6 123.5 117.2 135.5 124.8 127.8 133.1 125.7 128.4 131.9 146.3 140.6 129.5 132.4 125.9 126.9 135.8
Data Y:
80.6 104.1 108.2 93.4 71.9 94.1 94.9 96.4 91.1 84.4 86.4 88 75.1 109.7 103 82.1 68 96.4 94.3 90 88 76.1 82.5 81.4 66.5 97.2 94.1 80.7 70.5 87.8 89.5 99.6 84.2 75.1 92 80.8 73.1 99.8 90 83.1 72.4 78.8 87.3 91 80.1 73.6 86.4 74.5 71.2 92.4 81.5 85.3 69.9 84.2 90.7 100.3 79.4 84.8 92.9 81.6 76 98.7 89.1 88.7 67.1 93.6 97 100.8 80.1 80.7 89.4 81.5 73.6 90.9 97.3 84.3 65.6 87.3 90.5 82.4 80.4
Sample Range:
(leave blank to include all observations)
From:
To:
Chart options
Label y-axis:
Label x-axis:
R Code
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')
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation