Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
12710.3 12120.8 12469.5 12054.6 12112.9 9617.2 12645.8 13581.3 12162.3 10969.7 11880 11887.6 12926.9 12300 12092.8 12380.8 12196.9 9455 13168 13427.9 11980.5 11884.8 11691.7 12233.8 14341.4 13130.7 12421.1 14285.8 12864.6 11160.2 14316.2 14388.7 14013.9 13419 12769.6 13315.5 15332.9 14243 13824.4 14962.9 13202.9 12199 15508.9 14199.8 15169.6 14058 13786.2 14147.9 16541.7 13587.5 15582.4 15802.8 14130.5 12923.2 15612.2 16033.7 16036.6 14037.8 15330.6 15038.3 17401.8 14992.5 16043.7 16929.6 15921.3 14417.2 15961 17851.9 16483.9 14215.5 17429.7 17839.5 17629.2
Data Y:
2468.9 2469.2 2417.7 2411.1 2361 1924.1 2486.9 2674.9 2296.2 2101.5 2322 2273.8 2501.3 2435.2 2273.3 2454.7 2328.8 1897 2608.1 2712.3 2322 2282.6 2241.1 2417.2 2829 2600.6 2321 2768.5 2457.3 2142.7 2764.4 2788.9 2679.5 2536.5 2682.7 2699.6 3097.8 3015.2 2878 3010.9 2612.3 2419.3 3096.5 3013 3397.4 3423.1 3298.7 3065.7 3918.3 3154.4 3334.7 3461.6 3018.5 2832 3301.3 3342.8 3464.4 3016.6 3201.3 3135.3 3549.8 3247.2 3441.8 3535.6 3384.7 2996.6 3402.8 3900.2 3776.4 3197.5 4022.4 3845.1 3818.6
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