R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > y <- c(83.33,83.33,78.33,77.50,76.67,74.17,72.50,72.50,75.83,71.67,74.17,78.33,85.00,83.33,81.67,83.33,85.00,86.67,90.00,90.00,87.50,89.17,85.83,91.67,90.83,90.83,91.67,93.33,94.17,94.17,91.67,93.33,91.67,85.83,93.33,94.17,90.83,90.83,90.83,90.83,87.50,89.17,88.33,90.83,91.67,88.33,85.00,85.83,80.83,84.17,83.33,83.33,83.33,88.33,90.83,90.00,87.50,87.50,86.67,87.50,90.83,90.83,89.17,92.50,87.50,89.17,90.00,91.67,90.00,87.50,87.50,80.00,88.33,83.33,81.67,84.17,85.00,83.33,77.50,81.67,85.00,85.83,89.17,90.00,90.00,90.00,91.67,92.50,93.33,92.50,94.17,93.33,91.67,85.83,77.50,80.83,89.17,92.50,95.83,95.83,95.00,95.00,98.33,99.17,103.33,105.00,104.17,104.17,100.83,105.83,103.33,105.00,103.33,102.50,103.33,101.67,100.00) > x <- c(124.06,124.58,122.00,124.02,124.16,124.29,123.93,124.62,121.81,124.14,124.31,125.15,125.35,125.48,124.17,125.33,124.46,123.39,123.14,122.24,119.31,120.87,120.43,119.41,118.85,119.08,117.25,118.51,118.42,118.56,117.97,117.98,115.25,117.23,117.08,116.83,117.17,117.73,115.74,116.99,116.90,116.49,115.84,115.92,113.32,114.84,114.75,114.84,115.03,115.03,112.99,114.15,113.77,113.57,113.38,112.71,110.27,111.73,112.12,112.31,111.73,111.83,109.99,111.15,111.25,110.87,110.27,110.18,108.15,109.60,109.60,109.41,109.80,109.60,107.76,109.02,108.62,109.02,109.22,108.92,106.69,107.76,107.66,107.85,107.95,107.85,106.30,107.37,107.66,107.46,107.37,107.18,105.43,106.39,106.50,106.50,106.69,106.50,105.14,106.50,106.20,105.72,104.76,104.55,102.71,104.36,104.65,104.46,104.65,103.88,102.32,103.39,103.00,102.71,102.51,102.04,100.00) > #'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 [1] -0.6370071 -0.6369687 -0.6369303 -0.6368920 -0.6368536 -0.6368152 [7] -0.6367768 -0.6367384 -0.6366999 -0.6366615 -0.6366231 -0.6365846 [13] -0.6365461 -0.6365077 -0.6364692 -0.6364307 -0.6363922 -0.6363537 [19] -0.6363152 -0.6362766 -0.6362381 -0.6361995 -0.6361610 -0.6361224 [25] -0.6360838 -0.6360452 -0.6360066 -0.6359680 -0.6359294 -0.6358908 [31] -0.6358521 -0.6358135 -0.6357748 -0.6357362 -0.6356975 -0.6356588 [37] -0.6356201 -0.6355814 -0.6355427 -0.6355040 -0.6354653 -0.6354265 [43] -0.6353878 -0.6353490 -0.6353102 -0.6352715 -0.6352327 -0.6351939 [49] -0.6351551 -0.6351163 -0.6350775 -0.6350386 -0.6349998 -0.6349609 [55] -0.6349221 -0.6348832 -0.6348444 -0.6348055 -0.6347666 -0.6347277 [61] -0.6346888 -0.6346499 -0.6346109 -0.6345720 -0.6345331 -0.6344941 [67] -0.6344552 -0.6344162 -0.6343772 -0.6343382 -0.6342993 -0.6342603 [73] -0.6342212 -0.6341822 -0.6341432 -0.6341042 -0.6340651 -0.6340261 [79] -0.6339870 -0.6339480 -0.6339089 -0.6338698 -0.6338307 -0.6337916 [85] -0.6337525 -0.6337134 -0.6336743 -0.6336352 -0.6335960 -0.6335569 [91] -0.6335177 -0.6334786 -0.6334394 -0.6334002 -0.6333610 -0.6333219 [97] -0.6332827 -0.6332435 -0.6332042 -0.6331650 -0.6331258 -0.6330866 [103] -0.6330473 -0.6330081 -0.6329688 -0.6329295 -0.6328903 -0.6328510 [109] -0.6328117 -0.6327724 -0.6327331 -0.6326938 -0.6326545 -0.6326151 [115] -0.6325758 -0.6325365 -0.6324971 -0.6324578 -0.6324184 -0.6323790 [121] -0.6323397 -0.6323003 -0.6322609 -0.6322215 -0.6321821 -0.6321427 [127] -0.6321033 -0.6320639 -0.6320244 -0.6319850 -0.6319456 -0.6319061 [133] -0.6318666 -0.6318272 -0.6317877 -0.6317482 -0.6317088 -0.6316693 [139] -0.6316298 -0.6315903 -0.6315508 -0.6315112 -0.6314717 -0.6314322 [145] -0.6313927 -0.6313531 -0.6313136 -0.6312740 -0.6312345 -0.6311949 [151] -0.6311553 -0.6311157 -0.6310761 -0.6310366 -0.6309970 -0.6309574 [157] -0.6309177 -0.6308781 -0.6308385 -0.6307989 -0.6307592 -0.6307196 [163] -0.6306800 -0.6306403 -0.6306006 -0.6305610 -0.6305213 -0.6304816 [169] -0.6304420 -0.6304023 -0.6303626 -0.6303229 -0.6302832 -0.6302435 [175] -0.6302037 -0.6301640 -0.6301243 -0.6300846 -0.6300448 -0.6300051 [181] -0.6299653 -0.6299256 -0.6298858 -0.6298461 -0.6298063 -0.6297665 [187] -0.6297267 -0.6296869 -0.6296471 -0.6296073 -0.6295675 -0.6295277 [193] -0.6294879 -0.6294481 -0.6294083 -0.6293685 -0.6293286 -0.6292888 [199] -0.6292489 -0.6292091 -0.6291692 -0.6291294 -0.6290895 -0.6290496 [205] -0.6290098 -0.6289699 -0.6289300 -0.6288901 -0.6288502 -0.6288103 [211] -0.6287704 -0.6287305 -0.6286906 -0.6286507 -0.6286108 -0.6285708 [217] -0.6285309 -0.6284910 -0.6284510 -0.6284111 -0.6283711 -0.6283312 [223] -0.6282912 -0.6282513 -0.6282113 -0.6281713 -0.6281314 -0.6280914 [229] -0.6280514 -0.6280114 -0.6279714 -0.6279314 -0.6278914 -0.6278514 [235] -0.6278114 -0.6277714 -0.6277314 -0.6276913 -0.6276513 -0.6276113 [241] -0.6275713 -0.6275312 -0.6274912 -0.6274511 -0.6274111 -0.6273710 [247] -0.6273310 -0.6272909 -0.6272508 -0.6272108 -0.6271707 -0.6271306 [253] -0.6270905 -0.6270505 -0.6270104 -0.6269703 -0.6269302 -0.6268901 [259] -0.6268500 -0.6268099 -0.6267698 -0.6267297 -0.6266895 -0.6266494 [265] -0.6266093 -0.6265692 -0.6265290 -0.6264889 -0.6264488 -0.6264086 [271] -0.6263685 -0.6263283 -0.6262882 -0.6262480 -0.6262079 -0.6261677 [277] -0.6261276 -0.6260874 -0.6260472 -0.6260071 -0.6259669 -0.6259267 [283] -0.6258865 -0.6258463 -0.6258062 -0.6257660 -0.6257258 -0.6256856 [289] -0.6256454 -0.6256052 -0.6255650 -0.6255248 -0.6254846 -0.6254443 [295] -0.6254041 -0.6253639 -0.6253237 -0.6252835 -0.6252432 -0.6252030 [301] -0.6251628 -0.6251226 -0.6250823 -0.6250421 -0.6250018 -0.6249616 [307] -0.6249214 -0.6248811 -0.6248409 -0.6248006 -0.6247603 -0.6247201 [313] -0.6246798 -0.6246396 -0.6245993 -0.6245590 -0.6245188 -0.6244785 [319] -0.6244382 -0.6243979 -0.6243577 -0.6243174 -0.6242771 -0.6242368 [325] -0.6241965 -0.6241562 -0.6241160 -0.6240757 -0.6240354 -0.6239951 [331] -0.6239548 -0.6239145 -0.6238742 -0.6238339 -0.6237936 -0.6237533 [337] -0.6237130 -0.6236726 -0.6236323 -0.6235920 -0.6235517 -0.6235114 [343] -0.6234711 -0.6234308 -0.6233904 -0.6233501 -0.6233098 -0.6232695 [349] -0.6232291 -0.6231888 -0.6231485 -0.6231081 -0.6230678 -0.6230275 [355] -0.6229871 -0.6229468 -0.6229065 -0.6228661 -0.6228258 -0.6227854 [361] -0.6227451 -0.6227048 -0.6226644 -0.6226241 -0.6225837 -0.6225434 [367] -0.6225030 -0.6224627 -0.6224223 -0.6223820 -0.6223416 -0.6223013 [373] -0.6222609 -0.6222205 -0.6221802 -0.6221398 -0.6220995 -0.6220591 [379] -0.6220188 -0.6219784 -0.6219380 -0.6218977 -0.6218573 -0.6218169 [385] -0.6217766 -0.6217362 -0.6216958 -0.6216555 -0.6216151 -0.6215747 [391] -0.6215344 -0.6214940 -0.6214536 -0.6214133 -0.6213729 -0.6213325 [397] -0.6212922 -0.6212518 -0.6212114 -0.6211710 -0.6211307 > mx [1] 0.6370071 > mxli [1] -2 > 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/1kai31257760411.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/279j51257760411.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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3pn5w1257760411.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() null device 1 > > #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/4bl541257760411.tab") > > system("convert tmp/1kai31257760411.ps tmp/1kai31257760411.png") > system("convert tmp/279j51257760411.ps tmp/279j51257760411.png") > system("convert tmp/3pn5w1257760411.ps tmp/3pn5w1257760411.png") > > > proc.time() user system elapsed 0.806 0.518 1.687