Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
136.5 146.4 157.7 148.7 154.6 152.1 144.8 142.1 157 159.1 164 151.5 135.9 138.5 161 151.7 142.9 157.4 138.9 141 150.9 149.9 153 144.3 128.1 123.3 155.9 144.1 134.1 153.1 131 129.8 139.9 135.6 126.8 134.4 113.5 107.5 133.8 119 125.9 130.1 114.2 111.6 131.2 124.1 127.1 123.4 100.7 100.3 121.6 110.5 110.3 122.7 102.6 101.8 113.6 107.2 116.8 112.5
Data Y:
147.5 164.7 176.2 161.8 171.7 169 161.4 157.2 166.2 162.1 169.1 158.4 139.7 145.2 165.3 154.4 147.4 165.3 145.7 147.2 156.1 152.9 153.8 151.7 131.8 131 155.8 143.8 139.8 160.1 136.5 131 153.7 141.3 138.9 141.2 120.3 118.9 141.7 126.2 130.6 139.8 119.5 115.8 142.6 127.7 131.8 129.5 111.1 112.6 130.8 115.4 120.5 131.9 111.2 108.9 128.1 110.7 124.1 121.5
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