R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(1980 + ,1980 + ,1981 + ,1981 + ,1981 + ,1981 + ,1981 + ,1981 + ,1981 + ,1981 + ,1981 + ,1982 + ,1983 + ,1983 + ,1983 + ,1983 + ,1983 + ,1983 + ,1983 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1984 + ,1985 + ,1987 + ,1987 + ,1987 + ,1988 + ,1988 + ,1988 + ,1988 + ,1988 + ,1989 + ,1989 + ,1989 + ,1990 + ,1991 + ,1992 + ,1993 + ,1994 + ,1995 + ,1995 + ,1995 + ,1995 + ,1995 + ,1995 + ,1995 + ,1995 + ,1995 + ,1995 + ,1996 + ,1996 + ,1996 + ,1996 + ,1996 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1997 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1998 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,1999 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2000 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2001 + ,2002 + ,2002 + ,2002 + ,2002 + ,2002 + ,2002 + ,2002 + ,2002 + ,2002 + ,2002 + ,2002 + ,2003 + ,2003 + ,2003 + ,2003 + ,2003 + ,2003 + ,2003 + ,2003 + ,2004 + ,2004 + ,2004 + ,2004 + ,2004 + ,2004 + ,2004 + ,2004 + ,2004 + ,2004 + ,2004 + ,2004 + ,2004 + ,2004 + ,2005 + ,2005 + ,2005 + ,2005 + ,2005 + ,2007 + ,2007 + ,2007 + ,2007 + ,2007 + ,2007 + ,2007 + ,2007 + ,2007 + ,2007 + ,2010 + ,2010 + ,2010 + ,2010 + ,2010 + ,2010 + ,2010) > x <- c(197632 + ,238592 + ,716800 + ,348160 + ,471040 + ,307200 + ,302080 + ,295936 + ,195584 + ,155648 + ,141312 + ,266240 + ,323584 + ,276480 + ,194560 + ,179200 + ,168960 + ,134144 + ,121856 + ,286720 + ,276480 + ,174080 + ,163840 + ,143360 + ,136192 + ,122880 + ,120832 + ,306176 + ,289792 + ,219136 + ,204800 + ,185344 + ,168960 + ,161792 + ,143360 + ,121856 + ,110592 + ,81920 + ,72704 + ,92160 + ,61440 + ,46080 + ,40960 + ,33792 + ,27648 + ,30720 + ,16384 + ,54272 + ,36864 + ,12288 + ,9216 + ,7168 + ,4096 + ,2048 + ,972.8 + ,870.4 + ,901.12 + ,829.44 + ,1013.76 + ,1290.24 + ,944.128 + ,905.216 + ,685.056 + ,774.144 + ,702.464 + ,302.08 + ,269.312 + ,265.216 + ,211.968 + ,177.152 + ,185.344 + ,151.552 + ,144.384 + ,156.672 + ,124.928 + ,120.832 + ,120.832 + ,106.496 + ,112.64 + ,106.496 + ,104.448 + ,103.424 + ,99.9424 + ,87.4496 + ,81.92 + ,103.424 + ,101.1712 + ,99.4304 + ,97.5872 + ,95.3344 + ,97.4848 + ,95.8464 + ,88.3712 + ,85.9136 + ,80.384 + ,80.0768 + ,87.7568 + ,87.6544 + ,76.0832 + ,62.5664 + ,79.0528 + ,78.1312 + ,68.096 + ,67.8912 + ,65.3312 + ,77.2096 + ,74.9568 + ,67.6864 + ,64.4096 + ,60.7232 + ,83.5584 + ,70.3488 + ,67.6864 + ,60.3136 + ,61.952 + ,62.464 + ,54.784 + ,56.4224 + ,60.5184 + ,57.0368 + ,54.0672 + ,53.5552 + ,53.5552 + ,55.9104 + ,47.5136 + ,53.1456 + ,51.5072 + ,53.248 + ,48.5376 + ,49.0496 + ,43.6224 + ,44.1344 + ,38.6048 + ,37.376 + ,31.4368 + ,35.4304 + ,34.5088 + ,32.9728 + ,32.8704 + ,32.256 + ,32.1536 + ,30.3104 + ,28.9792 + ,33.0752 + ,28.2624 + ,27.7504 + ,25.088 + ,29.4912 + ,28.0576 + ,26.9312 + ,18.944 + ,21.6064 + ,21.0944 + ,20.3776 + ,22.9376 + ,21.6064 + ,21.0944 + ,21.0944 + ,18.944 + ,22.8352 + ,22.528 + ,21.8112 + ,21.8112 + ,18.8416 + ,17.7152 + ,17.3056 + ,16.896 + ,16.6912 + ,15.36 + ,19.73 + ,16.86 + ,16.83 + ,16.76 + ,16.73 + ,16.45 + ,15.82 + ,15.8 + ,15.44 + ,14.29 + ,11.95 + ,15.65 + ,15.06 + ,14.89 + ,14.72 + ,14.58 + ,14.33 + ,14.29 + ,13.88 + ,13.8 + ,13.63 + ,13.47 + ,12.95 + ,12.74 + ,12.54 + ,12.48 + ,11.81 + ,15.22 + ,12.27 + ,11.5 + ,14.57 + ,12.42 + ,11.24 + ,10.06 + ,10.91 + ,10.82 + ,10.41 + ,9.25 + ,8.02 + ,11.5 + ,10.06 + ,9.58 + ,9.14 + ,8.94 + ,7.45 + ,7.27 + ,7.27 + ,7.14 + ,7.88 + ,7.25 + ,6.9 + ,7.31 + ,7.26 + ,6.84 + ,7.48 + ,6.48 + ,5.72 + ,6.82 + ,6.56 + ,6.49 + ,5.87 + ,6.33 + ,6.33 + ,5.75 + ,4.41 + ,2.99 + ,4.57 + ,4.31 + ,3.71 + ,2.65 + ,2.88 + ,3.74 + ,2.59 + ,2.07 + ,2.59 + ,2.88 + ,2.59 + ,2.68 + ,2.58 + ,1.51 + ,1.93 + ,1.78 + ,1.61 + ,1.51 + ,1.42 + ,1.39 + ,1.94 + ,1.94 + ,1.7 + ,1.57 + ,1.41 + ,1.38 + ,1.24 + ,1.22 + ,1.15 + ,1.24 + ,1.21 + ,1.2 + ,0.671 + ,0.598 + ,0.719 + ,0.719 + ,0.719 + ,0.575 + ,0.598 + ,0.426 + ,0.411 + ,0.377 + ,0.371 + ,0.367 + ,0.35 + ,0.333 + ,0.306 + ,0.302 + ,0.287 + ,0.164 + ,0.134 + ,0.0909 + ,0.0688 + ,0.115 + ,0.113 + ,0.0821) > #'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.2856996 -0.2864234 -0.2871541 -0.2878916 -0.2886362 -0.2893879 [7] -0.2901468 -0.2909130 -0.2916868 -0.2924681 -0.2932571 -0.2940540 [13] -0.2948588 -0.2956717 -0.2964929 -0.2973224 -0.2981604 -0.2990071 [19] -0.2998625 -0.3007269 -0.3016003 -0.3024830 -0.3033750 -0.3042766 [25] -0.3051879 -0.3061091 -0.3070403 -0.3079817 -0.3089335 -0.3098958 [31] -0.3108689 -0.3118528 -0.3128480 -0.3138544 -0.3148723 -0.3159019 [37] -0.3169434 -0.3179970 -0.3190630 -0.3201415 -0.3212327 -0.3223370 [43] -0.3234545 -0.3245854 -0.3257301 -0.3268887 -0.3280615 -0.3292488 [49] -0.3304508 -0.3316678 -0.3329001 -0.3341479 -0.3354115 -0.3366913 [55] -0.3379875 -0.3393005 -0.3406305 -0.3419778 -0.3433429 -0.3447260 [61] -0.3461275 -0.3475477 -0.3489869 -0.3504457 -0.3519242 -0.3534230 [67] -0.3549424 -0.3564827 -0.3580445 -0.3596281 -0.3612340 -0.3628626 [73] -0.3645144 -0.3661898 -0.3678893 -0.3696134 -0.3713625 -0.3731373 [79] -0.3749381 -0.3767657 -0.3786204 -0.3805029 -0.3824138 -0.3843536 [85] -0.3863229 -0.3883225 -0.3903528 -0.3924146 -0.3945086 -0.3966354 [91] -0.3987958 -0.4009904 -0.4032201 -0.4054856 -0.4077877 -0.4101272 [97] -0.4125050 -0.4149218 -0.4173787 -0.4198765 -0.4224161 -0.4249985 [103] -0.4276247 -0.4302958 -0.4330127 -0.4357765 -0.4385884 -0.4414495 [109] -0.4443610 -0.4473240 -0.4503399 -0.4534099 -0.4565354 -0.4597177 [115] -0.4629583 -0.4662585 -0.4696198 -0.4730439 -0.4765323 -0.4800866 [121] -0.4837085 -0.4873997 -0.4911621 -0.4949975 -0.4989077 -0.5028947 [127] -0.5069605 -0.5111071 -0.5153368 -0.5196516 -0.5240537 -0.5285456 [133] -0.5331294 -0.5378076 -0.5425827 -0.5474571 -0.5524334 -0.5575142 [139] -0.5627021 -0.5679999 -0.5734101 -0.5789354 -0.5845788 -0.5903427 [145] -0.5962300 -0.6022434 -0.6083854 -0.6146586 -0.6210655 -0.6276085 [151] -0.6342898 -0.6411114 -0.6480751 -0.6551825 -0.6624348 -0.6698330 [157] -0.6773775 -0.6850684 -0.6929051 -0.7008864 -0.7090107 -0.7172751 [163] -0.7256763 -0.7342097 -0.7428700 -0.7516504 -0.7605430 -0.7695385 [169] -0.7786263 -0.7877940 -0.7970278 -0.8063120 -0.8156294 -0.8249609 [175] -0.8342856 -0.8435809 -0.8528225 -0.8619846 -0.8710399 -0.8799598 [181] -0.8887147 -0.8972744 -0.9056081 -0.9136851 -0.9214751 -0.9289486 [187] -0.9360772 -0.9428345 -0.9491959 -0.9551397 -0.9606471 -0.9657025 [193] -0.9702940 -0.9744133 -0.9780561 -0.9812220 -0.9839146 -0.9861409 [199] -0.9879117 -0.9892409 -0.9901453 -0.9906443 -0.9907592 -0.9905130 [205] -0.9899302 -0.9890359 -0.9878557 -0.9864152 -0.9847398 -0.9828544 [211] -0.9807829 -0.9785484 -0.9761726 -0.9736760 -0.9710778 -0.9683957 [217] -0.9656457 -0.9628426 -0.9599997 -0.9571288 -0.9542405 -0.9513439 [223] -0.9484472 -0.9455571 -0.9426797 -0.9398198 -0.9369814 -0.9341679 [229] -0.9313817 -0.9286248 -0.9258986 -0.9232039 -0.9205412 -0.9179105 [235] -0.9153116 -0.9127440 -0.9102069 -0.9076993 -0.9052202 -0.9027684 [241] -0.9003425 -0.8979411 -0.8955627 -0.8932060 -0.8908694 -0.8885514 [247] -0.8862505 -0.8839652 -0.8816942 -0.8794359 -0.8771890 -0.8749522 [253] -0.8727241 -0.8705036 -0.8682894 -0.8660804 -0.8638755 -0.8616736 [259] -0.8594738 -0.8572751 -0.8550766 -0.8528775 -0.8506769 -0.8484742 [265] -0.8462686 -0.8440594 -0.8418460 -0.8396279 -0.8374044 -0.8351751 [271] -0.8329395 -0.8306972 -0.8284477 -0.8261906 -0.8239257 -0.8216525 [277] -0.8193708 -0.8170803 -0.8147808 -0.8124720 -0.8101538 -0.8078258 [283] -0.8054881 -0.8031404 -0.8007826 -0.7984145 -0.7960362 -0.7936475 [289] -0.7912484 -0.7888387 -0.7864186 -0.7839879 -0.7815466 -0.7790948 [295] -0.7766324 -0.7741595 -0.7716761 -0.7691822 -0.7666780 -0.7641635 [301] -0.7616387 -0.7591037 -0.7565587 -0.7540037 -0.7514388 -0.7488642 [307] -0.7462800 -0.7436862 -0.7410831 -0.7384708 -0.7358494 -0.7332190 [313] -0.7305800 -0.7279323 -0.7252762 -0.7226119 -0.7199396 -0.7172594 [319] -0.7145715 -0.7118761 -0.7091735 -0.7064639 -0.7037474 -0.7010242 [325] -0.6982947 -0.6955589 -0.6928173 -0.6900699 -0.6873170 -0.6845588 [331] -0.6817956 -0.6790277 -0.6762552 -0.6734784 -0.6706976 -0.6679131 [337] -0.6651250 -0.6623336 -0.6595392 -0.6567421 -0.6539425 -0.6511406 [343] -0.6483367 -0.6455312 -0.6427242 -0.6399160 -0.6371069 -0.6342971 [349] -0.6314870 -0.6286767 -0.6258666 -0.6230568 -0.6202477 -0.6174396 [355] -0.6146326 -0.6118271 -0.6090233 -0.6062215 -0.6034219 -0.6006248 [361] -0.5978305 -0.5950391 -0.5922509 -0.5894663 -0.5866854 -0.5839085 [367] -0.5811358 -0.5783676 -0.5756041 -0.5728455 -0.5700922 -0.5673442 [373] -0.5646019 -0.5618654 -0.5591350 -0.5564110 -0.5536934 -0.5509826 [379] -0.5482787 -0.5455820 -0.5428926 -0.5402108 -0.5375368 -0.5348707 [385] -0.5322127 -0.5295630 -0.5269219 -0.5242894 -0.5216658 -0.5190512 [391] -0.5164459 -0.5138498 -0.5112633 -0.5086865 -0.5061196 -0.5035626 [397] -0.5010157 -0.4984791 -0.4959529 -0.4934373 -0.4909323 > mx [1] 0.9907592 > mxli [1] 0.02 > 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/wessaorg/rcomp/tmp/1ny991311000383.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2ufhr1311000383.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/33xwl1311000383.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/46fsg1311000383.tab") > > try(system("convert tmp/1ny991311000383.ps tmp/1ny991311000383.png",intern=TRUE)) character(0) > try(system("convert tmp/2ufhr1311000383.ps tmp/2ufhr1311000383.png",intern=TRUE)) character(0) > try(system("convert tmp/33xwl1311000383.ps tmp/33xwl1311000383.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.138 0.187 1.319