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(1.1663,1.1372,1.1139,1.1222,1.1692,1.1702,1.2286,1.2613,1.2646,1.2262,1.1985,1.2007,1.2138,1.2266,1.2176,1.2218,1.249,1.2991,1.3408,1.3119,1.3014,1.3201,1.2938,1.2694,1.2165,1.2037,1.2292,1.2256,1.2015,1.1786,1.1856,1.2103,1.1938,1.202,1.2271,1.277,1.265,1.2684,1.2811,1.2727,1.2611,1.2881,1.3213,1.2999,1.3074,1.3242,1.3516,1.3511,1.3419,1.3716,1.3622,1.3896,1.4227,1.4684,1.457,1.4718,1.4748,1.5527,1.575,1.5557,1.5553) > x <- c(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,750.9,708,690,652.8,620.7,461.9) > #'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.17864585 -0.17844836 -0.17825059 -0.17805255 -0.17785424 -0.17765566 [7] -0.17745680 -0.17725768 -0.17705828 -0.17685862 -0.17665868 -0.17645848 [13] -0.17625802 -0.17605729 -0.17585629 -0.17565503 -0.17545350 -0.17525172 [19] -0.17504967 -0.17484736 -0.17464479 -0.17444197 -0.17423888 -0.17403554 [25] -0.17383194 -0.17362808 -0.17342398 -0.17321961 -0.17301500 -0.17281013 [31] -0.17260501 -0.17239964 -0.17219403 -0.17198816 -0.17178205 -0.17157569 [37] -0.17136908 -0.17116223 -0.17095514 -0.17074780 -0.17054022 -0.17033240 [43] -0.17012435 -0.16991605 -0.16970751 -0.16949874 -0.16928973 -0.16908048 [49] -0.16887100 -0.16866129 -0.16845134 -0.16824117 -0.16803076 -0.16782012 [55] -0.16760926 -0.16739816 -0.16718684 -0.16697530 -0.16676353 -0.16655154 [61] -0.16633932 -0.16612688 -0.16591422 -0.16570135 -0.16548825 -0.16527493 [67] -0.16506140 -0.16484766 -0.16463369 -0.16441952 -0.16420513 -0.16399053 [73] -0.16377572 -0.16356070 -0.16334547 -0.16313004 -0.16291439 -0.16269855 [79] -0.16248249 -0.16226624 -0.16204978 -0.16183312 -0.16161626 -0.16139920 [85] -0.16118194 -0.16096448 -0.16074683 -0.16052899 -0.16031094 -0.16009271 [91] -0.15987428 -0.15965567 -0.15943686 -0.15921786 -0.15899868 -0.15877930 [97] -0.15855975 -0.15834000 -0.15812008 -0.15789997 -0.15767968 -0.15745921 [103] -0.15723856 -0.15701773 -0.15679672 -0.15657554 -0.15635418 -0.15613265 [109] -0.15591094 -0.15568906 -0.15546701 -0.15524479 -0.15502241 -0.15479985 [115] -0.15457713 -0.15435424 -0.15413118 -0.15390796 -0.15368458 -0.15346104 [121] -0.15323734 -0.15301348 -0.15278945 -0.15256528 -0.15234094 -0.15211645 [127] -0.15189181 -0.15166701 -0.15144206 -0.15121696 -0.15099171 -0.15076631 [133] -0.15054076 -0.15031506 -0.15008922 -0.14986323 -0.14963710 -0.14941083 [139] -0.14918442 -0.14895786 -0.14873117 -0.14850434 -0.14827737 -0.14805026 [145] -0.14782302 -0.14759564 -0.14736813 -0.14714049 -0.14691271 -0.14668481 [151] -0.14645678 -0.14622861 -0.14600033 -0.14577191 -0.14554337 -0.14531471 [157] -0.14508592 -0.14485701 -0.14462798 -0.14439883 -0.14416956 -0.14394018 [163] -0.14371067 -0.14348105 -0.14325132 -0.14302147 -0.14279151 -0.14256144 [169] -0.14233126 -0.14210096 -0.14187056 -0.14164005 -0.14140944 -0.14117871 [175] -0.14094789 -0.14071696 -0.14048592 -0.14025479 -0.14002355 -0.13979222 [181] -0.13956078 -0.13932925 -0.13909762 -0.13886590 -0.13863408 -0.13840217 [187] -0.13817016 -0.13793806 -0.13770587 -0.13747360 -0.13724123 -0.13700877 [193] -0.13677623 -0.13654360 -0.13631089 -0.13607809 -0.13584521 -0.13561224 [199] -0.13537920 -0.13514607 -0.13491287 -0.13467959 -0.13444623 -0.13421279 [205] -0.13397928 -0.13374569 -0.13351203 -0.13327830 -0.13304449 -0.13281062 [211] -0.13257667 -0.13234266 -0.13210857 -0.13187442 -0.13164021 -0.13140593 [217] -0.13117158 -0.13093717 -0.13070270 -0.13046816 -0.13023357 -0.12999891 [223] -0.12976420 -0.12952943 -0.12929460 -0.12905971 -0.12882477 -0.12858978 [229] -0.12835473 -0.12811963 -0.12788447 -0.12764927 -0.12741401 -0.12717871 [235] -0.12694336 -0.12670796 -0.12647251 -0.12623702 -0.12600148 -0.12576590 [241] -0.12553027 -0.12529461 -0.12505890 -0.12482315 -0.12458736 -0.12435153 [247] -0.12411567 -0.12387976 -0.12364382 -0.12340785 -0.12317184 -0.12293579 [253] -0.12269972 -0.12246361 -0.12222747 -0.12199130 -0.12175509 -0.12151886 [259] -0.12128260 -0.12104632 -0.12081000 -0.12057367 -0.12033730 -0.12010091 [265] -0.11986450 -0.11962807 -0.11939161 -0.11915513 -0.11891864 -0.11868212 [271] -0.11844558 -0.11820903 -0.11797246 -0.11773587 -0.11749927 -0.11726265 [277] -0.11702602 -0.11678937 -0.11655272 -0.11631605 -0.11607937 -0.11584267 [283] -0.11560597 -0.11536926 -0.11513255 -0.11489582 -0.11465909 -0.11442235 [289] -0.11418561 -0.11394886 -0.11371211 -0.11347536 -0.11323860 -0.11300184 [295] -0.11276508 -0.11252832 -0.11229157 -0.11205481 -0.11181805 -0.11158130 [301] -0.11134455 -0.11110781 -0.11087107 -0.11063434 -0.11039761 -0.11016089 [307] -0.10992417 -0.10968747 -0.10945077 -0.10921408 -0.10897741 -0.10874074 [313] -0.10850409 -0.10826745 -0.10803082 -0.10779420 -0.10755760 -0.10732102 [319] -0.10708445 -0.10684789 -0.10661136 -0.10637484 -0.10613833 -0.10590185 [325] -0.10566539 -0.10542895 -0.10519253 -0.10495613 -0.10471975 -0.10448339 [331] -0.10424706 -0.10401075 -0.10377447 -0.10353821 -0.10330198 -0.10306577 [337] -0.10282959 -0.10259344 -0.10235732 -0.10212122 -0.10188516 -0.10164912 [343] -0.10141312 -0.10117715 -0.10094121 -0.10070530 -0.10046942 -0.10023358 [349] -0.09999778 -0.09976200 -0.09952627 -0.09929057 -0.09905490 -0.09881928 [355] -0.09858369 -0.09834814 -0.09811262 -0.09787715 -0.09764172 -0.09740633 [361] -0.09717098 -0.09693567 -0.09670040 -0.09646518 -0.09623000 -0.09599486 [367] -0.09575977 -0.09552473 -0.09528973 -0.09505477 -0.09481986 -0.09458500 [373] -0.09435019 -0.09411542 -0.09388071 -0.09364604 -0.09341143 -0.09317686 [379] -0.09294235 -0.09270788 -0.09247347 -0.09223911 -0.09200481 -0.09177056 [385] -0.09153636 -0.09130222 -0.09106813 -0.09083410 -0.09060012 -0.09036620 [391] -0.09013234 -0.08989853 -0.08966479 -0.08943110 -0.08919747 -0.08896390 [397] -0.08873040 -0.08849695 -0.08826356 -0.08803024 -0.08779697 > mx [1] 0.1786459 > 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/1g1sa1226407588.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/2kc1e1226407588.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/39u2n1226407588.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/4olrg1226407588.tab") > > system("convert tmp/1g1sa1226407588.ps tmp/1g1sa1226407588.png") > system("convert tmp/2kc1e1226407588.ps tmp/2kc1e1226407588.png") > system("convert tmp/39u2n1226407588.ps tmp/39u2n1226407588.png") > > > proc.time() user system elapsed 1.028 0.513 1.233