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(12300.00,12092.80,12380.80,12196.90,9455.00,13168.00,13427.90,11980.50,11884.80,11691.70,12233.80,14341.40,13130.70,12421.10,14285.80,12864.60,11160.20,14316.20,14388.70,14013.90,13419.00,12769.60,13315.50,15332.90,14243.00,13824.40,14962.90,13202.90,12199.00,15508.90,14199.80,15169.60,14058.00,13786.20,14147.90,16541.70,13587.50,15582.40,15802.80,14130.50,12923.20,15612.20,16033.70,16036.60,14037.80,15330.60,15038.30,17401.80,14992.50,16043.70,16929.60,15921.30,14417.20,15961.00,17851.90,16483.90,14215.50,17429.70,17839.50,17629.20) > x <- c(3423.40,3242.80,3277.20,3833.00,2606.30,3643.80,3686.40,3281.60,3669.30,3191.50,3512.70,3970.70,3601.20,3610.00,4172.10,3956.20,3142.70,3884.30,3892.20,3613.00,3730.50,3481.30,3649.50,4215.20,4066.60,4196.80,4536.60,4441.60,3548.30,4735.90,4130.60,4356.20,4159.60,3988.00,4167.80,4902.20,3909.40,4697.60,4308.90,4420.40,3544.20,4433.00,4479.70,4533.20,4237.50,4207.40,4394.00,5148.40,4202.20,4682.50,4884.30,5288.90,4505.20,4611.50,5081.10,4523.10,4412.80,4647.40,4778.60,4495.30) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = '' > par2 = '' > par1 = '' > ylab = '' > xlab = '' > main = '' > #'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.8726977 0.8729520 0.8732052 0.8734572 0.8737082 0.8739580 0.8742066 [8] 0.8744542 0.8747006 0.8749459 0.8751900 0.8754331 0.8756750 0.8759158 [15] 0.8761554 0.8763940 0.8766314 0.8768677 0.8771028 0.8773369 0.8775698 [22] 0.8778016 0.8780322 0.8782618 0.8784902 0.8787175 0.8789437 0.8791688 [29] 0.8793928 0.8796156 0.8798373 0.8800579 0.8802774 0.8804958 0.8807131 [36] 0.8809292 0.8811443 0.8813582 0.8815710 0.8817827 0.8819933 0.8822028 [43] 0.8824112 0.8826185 0.8828246 0.8830297 0.8832337 0.8834365 0.8836383 [50] 0.8838389 0.8840385 0.8842369 0.8844343 0.8846305 0.8848257 0.8850198 [57] 0.8852127 0.8854046 0.8855954 0.8857851 0.8859737 0.8861612 0.8863476 [64] 0.8865329 0.8867172 0.8869003 0.8870824 0.8872634 0.8874433 0.8876221 [71] 0.8877998 0.8879765 0.8881521 0.8883266 0.8885000 0.8886724 0.8888436 [78] 0.8890138 0.8891830 0.8893510 0.8895180 0.8896839 0.8898488 0.8900126 [85] 0.8901753 0.8903370 0.8904976 0.8906571 0.8908156 0.8909730 0.8911294 [92] 0.8912847 0.8914390 0.8915922 0.8917443 0.8918954 0.8920455 0.8921945 [99] 0.8923424 0.8924893 0.8926352 0.8927800 0.8929238 0.8930665 0.8932082 [106] 0.8933489 0.8934885 0.8936271 0.8937647 0.8939012 0.8940367 0.8941711 [113] 0.8943046 0.8944370 0.8945684 0.8946987 0.8948281 0.8949564 0.8950837 [120] 0.8952100 0.8953352 0.8954595 0.8955827 0.8957049 0.8958262 0.8959464 [127] 0.8960656 0.8961837 0.8963009 0.8964171 0.8965323 0.8966465 0.8967596 [134] 0.8968718 0.8969830 0.8970932 0.8972024 0.8973106 0.8974178 0.8975241 [141] 0.8976293 0.8977336 0.8978368 0.8979391 0.8980404 0.8981408 0.8982401 [148] 0.8983385 0.8984359 0.8985323 0.8986278 0.8987223 0.8988158 0.8989084 [155] 0.8990000 0.8990906 0.8991802 0.8992689 0.8993567 0.8994435 0.8995293 [162] 0.8996142 0.8996981 0.8997811 0.8998631 0.8999442 0.9000243 0.9001035 [169] 0.9001817 0.9002590 0.9003354 0.9004108 0.9004853 0.9005589 0.9006315 [176] 0.9007032 0.9007739 0.9008438 0.9009127 0.9009806 0.9010477 0.9011138 [183] 0.9011790 0.9012433 0.9013067 0.9013691 0.9014307 0.9014913 0.9015510 [190] 0.9016099 0.9016678 0.9017248 0.9017809 0.9018360 0.9018903 0.9019437 [197] 0.9019962 0.9020478 0.9020985 0.9021483 0.9021972 0.9022453 0.9022924 [204] 0.9023387 0.9023840 0.9024285 0.9024721 0.9025149 0.9025567 0.9025977 [211] 0.9026378 0.9026770 0.9027153 0.9027528 0.9027894 0.9028252 0.9028601 [218] 0.9028941 0.9029272 0.9029595 0.9029909 0.9030215 0.9030512 0.9030801 [225] 0.9031081 0.9031353 0.9031616 0.9031871 0.9032117 0.9032355 0.9032584 [232] 0.9032805 0.9033017 0.9033222 0.9033417 0.9033605 0.9033784 0.9033955 [239] 0.9034117 0.9034272 0.9034417 0.9034555 0.9034685 0.9034806 0.9034919 [246] 0.9035024 0.9035121 0.9035209 0.9035289 0.9035362 0.9035426 0.9035482 [253] 0.9035530 0.9035570 0.9035602 0.9035626 0.9035641 0.9035649 0.9035649 [260] 0.9035641 0.9035625 0.9035601 0.9035569 0.9035529 0.9035482 0.9035426 [267] 0.9035363 0.9035291 0.9035212 0.9035125 0.9035031 0.9034928 0.9034818 [274] 0.9034700 0.9034574 0.9034441 0.9034299 0.9034151 0.9033994 0.9033830 [281] 0.9033658 0.9033479 0.9033292 0.9033097 0.9032895 0.9032685 0.9032467 [288] 0.9032243 0.9032010 0.9031770 0.9031523 0.9031268 0.9031006 0.9030736 [295] 0.9030458 0.9030174 0.9029882 0.9029582 0.9029276 0.9028961 0.9028640 [302] 0.9028311 0.9027975 0.9027631 0.9027281 0.9026923 0.9026557 0.9026185 [309] 0.9025805 0.9025418 0.9025024 0.9024623 0.9024214 0.9023798 0.9023376 [316] 0.9022946 0.9022509 0.9022064 0.9021613 0.9021155 0.9020690 0.9020217 [323] 0.9019738 0.9019251 0.9018758 0.9018257 0.9017750 0.9017236 0.9016714 [330] 0.9016186 0.9015651 0.9015109 0.9014560 0.9014004 0.9013442 0.9012872 [337] 0.9012296 0.9011713 0.9011123 0.9010526 0.9009923 0.9009312 0.9008695 [344] 0.9008071 0.9007441 0.9006804 0.9006160 0.9005509 0.9004852 0.9004188 [351] 0.9003518 0.9002840 0.9002157 0.9001466 0.9000769 0.9000066 0.8999356 [358] 0.8998639 0.8997916 0.8997186 0.8996450 0.8995707 0.8994958 0.8994202 [365] 0.8993440 0.8992671 0.8991896 0.8991115 0.8990327 0.8989533 0.8988732 [372] 0.8987925 0.8987112 0.8986292 0.8985466 0.8984634 0.8983795 0.8982950 [379] 0.8982099 0.8981241 0.8980378 0.8979508 0.8978632 0.8977749 0.8976860 [386] 0.8975966 0.8975065 0.8974157 0.8973244 0.8972325 0.8971399 0.8970467 [393] 0.8969529 0.8968586 0.8967636 0.8966679 0.8965717 0.8964749 0.8963775 [400] 0.8962795 0.8961808 > mx [1] 0.903565 > mxli [1] 0.57 > 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/17rzp1226433255.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/222yo1226433255.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/3ec6w1226433255.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/47bl31226433255.tab") > > system("convert tmp/17rzp1226433255.ps tmp/17rzp1226433255.png") > system("convert tmp/222yo1226433255.ps tmp/222yo1226433255.png") > system("convert tmp/3ec6w1226433255.ps tmp/3ec6w1226433255.png") > > > proc.time() user system elapsed 1.251 0.817 1.807