Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
1846.5 2796.3 2895.6 2472.2 2584.4 2630.4 2663.1 3176.2 2856.7 2551.4 3088.7 2628.3 2226.2 3023.6 3077.9 3084.1 2990.3 2949.6 3014.7 3517.7 3121.2 3067.4 3174.6 2676.3 2424 3195.1 3146.6 3506.7 3528.5 3365.1 3153 3843.3 3123.2 3361.1 3481.9 2970.5 2537 3257.6 3301.3 3391.6 2933.6 3283.2 3139.7 3486.4 3202.2 3294.4 3550.3 3279.3 2678.6 3451.4 3977.1 3814.8 3310.5 3971.8 4051.9 4057.6 4391.4 3628.9 4092.2 3822.5
Data Y:
1530.9 2220.6 2161.5 1863.6 1955.1 1907.4 1889.4 2246.3 2213 1965 2285.6 1983.8 1872.4 2371.4 2287 2198.2 2330.4 2014.4 2066.1 2355.8 2232.5 2091.7 2376.5 1931.9 2025.7 2404.9 2316.1 2368.1 2282.5 2158.6 2174.8 2594.1 2281.4 2547.9 2606.3 2190.8 2262.3 2423.8 2520.4 2482.9 2215.9 2441.9 2333.8 2670.2 2431 2559.3 2661.4 2404.6 2378.3 2489.2 2959 2713.5 2341.3 2833.2 2849.7 2871.7 3058.3 2855.1 3083.6 2828.3
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