R version 2.7.2 (2008-08-25) Copyright (C) 2008 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(98.6,98,106.8,96.7,100.2,107.7,92,98.4,107.4,117.7,105.7,97.5,99.9,98.2,104.5,100.8,101.5,103.9,99.6,98.4,112.7,118.4,108.1,105.4,114.6,106.9,115.9,109.8,101.8,114.2,110.8,108.4,127.5,128.6,116.6,127.4,105,108.3,125,111.6,106.5,130.3,115,116.1,134,126.5,125.8,136.4,114.9,110.9,125.5,116.8,116.8,125.5,104.2,115.1,132.8,123.3,124.8,122,117.4,117.9,137.4,114.6,124.7,129.6,109.4,120.9,134.9,136.3,133.2,127.2,122.7,120.5,137.8,119.1,124.3,134.4,121.1,122.2,127.7,137.4,132.2,129.2,124.9,124.8,128.2,134.4,118.6,132.6,123.2,112.3) > x <- c(98.1,101.1,111.1,93.3,100,108,70.4,75.4,105.5,112.3,102.5,93.5,86.7,95.2,103.8,97,95.5,101,67.5,64,106.7,100.6,101.2,93.1,84.2,85.8,91.8,92.4,80.3,79.7,62.5,57.1,100.8,100.7,86.2,83.2,71.7,77.5,89.8,80.3,78.7,93.8,57.6,60.6,91,85.3,77.4,77.3,68.3,69.9,81.7,75.1,69.9,84,54.3,60,89.9,77,85.3,77.6,69.2,75.5,85.7,72.2,79.9,85.3,52.2,61.2,82.4,85.4,78.2,70.2,70.2,69.3,77.5,66.1,69,79.2,56.2,63.3,77.8,92,78.1,65.1,71.1,70.9,72,81.9,70.6,72.5,65.1,61.1) > #'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.03658514 -0.03693973 -0.03729454 -0.03764957 -0.03800483 -0.03836031 [7] -0.03871601 -0.03907192 -0.03942805 -0.03978440 -0.04014095 -0.04049772 [13] -0.04085469 -0.04121187 -0.04156925 -0.04192683 -0.04228462 -0.04264260 [19] -0.04300077 -0.04335915 -0.04371771 -0.04407646 -0.04443540 -0.04479453 [25] -0.04515384 -0.04551334 -0.04587301 -0.04623287 -0.04659289 -0.04695310 [31] -0.04731347 -0.04767402 -0.04803473 -0.04839562 -0.04875666 -0.04911787 [37] -0.04947924 -0.04984076 -0.05020244 -0.05056428 -0.05092627 -0.05128841 [43] -0.05165070 -0.05201313 -0.05237571 -0.05273843 -0.05310128 -0.05346428 [49] -0.05382742 -0.05419068 -0.05455408 -0.05491761 -0.05528127 -0.05564505 [55] -0.05600896 -0.05637298 -0.05673713 -0.05710139 -0.05746577 -0.05783027 [61] -0.05819487 -0.05855958 -0.05892440 -0.05928933 -0.05965436 -0.06001948 [67] -0.06038471 -0.06075003 -0.06111545 -0.06148096 -0.06184656 -0.06221225 [73] -0.06257803 -0.06294389 -0.06330983 -0.06367585 -0.06404194 -0.06440812 [79] -0.06477437 -0.06514068 -0.06550707 -0.06587352 -0.06624004 -0.06660663 [85] -0.06697327 -0.06733997 -0.06770673 -0.06807354 -0.06844040 -0.06880732 [91] -0.06917428 -0.06954129 -0.06990834 -0.07027543 -0.07064257 -0.07100973 [97] -0.07137694 -0.07174418 -0.07211145 -0.07247874 -0.07284607 -0.07321342 [103] -0.07358079 -0.07394818 -0.07431559 -0.07468301 -0.07505045 -0.07541790 [109] -0.07578536 -0.07615283 -0.07652030 -0.07688778 -0.07725525 -0.07762273 [115] -0.07799020 -0.07835767 -0.07872512 -0.07909257 -0.07946001 -0.07982743 [121] -0.08019484 -0.08056223 -0.08092959 -0.08129694 -0.08166426 -0.08203155 [127] -0.08239882 -0.08276605 -0.08313325 -0.08350041 -0.08386754 -0.08423463 [133] -0.08460167 -0.08496867 -0.08533563 -0.08570254 -0.08606939 -0.08643619 [139] -0.08680294 -0.08716964 -0.08753627 -0.08790284 -0.08826935 -0.08863579 [145] -0.08900217 -0.08936848 -0.08973471 -0.09010087 -0.09046696 -0.09083297 [151] -0.09119890 -0.09156474 -0.09193050 -0.09229618 -0.09266176 -0.09302726 [157] -0.09339266 -0.09375797 -0.09412318 -0.09448829 -0.09485330 -0.09521821 [163] -0.09558301 -0.09594770 -0.09631229 -0.09667676 -0.09704112 -0.09740536 [169] -0.09776949 -0.09813349 -0.09849738 -0.09886114 -0.09922477 -0.09958828 [175] -0.09995165 -0.10031489 -0.10067800 -0.10104097 -0.10140381 -0.10176650 [181] -0.10212905 -0.10249145 -0.10285371 -0.10321582 -0.10357778 -0.10393959 [187] -0.10430124 -0.10466273 -0.10502407 -0.10538524 -0.10574625 -0.10610710 [193] -0.10646777 -0.10682828 -0.10718862 -0.10754879 -0.10790878 -0.10826859 [199] -0.10862823 -0.10898768 -0.10934695 -0.10970604 -0.11006493 -0.11042364 [205] -0.11078216 -0.11114049 -0.11149862 -0.11185655 -0.11221429 -0.11257182 [211] -0.11292915 -0.11328628 -0.11364320 -0.11399991 -0.11435641 -0.11471269 [217] -0.11506877 -0.11542462 -0.11578026 -0.11613568 -0.11649088 -0.11684585 [223] -0.11720060 -0.11755512 -0.11790940 -0.11826346 -0.11861728 -0.11897087 [229] -0.11932422 -0.11967734 -0.12003021 -0.12038283 -0.12073522 -0.12108735 [235] -0.12143924 -0.12179088 -0.12214226 -0.12249339 -0.12284427 -0.12319489 [241] -0.12354524 -0.12389534 -0.12424517 -0.12459474 -0.12494404 -0.12529308 [247] -0.12564184 -0.12599033 -0.12633854 -0.12668648 -0.12703415 -0.12738153 [253] -0.12772863 -0.12807545 -0.12842199 -0.12876823 -0.12911419 -0.12945986 [259] -0.12980524 -0.13015033 -0.13049511 -0.13083961 -0.13118380 -0.13152770 [265] -0.13187129 -0.13221457 -0.13255756 -0.13290023 -0.13324260 -0.13358465 [271] -0.13392640 -0.13426783 -0.13460894 -0.13494974 -0.13529022 -0.13563037 [277] -0.13597021 -0.13630972 -0.13664891 -0.13698777 -0.13732630 -0.13766450 [283] -0.13800236 -0.13833990 -0.13867710 -0.13901396 -0.13935048 -0.13968667 [289] -0.14002251 -0.14035801 -0.14069317 -0.14102797 -0.14136243 -0.14169655 [295] -0.14203031 -0.14236371 -0.14269677 -0.14302947 -0.14336181 -0.14369379 [301] -0.14402541 -0.14435667 -0.14468757 -0.14501811 -0.14534827 -0.14567807 [307] -0.14600750 -0.14633656 -0.14666525 -0.14699357 -0.14732151 -0.14764907 [313] -0.14797626 -0.14830306 -0.14862949 -0.14895553 -0.14928119 -0.14960647 [319] -0.14993136 -0.15025586 -0.15057997 -0.15090370 -0.15122703 -0.15154996 [325] -0.15187250 -0.15219465 -0.15251640 -0.15283775 -0.15315870 -0.15347925 [331] -0.15379939 -0.15411914 -0.15443847 -0.15475740 -0.15507593 -0.15539404 [337] -0.15571174 -0.15602903 -0.15634591 -0.15666237 -0.15697842 -0.15729405 [343] -0.15760926 -0.15792405 -0.15823843 -0.15855237 -0.15886590 -0.15917900 [349] -0.15949168 -0.15980393 -0.16011575 -0.16042714 -0.16073811 -0.16104864 [355] -0.16135874 -0.16166840 -0.16197763 -0.16228642 -0.16259477 -0.16290269 [361] -0.16321017 -0.16351720 -0.16382380 -0.16412995 -0.16443565 -0.16474091 [367] -0.16504573 -0.16535009 -0.16565401 -0.16595748 -0.16626049 -0.16656306 [373] -0.16686517 -0.16716683 -0.16746803 -0.16776878 -0.16806907 -0.16836890 [379] -0.16866827 -0.16896718 -0.16926563 -0.16956362 -0.16986115 -0.17015821 [385] -0.17045480 -0.17075093 -0.17104659 -0.17134179 -0.17163651 -0.17193076 [391] -0.17222455 -0.17251786 -0.17281069 -0.17310306 -0.17339495 -0.17368636 [397] -0.17397730 -0.17426775 -0.17455773 -0.17484723 -0.17513625 > mx [1] 0.1751363 > 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/1btq31226497664.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/222381226497664.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/3fgi01226497664.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/4n5vi1226497664.tab") > > system("convert tmp/1btq31226497664.ps tmp/1btq31226497664.png") > system("convert tmp/222381226497664.ps tmp/222381226497664.png") > system("convert tmp/3fgi01226497664.ps tmp/3fgi01226497664.png") > > > proc.time() user system elapsed 0.999 0.501 1.156