Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
90.49 90.65 90.95 91.19 91.07 91.15 91.81 91.95 91.62 91.27 91.4 91.76 91.99 92.34 92.3 92.85 92.94 93.26 94.21 94.08 93.98 94.23 94.93 95.09 95.37 96.23 96.2 95.43 95.63 95.96 96.51 96.65 96.21 95.54 95.96 96.41 96.32 96.94 96.97 97.63 97.33 97.66 98.18 98.22 97.91 97.93 98.4 98.78 98.73 99.4 99.04 99.68 99.62 99.8 100.65 100.59 100.46 100.57 100.75 100.7 101.44 101.77 101.79 101.52 101.83 102.23 103.04 102.81 102.48 102.81 103.21 103.21 102.92 103.48 103.18 103.39 103.5 103.73 104.42 104.53 104.09 104.23 104.23 104.54 104.65 105.48 105.61 105.74 105.86 105.81 106.49 106.43 105.73
Data Y:
91.25 91.5 91.68 91.81 91.84 91.93 92.08 92.11 92.26 92.28 92.39 92.46 92.82 93.16 93.33 93.51 93.56 93.67 93.76 93.88 94.01 94.21 94.31 94.4 94.9 95.31 95.52 95.68 95.91 95.97 96.15 96.34 96.42 96.54 96.72 96.81 97.19 97.5 97.71 97.86 98.04 98.2 98.25 98.41 98.56 98.62 98.75 98.71 99.05 99.52 99.71 99.8 100.01 99.99 100.12 100.15 100.27 100.42 100.43 100.5 100.95 101.26 101.42 101.68 101.75 101.89 102.07 102.22 102.45 102.62 102.67 102.86 104.78 104.87 105.06 105.14 105.32 105.54 105.68 105.77 106.07 106.03 106.13 106.28 106.61 106.74 107.01 107.1 107.28 107.4 107.59 107.69 107.78
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