Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
12192.5 11268.8 9097.4 12639.8 13040.1 11687.3 11191.7 11391.9 11793.1 13933.2 12778.1 11810.3 13698.4 11956.6 10723.8 13938.9 13979.8 13807.4 12973.9 12509.8 12934.1 14908.3 13772.1 13012.6 14049.9 11816.5 11593.2 14466.2 13615.9 14733.9 13880.7 13527.5 13584 16170.2 13260.6 14741.9 15486.5 13154.5 12621.2 15031.6 15452.4 15428 13105.9 14716.8 14180 16202.2 14392.4 15140.6 15960.1 14351.3 13230.2 15202.1 17157.3 16159.1 13405.7 17224.7 17338.4 17370.6 18817.8 16593.2 17979.5
Data Y:
3277.2 3833 2606.3 3643.8 3686.4 3281.6 3669.3 3191.5 3512.7 3970.7 3601.2 3610 4172.1 3956.2 3142.7 3884.3 3892.2 3613 3730.5 3481.3 3649.5 4215.2 4066.6 4196.8 4536.6 4441.6 3548.3 4735.9 4130.6 4356.2 4159.6 3988 4167.8 4902.2 3909.4 4697.6 4308.9 4420.4 3544.2 4433 4479.7 4533.2 4237.5 4207.4 4394 5148.4 4202.2 4682.5 4884.3 5288.9 4505.2 4611.5 5081.1 4523.1 4412.8 4647.4 4778.6 4495.3 4633.5 4360.5 4517.9
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