Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
105.81 107.16 107.83 108.85 109.52 110.19 111.20 111.54 111.88 112.55 112.55 112.55 114.24 116.26 116.60 118.62 119.63 120.64 121.65 122.33 122.66 123.00 123.34 124.68 125.02 125.02 125.36 125.70 125.70 126.03 126.37 126.37 126.71 126.71 127.04 127.04 127.38 127.72 128.05 129.40 131.09 131.42 131.76 132.10 132.43 132.77 132.77 133.11 133.45 133.78 134.12 134.46 134.79 134.79 135.13 135.13 136.82 137.15 142.54 143.89
Data Y:
112.39 97.59 142.30 120.79 121.24 104.61 119.86 117.81 91.86 117.37 112.84 101.95 120.52 102.84 137.41 118.97 125.01 118.57 130.61 116.30 99.15 110.26 107.59 107.01 113.77 93.33 147.32 124.48 106.79 134.39 111.41 132.43 98.26 109.81 115.28 108.97 99.19 105.46 138.97 124.52 117.37 123.86 116.39 124.70 97.46 103.24 112.39 107.19 100.53 95.73 143.54 101.99 120.66 121.46 102.97 121.32 85.02 106.21 110.39 87.10
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