R version 2.8.1 (2008-12-22) 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.568615918 + ,1.568615918 + ,1.547562509 + ,1.547562509 + ,1.547562509 + ,1.526056303 + ,1.609437912 + ,1.686398954 + ,1.704748092 + ,1.722766598 + ,1.722766598 + ,1.757857918 + ,1.791759469 + ,1.808288771 + ,1.808288771 + ,1.791759469 + ,1.791759469 + ,1.808288771 + ,1.871802177 + ,1.960094784 + ,2.00148 + ,2.00148 + ,2.014903021 + ,2.028148247 + ,2.054123734 + ,2.054123734 + ,2.041220329 + ,2.028148247 + ,2.014903021 + ,1.987874348 + ,2.028148247 + ,2.079441542 + ,2.174751721 + ,2.066862759 + ,2.054123734 + ,2.041220329 + ,2.054123734 + ,2.041220329 + ,2.014903021 + ,1.987874348 + ,1.960094784 + ,1.945910149 + ,1.987874348 + ,2.054123734 + ,2.066862759 + ,2.066862759 + ,2.054123734 + ,2.054123734 + ,2.066862759 + ,2.054123734 + ,2.028148247 + ,2.00148 + ,1.974081026 + ,1.931521412 + ,1.960094784 + ,2.014903021 + ,2.028148247 + ,2.00148 + ,1.987874348 + ,1.974081026 + ,1.987874348 + ,1.974081026 + ,1.960094784 + ,1.945910149 + ,1.931521412 + ,1.916922612 + ,1.974081026 + ,2.028148247 + ,2.041220329 + ,2.028148247 + ,2.014903021 + ,2.014903021 + ,2.028148247 + ,2.028148247 + ,2.028148247 + ,2.014903021 + ,1.987874348 + ,1.974081026 + ,2.00148 + ,2.079441542 + ,2.104134154 + ,2.079441542 + ,2.041220329 + ,2.041220329 + ,2.054123734 + ,2.054123734 + ,2.041220329 + ,2.014903021 + ,1.987874348 + ,1.960094784 + ,1.960094784 + ,1.974081026 + ,1.916922612 + ,1.887069649 + ,1.85629799 + ,1.85629799 + ,1.871802177 + ,1.840549633 + ,1.774952351 + ,1.704748092 + ,1.648658626 + ,1.589235205 + ,1.686398954 + ,1.757857918 + ,1.740466175 + ,1.722766598 + ,1.704748092 + ,1.686398954 + ,1.686398954 + ,1.686398954 + ,1.704748092 + ,1.757857918 + ,1.740466175 + ,1.686398954 + ,1.722766598 + ,1.757857918 + ,1.824549292 + ,1.916922612 + ,1.902107526 + ,1.902107526 + ,1.85629799 + ,1.840549633 + ,1.840549633 + ,1.85629799 + ,1.840549633 + ,1.791759469 + ,1.840549633 + ,1.840549633 + ,1.887069649 + ,2.014903021 + ,2.054123734 + ,2.066862759 + ,2.054123734 + ,2.028148247 + ,2.014903021 + ,2.028148247 + ,2.014903021 + ,1.987874348 + ,2.028148247 + ,2.014903021 + ,2.028148247 + ,2.066862759 + ,2.066862759 + ,2.091864062 + ,2.104134154 + ,2.079441542 + ,2.014903021 + ,1.916922612 + ,1.871802177 + ,1.887069649 + ,2.028148247 + ,2.079441542 + ,2.091864062 + ,2.041220329 + ,2.014903021 + ,2.028148247 + ,2.054123734 + ,2.054123734 + ,2.054123734 + ,2.014903021 + ,2.014903021 + ,1.960094784 + ,2.014903021 + ,2.014903021 + ,2.028148247 + ,2.041220329 + ,2.041220329 + ,2.066862759 + ,2.091864062 + ,2.104134154 + ,2.104134154 + ,2.104134154 + ,2.066862759 + ,1.987874348 + ,1.931521412 + ,1.887069649 + ,1.902107526 + ,1.931521412 + ,1.945910149 + ,1.960094784) > x <- c(6.9,6.8,6.7,6.6,6.5,6.5,7.0,7.5,7.6,7.6,7.6,7.8,8.0,8.0,8.0,7.9,7.9,8.0,8.5,9.2,9.4,9.5,9.5,9.6,9.7,9.7,9.6,9.5,9.4,9.3,9.6,10.2,10.2,10.1,9.9,9.8,9.8,9.7,9.5,9.3,9.1,9.0,9.5,10.0,10.2,10.1,10.0,9.9,10.0,9.9,9.7,9.5,9.2,9.0,9.3,9.8,9.8,9.6,9.4,9.3,9.2,9.2,9.0,8.8,8.7,8.7,9.1,9.7,9.8,9.6,9.4,9.4,9.5,9.4,9.3,9.2,9.0,8.9,9.2,9.8,9.9,9.6,9.2,9.1,9.1,9.0,8.9,8.7,8.5,8.3,8.5,8.7,8.4,8.1,7.8,7.7,7.5,7.2,6.8,6.7,6.4,6.3,6.8,7.3,7.1,7.0,6.8,6.6,6.3,6.1,6.1,6.3,6.3,6.0,6.2,6.4,6.8,7.5,7.5,7.6,7.6,7.4,7.3,7.1,6.9,6.8,7.5,7.6,7.8,8.0,8.1,8.2,8.3,8.2,8.0,7.9,7.6,7.6,8.3,8.4,8.4,8.4,8.4,8.6,8.9,8.8,8.3,7.5,7.2,7.4,8.8,9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.5,8.2,8.1,7.9,8.6,8.7,8.7,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8.0,8.2,8.1,8.1,8.0,7.9,7.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.8484002 0.8483863 0.8483718 0.8483568 0.8483412 0.8483251 0.8483084 [8] 0.8482911 0.8482733 0.8482550 0.8482361 0.8482166 0.8481966 0.8481761 [15] 0.8481550 0.8481333 0.8481111 0.8480883 0.8480650 0.8480411 0.8480167 [22] 0.8479917 0.8479662 0.8479401 0.8479135 0.8478863 0.8478586 0.8478303 [29] 0.8478015 0.8477721 0.8477422 0.8477117 0.8476806 0.8476490 0.8476169 [36] 0.8475842 0.8475510 0.8475172 0.8474828 0.8474479 0.8474125 0.8473765 [43] 0.8473399 0.8473028 0.8472652 0.8472270 0.8471882 0.8471489 0.8471091 [50] 0.8470687 0.8470277 0.8469862 0.8469442 0.8469016 0.8468585 0.8468148 [57] 0.8467705 0.8467257 0.8466804 0.8466345 0.8465881 0.8465411 0.8464936 [64] 0.8464455 0.8463969 0.8463477 0.8462980 0.8462478 0.8461969 0.8461456 [71] 0.8460937 0.8460413 0.8459883 0.8459347 0.8458807 0.8458260 0.8457709 [78] 0.8457152 0.8456589 0.8456021 0.8455448 0.8454869 0.8454285 0.8453695 [85] 0.8453100 0.8452499 0.8451894 0.8451282 0.8450665 0.8450043 0.8449416 [92] 0.8448783 0.8448144 0.8447501 0.8446852 0.8446197 0.8445537 0.8444872 [99] 0.8444201 0.8443525 0.8442844 0.8442157 0.8441465 0.8440767 0.8440064 [106] 0.8439356 0.8438643 0.8437924 0.8437199 0.8436470 0.8435735 0.8434995 [113] 0.8434249 0.8433498 0.8432742 0.8431980 0.8431214 0.8430441 0.8429664 [120] 0.8428881 0.8428093 0.8427300 0.8426501 0.8425697 0.8424888 0.8424073 [127] 0.8423254 0.8422429 0.8421598 0.8420763 0.8419922 0.8419076 0.8418225 [134] 0.8417368 0.8416506 0.8415639 0.8414767 0.8413890 0.8413007 0.8412119 [141] 0.8411226 0.8410328 0.8409424 0.8408516 0.8407602 0.8406683 0.8405759 [148] 0.8404829 0.8403895 0.8402955 0.8402010 0.8401060 0.8400105 0.8399145 [155] 0.8398179 0.8397209 0.8396233 0.8395252 0.8394266 0.8393275 0.8392279 [162] 0.8391278 0.8390271 0.8389260 0.8388244 0.8387222 0.8386195 0.8385164 [169] 0.8384127 0.8383085 0.8382038 0.8380986 0.8379929 0.8378867 0.8377801 [176] 0.8376729 0.8375652 0.8374570 0.8373483 0.8372391 0.8371294 0.8370192 [183] 0.8369085 0.8367973 0.8366856 0.8365734 0.8364607 0.8363476 0.8362339 [190] 0.8361197 0.8360051 0.8358900 0.8357743 0.8356582 0.8355416 0.8354245 [197] 0.8353069 0.8351888 0.8350703 0.8349512 0.8348317 0.8347117 0.8345912 [204] 0.8344702 0.8343487 0.8342267 0.8341043 0.8339814 0.8338580 0.8337341 [211] 0.8336098 0.8334849 0.8333596 0.8332338 0.8331076 0.8329808 0.8328536 [218] 0.8327260 0.8325978 0.8324692 0.8323401 0.8322105 0.8320805 0.8319499 [225] 0.8318190 0.8316875 0.8315556 0.8314232 0.8312904 0.8311571 0.8310233 [232] 0.8308891 0.8307544 0.8306192 0.8304836 0.8303475 0.8302109 0.8300739 [239] 0.8299365 0.8297986 0.8296602 0.8295214 0.8293821 0.8292423 0.8291022 [246] 0.8289615 0.8288204 0.8286789 0.8285369 0.8283944 0.8282515 0.8281082 [253] 0.8279644 0.8278202 0.8276755 0.8275304 0.8273848 0.8272388 0.8270924 [260] 0.8269455 0.8267982 0.8266504 0.8265022 0.8263535 0.8262045 0.8260549 [267] 0.8259050 0.8257546 0.8256038 0.8254525 0.8253008 0.8251487 0.8249962 [274] 0.8248432 0.8246898 0.8245360 0.8243817 0.8242270 0.8240719 0.8239164 [281] 0.8237604 0.8236041 0.8234473 0.8232901 0.8231324 0.8229744 0.8228159 [288] 0.8226570 0.8224977 0.8223380 0.8221778 0.8220173 0.8218563 0.8216950 [295] 0.8215332 0.8213710 0.8212084 0.8210454 0.8208819 0.8207181 0.8205539 [302] 0.8203893 0.8202242 0.8200588 0.8198930 0.8197267 0.8195601 0.8193930 [309] 0.8192256 0.8190578 0.8188895 0.8187209 0.8185519 0.8183825 0.8182127 [316] 0.8180425 0.8178719 0.8177009 0.8175296 0.8173578 0.8171857 0.8170131 [323] 0.8168402 0.8166669 0.8164933 0.8163192 0.8161448 0.8159699 0.8157947 [330] 0.8156192 0.8154432 0.8152669 0.8150902 0.8149131 0.8147356 0.8145578 [337] 0.8143796 0.8142011 0.8140221 0.8138428 0.8136631 0.8134831 0.8133027 [344] 0.8131219 0.8129408 0.8127593 0.8125774 0.8123952 0.8122126 0.8120297 [351] 0.8118464 0.8116628 0.8114788 0.8112944 0.8111097 0.8109246 0.8107392 [358] 0.8105534 0.8103673 0.8101808 0.8099940 0.8098068 0.8096193 0.8094314 [365] 0.8092432 0.8090547 0.8088658 0.8086766 0.8084870 0.8082971 0.8081069 [372] 0.8079163 0.8077253 0.8075341 0.8073425 0.8071506 0.8069583 0.8067657 [379] 0.8065728 0.8063796 0.8061860 0.8059921 0.8057979 0.8056033 0.8054084 [386] 0.8052132 0.8050177 0.8048219 0.8046257 0.8044292 0.8042324 0.8040353 [393] 0.8038379 0.8036401 0.8034420 0.8032437 0.8030450 0.8028460 0.8026467 [400] 0.8024470 0.8022471 > mx [1] 0.8484002 > 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/rcomp/tmp/111t71257797253.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/rcomp/tmp/2b97r1257797253.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/rcomp/tmp/3w6gy1257797253.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/4n0jh1257797253.tab") > system("convert tmp/111t71257797253.ps tmp/111t71257797253.png") > system("convert tmp/2b97r1257797253.ps tmp/2b97r1257797253.png") > system("convert tmp/3w6gy1257797253.ps tmp/3w6gy1257797253.png") > > > proc.time() user system elapsed 1.050 0.800 1.645