R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(93.76979937,89.96832101,86.16684266,87.43400211,91.23548046,93.76979937,92.50263992,87.43400211,87.43400211,86.16684266,89.96832101,91.23548046,89.96832101,88.70116156,87.43400211,89.96832101,92.50263992,95.03695882,95.03695882,95.03695882,92.50263992,88.70116156,84.89968321,82.36536431,82.36536431,82.36536431,83.63252376,86.16684266,87.43400211,87.43400211,86.16684266,86.16684266,82.36536431,77.2967265,77.2967265,74.7624076,72.2280887,74.7624076,74.7624076,77.2967265,79.83104541,78.56388596,74.7624076,72.2280887,68.42661035,70.96092925,78.56388596,79.83104541,76.02956705,70.96092925,69.6937698,74.7624076,82.36536431,86.16684266,86.16684266,82.36536431,78.56388596,78.56388596,82.36536431,84.89968321) > x <- c(106.5789,101.3158,98.68421,100,102.6316,102.6316,102.6316,98.68421,98.68421,93.42105,98.68421,98.68421,100,101.3158,101.3158,103.9474,106.5789,107.8947,107.8947,107.8947,103.9474,96.05263,90.78947,86.84211,88.15789,90.78947,92.10526,93.42105,94.73684,93.42105,90.78947,92.10526,89.47368,84.21053,88.15789,86.84211,84.21053,82.89474,81.57895,85.52632,89.47368,89.47368,84.21053,80.26316,76.31579,80.26316,94.73684,96.05263,90.78947,80.26316,76.31579,81.57895,93.42105,101.3158,103.9474,101.3158,97.36842,98.68421,105.2632,106.5789) > #'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.8795695 0.8795842 0.8795986 0.8796129 0.8796269 0.8796408 0.8796544 [8] 0.8796678 0.8796811 0.8796941 0.8797069 0.8797195 0.8797319 0.8797441 [15] 0.8797561 0.8797679 0.8797795 0.8797909 0.8798021 0.8798131 0.8798239 [22] 0.8798344 0.8798448 0.8798550 0.8798649 0.8798747 0.8798842 0.8798936 [29] 0.8799027 0.8799117 0.8799204 0.8799289 0.8799373 0.8799454 0.8799533 [36] 0.8799610 0.8799685 0.8799758 0.8799830 0.8799899 0.8799966 0.8800031 [43] 0.8800094 0.8800154 0.8800213 0.8800270 0.8800325 0.8800378 0.8800429 [50] 0.8800477 0.8800524 0.8800569 0.8800611 0.8800652 0.8800691 0.8800727 [57] 0.8800762 0.8800794 0.8800825 0.8800853 0.8800880 0.8800904 0.8800927 [64] 0.8800947 0.8800965 0.8800982 0.8800996 0.8801008 0.8801019 0.8801027 [71] 0.8801033 0.8801038 0.8801040 0.8801040 0.8801038 0.8801035 0.8801029 [78] 0.8801021 0.8801011 0.8800999 0.8800986 0.8800970 0.8800952 0.8800932 [85] 0.8800910 0.8800886 0.8800861 0.8800833 0.8800803 0.8800771 0.8800737 [92] 0.8800701 0.8800663 0.8800623 0.8800582 0.8800538 0.8800492 0.8800444 [99] 0.8800394 0.8800342 0.8800289 0.8800233 0.8800175 0.8800115 0.8800053 [106] 0.8799990 0.8799924 0.8799856 0.8799786 0.8799715 0.8799641 0.8799565 [113] 0.8799488 0.8799408 0.8799326 0.8799243 0.8799157 0.8799070 0.8798980 [120] 0.8798889 0.8798795 0.8798700 0.8798602 0.8798503 0.8798401 0.8798298 [127] 0.8798193 0.8798086 0.8797976 0.8797865 0.8797752 0.8797637 0.8797520 [134] 0.8797401 0.8797280 0.8797157 0.8797032 0.8796905 0.8796776 0.8796645 [141] 0.8796512 0.8796378 0.8796241 0.8796102 0.8795962 0.8795819 0.8795675 [148] 0.8795528 0.8795380 0.8795230 0.8795077 0.8794923 0.8794767 0.8794609 [155] 0.8794449 0.8794287 0.8794123 0.8793957 0.8793789 0.8793620 0.8793448 [162] 0.8793274 0.8793099 0.8792922 0.8792742 0.8792561 0.8792378 0.8792193 [169] 0.8792005 0.8791816 0.8791626 0.8791433 0.8791238 0.8791041 0.8790843 [176] 0.8790642 0.8790440 0.8790236 0.8790029 0.8789821 0.8789611 0.8789399 [183] 0.8789185 0.8788969 0.8788752 0.8788532 0.8788311 0.8788087 0.8787862 [190] 0.8787635 0.8787406 0.8787175 0.8786942 0.8786707 0.8786470 0.8786232 [197] 0.8785991 0.8785749 0.8785505 0.8785259 0.8785011 0.8784761 0.8784509 [204] 0.8784256 0.8784000 0.8783743 0.8783483 0.8783222 0.8782959 0.8782694 [211] 0.8782428 0.8782159 0.8781889 0.8781616 0.8781342 0.8781066 0.8780788 [218] 0.8780508 0.8780226 0.8779943 0.8779658 0.8779370 0.8779081 0.8778790 [225] 0.8778497 0.8778203 0.8777906 0.8777608 0.8777308 0.8777006 0.8776702 [232] 0.8776396 0.8776089 0.8775779 0.8775468 0.8775155 0.8774840 0.8774523 [239] 0.8774205 0.8773884 0.8773562 0.8773238 0.8772912 0.8772584 0.8772255 [246] 0.8771924 0.8771590 0.8771255 0.8770919 0.8770580 0.8770240 0.8769897 [253] 0.8769553 0.8769207 0.8768860 0.8768510 0.8768159 0.8767806 0.8767451 [260] 0.8767094 0.8766736 0.8766376 0.8766014 0.8765650 0.8765284 0.8764917 [267] 0.8764547 0.8764176 0.8763804 0.8763429 0.8763053 0.8762675 0.8762295 [274] 0.8761913 0.8761529 0.8761144 0.8760757 0.8760368 0.8759978 0.8759585 [281] 0.8759191 0.8758795 0.8758398 0.8757998 0.8757597 0.8757194 0.8756790 [288] 0.8756383 0.8755975 0.8755565 0.8755154 0.8754740 0.8754325 0.8753908 [295] 0.8753489 0.8753069 0.8752647 0.8752223 0.8751797 0.8751370 0.8750941 [302] 0.8750510 0.8750078 0.8749643 0.8749207 0.8748770 0.8748330 0.8747889 [309] 0.8747446 0.8747001 0.8746555 0.8746107 0.8745657 0.8745206 0.8744753 [316] 0.8744298 0.8743841 0.8743383 0.8742923 0.8742461 0.8741998 0.8741533 [323] 0.8741066 0.8740598 0.8740128 0.8739656 0.8739182 0.8738707 0.8738230 [330] 0.8737751 0.8737271 0.8736789 0.8736306 0.8735820 0.8735333 0.8734845 [337] 0.8734354 0.8733862 0.8733369 0.8732873 0.8732376 0.8731878 0.8731377 [344] 0.8730875 0.8730372 0.8729867 0.8729360 0.8728851 0.8728341 0.8727829 [351] 0.8727315 0.8726800 0.8726284 0.8725765 0.8725245 0.8724723 0.8724200 [358] 0.8723675 0.8723148 0.8722620 0.8722090 0.8721559 0.8721026 0.8720491 [365] 0.8719955 0.8719417 0.8718877 0.8718336 0.8717793 0.8717249 0.8716703 [372] 0.8716155 0.8715606 0.8715055 0.8714503 0.8713949 0.8713393 0.8712836 [379] 0.8712277 0.8711716 0.8711154 0.8710591 0.8710026 0.8709459 0.8708891 [386] 0.8708321 0.8707749 0.8707176 0.8706602 0.8706025 0.8705448 0.8704868 [393] 0.8704287 0.8703705 0.8703121 0.8702535 0.8701948 0.8701359 0.8700769 [400] 0.8700177 0.8699584 > mx [1] 0.880104 > mxli [1] -1.27 > 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/1bd1o1261582134.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/2tlzq1261582134.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/3ihnq1261582134.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/4o8su1261582134.tab") > > try(system("convert tmp/1bd1o1261582134.ps tmp/1bd1o1261582134.png",intern=TRUE)) character(0) > try(system("convert tmp/2tlzq1261582134.ps tmp/2tlzq1261582134.png",intern=TRUE)) character(0) > try(system("convert tmp/3ihnq1261582134.ps tmp/3ihnq1261582134.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.738 0.539 1.418