y <- c(64.5,57.9,72.5,82.9,62.7,66.6,70.9,56.3,81.2,67.8,57.2,62.8,51.2,66.5,71.5,67.8,56.9,90.6,64.1,65.7,77.9,84.2,81.7,65.9,76.1,80.1,74.3,86.5,70.9,91.5,93.7,77.5,100.3,85.7,95,73.7,87.6,87.6,92.9,80.7,74,87.7,68.2,117.4,100.1,97.7,101.1,87.6,83.2,85.9,118,87.3,79.5,93.2,99.2,66.6,83.9,100.4,73.5,60.8)
x <- c(744.8,672.1,666.6,760.8,756,604.4,883.9,527.9,756.2,812.9,655.6,707.6,612.6,659.2,833.4,727.8,797.2,753,762,613.7,759.2,816.4,736.8,680.1,736.5,637.2,801.9,772.3,897.3,792.1,826.8,666.8,906.6,871.4,891,739.2,833.6,715.6,871.6,751.6,1005.5,681.2,837.3,674.7,806.3,860.2,689.8,691.6,682.6,800.1,1023.7,733.5,875.3,770.2,1005.7,982.3,742.9,974.2,822.3,773.2)
#'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
#Author: Prof. Dr. P. Wessa
#To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
#Source of accompanying publication: Office for Research, Development, and Education
#Technical description: Write here your technical program description (don't use hard returns!)
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))
postscript(file="/var/www/html/rcomp/tmp/12x2k1226347023.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
plot(l,c,main='Box-Cox Linearity Plot',xlab='Lambda',ylab='correlation')
grid()
dev.off()
postscript(file="/var/www/html/rcomp/tmp/28rqa1226347023.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
plot(x,y,main='Linear Fit of Original Data',xlab='x',ylab='y')
abline(r)
grid()
mtext(paste('Residual Standard Deviation = ',se))
dev.off()
postscript(file="/var/www/html/rcomp/tmp/3it8w1226347023.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
plot(x1,y,main='Linear Fit of Transformed Data',xlab='x',ylab='y')
abline(r1)
grid()
mtext(paste('Residual Standard Deviation = ',se1))
dev.off()

#Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
load(file="/var/www/html/rcomp/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="/var/www/html/rcomp/tmp/4e2xv1226347023.tab") 

system("convert tmp/12x2k1226347023.ps tmp/12x2k1226347023.png")
system("convert tmp/28rqa1226347023.ps tmp/28rqa1226347023.png")
system("convert tmp/3it8w1226347023.ps tmp/3it8w1226347023.png")

