R version 2.8.0 (2008-10-20) 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(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) > x <- 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) > #'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.05777247 -0.05794630 -0.05812017 -0.05829409 -0.05846806 -0.05864208 [7] -0.05881615 -0.05899027 -0.05916443 -0.05933864 -0.05951290 -0.05968720 [13] -0.05986156 -0.06003596 -0.06021041 -0.06038490 -0.06055944 -0.06073403 [19] -0.06090866 -0.06108334 -0.06125807 -0.06143284 -0.06160765 -0.06178252 [25] -0.06195742 -0.06213238 -0.06230737 -0.06248242 -0.06265750 -0.06283264 [31] -0.06300781 -0.06318303 -0.06335830 -0.06353360 -0.06370896 -0.06388435 [37] -0.06405979 -0.06423527 -0.06441080 -0.06458636 -0.06476197 -0.06493763 [43] -0.06511332 -0.06528906 -0.06546484 -0.06564066 -0.06581652 -0.06599243 [49] -0.06616837 -0.06634436 -0.06652039 -0.06669646 -0.06687257 -0.06704872 [55] -0.06722491 -0.06740114 -0.06757741 -0.06775372 -0.06793007 -0.06810646 [61] -0.06828289 -0.06845936 -0.06863586 -0.06881241 -0.06898899 -0.06916562 [67] -0.06934228 -0.06951898 -0.06969571 -0.06987249 -0.07004930 -0.07022615 [73] -0.07040304 -0.07057997 -0.07075693 -0.07093393 -0.07111096 -0.07128803 [79] -0.07146514 -0.07164228 -0.07181946 -0.07199668 -0.07217393 -0.07235122 [85] -0.07252854 -0.07270589 -0.07288328 -0.07306071 -0.07323817 -0.07341567 [91] -0.07359319 -0.07377076 -0.07394835 -0.07412599 -0.07430365 -0.07448135 [97] -0.07465908 -0.07483684 -0.07501464 -0.07519246 -0.07537032 -0.07554822 [103] -0.07572614 -0.07590410 -0.07608209 -0.07626011 -0.07643816 -0.07661624 [109] -0.07679436 -0.07697250 -0.07715068 -0.07732888 -0.07750712 -0.07768538 [115] -0.07786368 -0.07804200 -0.07822036 -0.07839874 -0.07857716 -0.07875560 [121] -0.07893407 -0.07911257 -0.07929110 -0.07946965 -0.07964824 -0.07982685 [127] -0.08000549 -0.08018416 -0.08036285 -0.08054158 -0.08072033 -0.08089910 [133] -0.08107790 -0.08125673 -0.08143559 -0.08161447 -0.08179338 -0.08197231 [139] -0.08215127 -0.08233025 -0.08250926 -0.08268830 -0.08286736 -0.08304644 [145] -0.08322555 -0.08340468 -0.08358384 -0.08376302 -0.08394222 -0.08412145 [151] -0.08430070 -0.08447998 -0.08465927 -0.08483859 -0.08501793 -0.08519730 [157] -0.08537669 -0.08555610 -0.08573553 -0.08591498 -0.08609445 -0.08627395 [163] -0.08645347 -0.08663300 -0.08681256 -0.08699214 -0.08717174 -0.08735136 [169] -0.08753100 -0.08771066 -0.08789034 -0.08807003 -0.08824975 -0.08842949 [175] -0.08860924 -0.08878902 -0.08896881 -0.08914862 -0.08932845 -0.08950830 [181] -0.08968816 -0.08986804 -0.09004794 -0.09022786 -0.09040779 -0.09058774 [187] -0.09076771 -0.09094770 -0.09112770 -0.09130771 -0.09148774 -0.09166779 [193] -0.09184785 -0.09202793 -0.09220802 -0.09238813 -0.09256826 -0.09274839 [199] -0.09292855 -0.09310871 -0.09328889 -0.09346908 -0.09364929 -0.09382951 [205] -0.09400975 -0.09418999 -0.09437025 -0.09455053 -0.09473081 -0.09491111 [211] -0.09509142 -0.09527174 -0.09545207 -0.09563241 -0.09581277 -0.09599314 [217] -0.09617351 -0.09635390 -0.09653430 -0.09671471 -0.09689513 -0.09707556 [223] -0.09725600 -0.09743645 -0.09761690 -0.09779737 -0.09797785 -0.09815833 [229] -0.09833883 -0.09851933 -0.09869984 -0.09888036 -0.09906088 -0.09924142 [235] -0.09942196 -0.09960251 -0.09978306 -0.09996363 -0.10014419 -0.10032477 [241] -0.10050535 -0.10068594 -0.10086654 -0.10104714 -0.10122774 -0.10140835 [247] -0.10158897 -0.10176959 -0.10195021 -0.10213084 -0.10231148 -0.10249212 [253] -0.10267276 -0.10285341 -0.10303406 -0.10321471 -0.10339537 -0.10357603 [259] -0.10375669 -0.10393736 -0.10411803 -0.10429870 -0.10447937 -0.10466004 [265] -0.10484072 -0.10502140 -0.10520208 -0.10538276 -0.10556344 -0.10574412 [271] -0.10592480 -0.10610548 -0.10628616 -0.10646685 -0.10664753 -0.10682821 [277] -0.10700889 -0.10718957 -0.10737025 -0.10755093 -0.10773161 -0.10791228 [283] -0.10809296 -0.10827363 -0.10845430 -0.10863496 -0.10881563 -0.10899629 [289] -0.10917695 -0.10935760 -0.10953826 -0.10971891 -0.10989955 -0.11008019 [295] -0.11026083 -0.11044146 -0.11062209 -0.11080271 -0.11098333 -0.11116395 [301] -0.11134455 -0.11152516 -0.11170575 -0.11188635 -0.11206693 -0.11224751 [307] -0.11242808 -0.11260865 -0.11278921 -0.11296976 -0.11315031 -0.11333084 [313] -0.11351137 -0.11369190 -0.11387241 -0.11405292 -0.11423341 -0.11441390 [319] -0.11459438 -0.11477486 -0.11495532 -0.11513577 -0.11531622 -0.11549665 [325] -0.11567707 -0.11585749 -0.11603789 -0.11621829 -0.11639867 -0.11657904 [331] -0.11675940 -0.11693975 -0.11712009 -0.11730042 -0.11748073 -0.11766103 [337] -0.11784133 -0.11802160 -0.11820187 -0.11838212 -0.11856236 -0.11874259 [343] -0.11892280 -0.11910300 -0.11928319 -0.11946336 -0.11964352 -0.11982366 [349] -0.12000379 -0.12018391 -0.12036401 -0.12054409 -0.12072416 -0.12090421 [355] -0.12108425 -0.12126428 -0.12144428 -0.12162427 -0.12180425 -0.12198420 [361] -0.12216415 -0.12234407 -0.12252398 -0.12270386 -0.12288374 -0.12306359 [367] -0.12324343 -0.12342324 -0.12360304 -0.12378282 -0.12396259 -0.12414233 [373] -0.12432205 -0.12450176 -0.12468145 -0.12486111 -0.12504076 -0.12522038 [379] -0.12539999 -0.12557958 -0.12575914 -0.12593869 -0.12611821 -0.12629771 [385] -0.12647719 -0.12665665 -0.12683609 -0.12701551 -0.12719490 -0.12737427 [391] -0.12755362 -0.12773295 -0.12791225 -0.12809153 -0.12827079 -0.12845002 [397] -0.12862923 -0.12880842 -0.12898758 -0.12916672 -0.12934584 > mx [1] 0.1293458 > 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/freestat/rcomp/tmp/1anlv1226408397.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/freestat/rcomp/tmp/27s1a1226408397.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/freestat/rcomp/tmp/3zld71226408397.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/4xzb81226408397.tab") > > system("convert tmp/1anlv1226408397.ps tmp/1anlv1226408397.png") > system("convert tmp/27s1a1226408397.ps tmp/27s1a1226408397.png") > system("convert tmp/3zld71226408397.ps tmp/3zld71226408397.png") > > > proc.time() user system elapsed 1.242 0.821 1.345