Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
100.00 108.16 114.02 102.19 110.37 96.86 94.19 99.52 94.06 97.55 78.15 81.24 92.36 96.06 114.05 110.66 104.92 90.00 95.70 86.03 84.85 100.04 80.92 74.07 77.30 97.23 90.76 100.56 92.01 99.24 105.87 90.99 93.31 91.17 77.33 91.13 85.01 83.90 104.86 110.90 95.44 111.62 108.89 96.18 101.97 99.12 86.78 118.42 118.74 106.53 134.78 104.68 105.30 139.41 103.61 99.78 103.46 120.06 96.71 107.13 105.36 111.69 132.05 126.80 154.48 141.56 109.95 127.90 133.09 120.08 117.56 143.04
Data Y:
100.00 99.97 101.03 101.00 101.30 101.43 101.49 102.14 102.58 102.34 102.07 101.83 102.14 102.58 102.63 102.74 103.32 103.27 102.48 102.14 102.07 101.69 101.15 100.90 101.77 101.93 102.27 102.49 102.80 102.82 102.83 102.89 102.87 102.67 102.96 103.22 103.53 104.63 104.63 104.17 103.93 104.01 104.16 105.22 105.85 106.21 105.77 105.63 106.49 107.51 110.43 111.42 111.58 111.34 111.08 111.66 112.36 112.31 111.52 110.87 111.13 112.71 113.25 113.09 112.55 112.87 113.59 115.14 116.38 116.50 116.25 116.73
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