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(100,96.21064363,96.31280765,107.1793443,114.9066592,92.56060184,114.9995356,107.1236185,117.7765394,107.3650971,106.2970187,114.5072908,98.0031578,103.0649206,100.2879168,104.6066685,111.1544534,104.9874617,109.9284852,111.5352466,132.4974459,100.3436426,123.0983561,114.2379493,104.569518,109.0833101,106.9843039,133.6769759,124.8537197,122.5132349,116.8013374,116.0118882,129.7575926,125.1973623,143.7912139,127.9465032,130.2962757,108.4424631,129.3675118,143.6797622,131.8844618,117.6186496,118.9560695,104.8202842,134.624315,140.401226,143.8005015,153.4317823,153.2924677,127.3149438,153.5525216,136.9276493,131.7730101,144.3391845,107.4208229,113.6249652,124.2221603,102.0618557,96.36853348,111.6838488) > x <- c(100,97.82226485,94.04971502,91.12460521,93.13202153,93.88342812,92.55349954,94.43494835,96.25017563,100.4355715,101.5036685,99.39789728,99.68990733,101.6895041,103.6652759,103.0532766,100.9500712,102.345366,101.6472299,99.56809393,95.67727392,96.58494865,96.32604937,95.37109101,96.00056203,96.88367859,94.85280372,92.46943974,93.99180173,93.45262168,92.26698759,90.39653498,90.43001228,91.04995327,89.07845784,89.69314509,87.92459054,85.8789319,83.20612366,83.85722053,83.01393462,82.84508195,78.68864276,77.56959675,78.53689529,78.55717715,77.4761291,81.58931659,85.02428326,91.71290159,95.96293061,90.84689022,92.28788036,95.56511274,93.62452884,92.63071726,89.50914211,87.17171779,86.72624975,85.63212844) > #'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.4692888 -0.4693646 -0.4694403 -0.4695159 -0.4695915 -0.4696669 [7] -0.4697423 -0.4698177 -0.4698929 -0.4699681 -0.4700432 -0.4701182 [13] -0.4701931 -0.4702680 -0.4703427 -0.4704174 -0.4704920 -0.4705666 [19] -0.4706410 -0.4707154 -0.4707897 -0.4708640 -0.4709381 -0.4710122 [25] -0.4710862 -0.4711601 -0.4712339 -0.4713076 -0.4713813 -0.4714549 [31] -0.4715284 -0.4716019 -0.4716752 -0.4717485 -0.4718217 -0.4718948 [37] -0.4719678 -0.4720408 -0.4721136 -0.4721864 -0.4722591 -0.4723318 [43] -0.4724043 -0.4724768 -0.4725492 -0.4726215 -0.4726937 -0.4727659 [49] -0.4728379 -0.4729099 -0.4729818 -0.4730536 -0.4731254 -0.4731970 [55] -0.4732686 -0.4733401 -0.4734115 -0.4734828 -0.4735541 -0.4736252 [61] -0.4736963 -0.4737673 -0.4738382 -0.4739091 -0.4739798 -0.4740505 [67] -0.4741211 -0.4741916 -0.4742620 -0.4743324 -0.4744026 -0.4744728 [73] -0.4745429 -0.4746129 -0.4746828 -0.4747527 -0.4748224 -0.4748921 [79] -0.4749617 -0.4750312 -0.4751006 -0.4751700 -0.4752392 -0.4753084 [85] -0.4753775 -0.4754465 -0.4755154 -0.4755842 -0.4756530 -0.4757217 [91] -0.4757902 -0.4758587 -0.4759271 -0.4759955 -0.4760637 -0.4761319 [97] -0.4762000 -0.4762679 -0.4763358 -0.4764037 -0.4764714 -0.4765390 [103] -0.4766066 -0.4766741 -0.4767415 -0.4768088 -0.4768760 -0.4769431 [109] -0.4770102 -0.4770772 -0.4771440 -0.4772108 -0.4772775 -0.4773441 [115] -0.4774107 -0.4774771 -0.4775435 -0.4776098 -0.4776759 -0.4777420 [121] -0.4778081 -0.4778740 -0.4779398 -0.4780056 -0.4780712 -0.4781368 [127] -0.4782023 -0.4782677 -0.4783330 -0.4783983 -0.4784634 -0.4785285 [133] -0.4785934 -0.4786583 -0.4787231 -0.4787878 -0.4788524 -0.4789170 [139] -0.4789814 -0.4790458 -0.4791100 -0.4791742 -0.4792383 -0.4793023 [145] -0.4793662 -0.4794301 -0.4794938 -0.4795574 -0.4796210 -0.4796845 [151] -0.4797479 -0.4798111 -0.4798744 -0.4799375 -0.4800005 -0.4800634 [157] -0.4801263 -0.4801891 -0.4802517 -0.4803143 -0.4803768 -0.4804392 [163] -0.4805015 -0.4805637 -0.4806259 -0.4806879 -0.4807499 -0.4808118 [169] -0.4808735 -0.4809352 -0.4809968 -0.4810583 -0.4811197 -0.4811811 [175] -0.4812423 -0.4813035 -0.4813645 -0.4814255 -0.4814864 -0.4815472 [181] -0.4816079 -0.4816685 -0.4817290 -0.4817894 -0.4818497 -0.4819100 [187] -0.4819701 -0.4820302 -0.4820902 -0.4821501 -0.4822098 -0.4822695 [193] -0.4823292 -0.4823887 -0.4824481 -0.4825074 -0.4825667 -0.4826258 [199] -0.4826849 -0.4827439 -0.4828027 -0.4828615 -0.4829202 -0.4829788 [205] -0.4830373 -0.4830958 -0.4831541 -0.4832123 -0.4832705 -0.4833285 [211] -0.4833865 -0.4834443 -0.4835021 -0.4835598 -0.4836174 -0.4836749 [217] -0.4837323 -0.4837896 -0.4838468 -0.4839040 -0.4839610 -0.4840180 [223] -0.4840748 -0.4841316 -0.4841883 -0.4842448 -0.4843013 -0.4843577 [229] -0.4844140 -0.4844702 -0.4845263 -0.4845823 -0.4846383 -0.4846941 [235] -0.4847498 -0.4848055 -0.4848610 -0.4849165 -0.4849719 -0.4850271 [241] -0.4850823 -0.4851374 -0.4851924 -0.4852473 -0.4853021 -0.4853568 [247] -0.4854115 -0.4854660 -0.4855204 -0.4855748 -0.4856290 -0.4856832 [253] -0.4857372 -0.4857912 -0.4858450 -0.4858988 -0.4859525 -0.4860061 [259] -0.4860596 -0.4861130 -0.4861663 -0.4862195 -0.4862726 -0.4863257 [265] -0.4863786 -0.4864314 -0.4864842 -0.4865368 -0.4865894 -0.4866418 [271] -0.4866942 -0.4867465 -0.4867986 -0.4868507 -0.4869027 -0.4869546 [277] -0.4870064 -0.4870581 -0.4871097 -0.4871612 -0.4872126 -0.4872640 [283] -0.4873152 -0.4873663 -0.4874174 -0.4874683 -0.4875192 -0.4875699 [289] -0.4876206 -0.4876711 -0.4877216 -0.4877720 -0.4878223 -0.4878725 [295] -0.4879225 -0.4879725 -0.4880224 -0.4880722 -0.4881219 -0.4881716 [301] -0.4882211 -0.4882705 -0.4883198 -0.4883691 -0.4884182 -0.4884672 [307] -0.4885162 -0.4885650 -0.4886138 -0.4886624 -0.4887110 -0.4887595 [313] -0.4888078 -0.4888561 -0.4889043 -0.4889524 -0.4890004 -0.4890483 [319] -0.4890961 -0.4891438 -0.4891914 -0.4892389 -0.4892863 -0.4893336 [325] -0.4893808 -0.4894280 -0.4894750 -0.4895219 -0.4895688 -0.4896155 [331] -0.4896622 -0.4897087 -0.4897552 -0.4898015 -0.4898478 -0.4898940 [337] -0.4899400 -0.4899860 -0.4900319 -0.4900777 -0.4901233 -0.4901689 [343] -0.4902144 -0.4902598 -0.4903051 -0.4903503 -0.4903954 -0.4904405 [349] -0.4904854 -0.4905302 -0.4905749 -0.4906195 -0.4906641 -0.4907085 [355] -0.4907528 -0.4907971 -0.4908412 -0.4908853 -0.4909292 -0.4909731 [361] -0.4910168 -0.4910605 -0.4911041 -0.4911475 -0.4911909 -0.4912342 [367] -0.4912774 -0.4913204 -0.4913634 -0.4914063 -0.4914491 -0.4914918 [373] -0.4915344 -0.4915769 -0.4916193 -0.4916616 -0.4917038 -0.4917460 [379] -0.4917880 -0.4918299 -0.4918717 -0.4919135 -0.4919551 -0.4919966 [385] -0.4920381 -0.4920794 -0.4921207 -0.4921618 -0.4922029 -0.4922438 [391] -0.4922847 -0.4923254 -0.4923661 -0.4924067 -0.4924472 -0.4924875 [397] -0.4925278 -0.4925680 -0.4926081 -0.4926481 -0.4926880 > mx [1] 0.492688 > 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/rcomp/tmp/1gfk21257768823.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/245s91257768823.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/3wwfr1257768823.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/4u1hb1257768823.tab") > > system("convert tmp/1gfk21257768823.ps tmp/1gfk21257768823.png") > system("convert tmp/245s91257768823.ps tmp/245s91257768823.png") > system("convert tmp/3wwfr1257768823.ps tmp/3wwfr1257768823.png") > > > proc.time() user system elapsed 0.770 0.490 1.021