Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
114.08 112.95 135.31 134.31 133.03 140.11 124.69 131.68 150.95 137.26 130.51 143.15 118.01 122.56 147.97 135.74 151.62 154.82 145.59 147.12 175.86 140.66 152.69 154.38 132.45 136.44 153.24 154.11 155.93 142.53 148.73 147.73 166.79 144.30 156.07 161.70 152.10 140.45 155.56 174.53 167.16 159.48 173.22 176.13 180.31 185.84 169.43 195.25 174.99 156.42 182.08 182.00 153.28 136.72 130.19 132.04 143.89 133.38 127.98 150.45 133.55
Data Y:
136.49 142.62 141.71 149.51 147.39 131.96 136.38 127.34 133.85 125.14 141.25 149.32 120.92 134.85 131.93 134.22 143.07 145.37 134.32 126.31 162.21 124.09 153.91 154.34 138.70 150.98 146.39 178.30 168.23 162.52 158.86 152.17 171.01 171.49 189.62 177.46 179.98 156.96 167.89 194.78 192.78 165.06 196.60 151.64 187.02 210.99 219.08 235.68 241.44 187.46 229.57 208.44 215.09 217.00 171.08 178.41 196.34 172.11 154.93 182.26 181.74
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
1 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation