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(87.60884,80.37508,73.94508,73.94508,76.35633,77.16008,76.35633,73.14133,71.53382,72.33758,81.17883,82.78634,81.98259,77.16008,73.94508,74.74883,75.55258,75.55258,73.94508,72.33758,72.33758,72.33758,78.76758,80.37508,78.76758,74.74883,72.33758,72.33758,73.14133,73.14133,73.14133,73.94508,70.73007,66.71132,67.51507,65.10382,61.88881,63.49632,63.49632,64.30007,63.49632,61.08506,57.06631,54.65506,52.2438,55.45881,65.90757,69.92632,66.71132,63.49632,60.28131,62.69257,66.71132,67.51507,65.90757,61.88881,57.87006,58.67381,65.10382,68.31882) > 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.6095425 0.6094610 0.6093794 0.6092976 0.6092156 0.6091336 0.6090513 [8] 0.6089690 0.6088865 0.6088038 0.6087211 0.6086381 0.6085551 0.6084719 [15] 0.6083885 0.6083050 0.6082214 0.6081376 0.6080537 0.6079697 0.6078855 [22] 0.6078011 0.6077167 0.6076321 0.6075473 0.6074624 0.6073774 0.6072922 [29] 0.6072069 0.6071215 0.6070359 0.6069502 0.6068643 0.6067784 0.6066922 [36] 0.6066060 0.6065195 0.6064330 0.6063463 0.6062595 0.6061725 0.6060855 [43] 0.6059982 0.6059109 0.6058234 0.6057357 0.6056479 0.6055600 0.6054720 [50] 0.6053838 0.6052955 0.6052070 0.6051185 0.6050297 0.6049409 0.6048519 [57] 0.6047628 0.6046735 0.6045841 0.6044946 0.6044049 0.6043151 0.6042252 [64] 0.6041351 0.6040449 0.6039546 0.6038642 0.6037736 0.6036828 0.6035920 [71] 0.6035010 0.6034099 0.6033186 0.6032272 0.6031357 0.6030441 0.6029523 [78] 0.6028604 0.6027683 0.6026761 0.6025838 0.6024914 0.6023988 0.6023062 [85] 0.6022133 0.6021204 0.6020273 0.6019341 0.6018407 0.6017473 0.6016537 [92] 0.6015599 0.6014661 0.6013721 0.6012780 0.6011837 0.6010894 0.6009949 [99] 0.6009002 0.6008055 0.6007106 0.6006156 0.6005205 0.6004252 0.6003298 [106] 0.6002343 0.6001387 0.6000429 0.5999470 0.5998510 0.5997548 0.5996586 [113] 0.5995622 0.5994657 0.5993690 0.5992723 0.5991754 0.5990783 0.5989812 [120] 0.5988839 0.5987866 0.5986890 0.5985914 0.5984936 0.5983958 0.5982978 [127] 0.5981996 0.5981014 0.5980030 0.5979045 0.5978059 0.5977072 0.5976083 [134] 0.5975093 0.5974102 0.5973110 0.5972116 0.5971122 0.5970126 0.5969129 [141] 0.5968131 0.5967131 0.5966131 0.5965129 0.5964126 0.5963121 0.5962116 [148] 0.5961109 0.5960101 0.5959092 0.5958082 0.5957071 0.5956058 0.5955045 [155] 0.5954030 0.5953014 0.5951996 0.5950978 0.5949958 0.5948938 0.5947916 [162] 0.5946893 0.5945868 0.5944843 0.5943816 0.5942789 0.5941760 0.5940730 [169] 0.5939699 0.5938666 0.5937633 0.5936598 0.5935562 0.5934525 0.5933487 [176] 0.5932448 0.5931408 0.5930366 0.5929324 0.5928280 0.5927235 0.5926189 [183] 0.5925142 0.5924094 0.5923045 0.5921994 0.5920943 0.5919890 0.5918836 [190] 0.5917781 0.5916725 0.5915668 0.5914610 0.5913550 0.5912490 0.5911428 [197] 0.5910366 0.5909302 0.5908237 0.5907171 0.5906104 0.5905036 0.5903967 [204] 0.5902897 0.5901825 0.5900753 0.5899679 0.5898605 0.5897529 0.5896453 [211] 0.5895375 0.5894296 0.5893216 0.5892135 0.5891053 0.5889970 0.5888886 [218] 0.5887800 0.5886714 0.5885627 0.5884538 0.5883449 0.5882358 0.5881267 [225] 0.5880174 0.5879081 0.5877986 0.5876890 0.5875793 0.5874696 0.5873597 [232] 0.5872497 0.5871396 0.5870294 0.5869191 0.5868087 0.5866983 0.5865877 [239] 0.5864770 0.5863662 0.5862553 0.5861443 0.5860332 0.5859220 0.5858106 [246] 0.5856992 0.5855877 0.5854761 0.5853644 0.5852526 0.5851407 0.5850287 [253] 0.5849166 0.5848044 0.5846921 0.5845797 0.5844673 0.5843547 0.5842420 [260] 0.5841292 0.5840163 0.5839033 0.5837903 0.5836771 0.5835638 0.5834505 [267] 0.5833370 0.5832234 0.5831098 0.5829960 0.5828822 0.5827683 0.5826542 [274] 0.5825401 0.5824259 0.5823116 0.5821972 0.5820827 0.5819681 0.5818534 [281] 0.5817386 0.5816237 0.5815088 0.5813937 0.5812785 0.5811633 0.5810480 [288] 0.5809325 0.5808170 0.5807014 0.5805857 0.5804699 0.5803540 0.5802381 [295] 0.5801220 0.5800058 0.5798896 0.5797733 0.5796568 0.5795403 0.5794237 [302] 0.5793070 0.5791903 0.5790734 0.5789564 0.5788394 0.5787223 0.5786050 [309] 0.5784877 0.5783704 0.5782529 0.5781353 0.5780177 0.5778999 0.5777821 [316] 0.5776642 0.5775462 0.5774281 0.5773099 0.5771917 0.5770733 0.5769549 [323] 0.5768364 0.5767178 0.5765991 0.5764804 0.5763615 0.5762426 0.5761236 [330] 0.5760045 0.5758853 0.5757661 0.5756467 0.5755273 0.5754078 0.5752882 [337] 0.5751686 0.5750488 0.5749290 0.5748091 0.5746891 0.5745690 0.5744488 [344] 0.5743286 0.5742083 0.5740879 0.5739674 0.5738469 0.5737263 0.5736055 [351] 0.5734848 0.5733639 0.5732429 0.5731219 0.5730008 0.5728796 0.5727584 [358] 0.5726370 0.5725156 0.5723941 0.5722726 0.5721509 0.5720292 0.5719074 [365] 0.5717856 0.5716636 0.5715416 0.5714195 0.5712973 0.5711751 0.5710528 [372] 0.5709304 0.5708079 0.5706854 0.5705628 0.5704401 0.5703173 0.5701945 [379] 0.5700716 0.5699486 0.5698255 0.5697024 0.5695792 0.5694559 0.5693326 [386] 0.5692092 0.5690857 0.5689621 0.5688385 0.5687148 0.5685910 0.5684672 [393] 0.5683433 0.5682193 0.5680953 0.5679712 0.5678470 0.5677227 0.5675984 [400] 0.5674740 0.5673496 > mx [1] 0.6095425 > 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/1l72y1261581565.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/20nqd1261581565.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/3r20v1261581565.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/4i4r61261581565.tab") > > try(system("convert tmp/1l72y1261581565.ps tmp/1l72y1261581565.png",intern=TRUE)) character(0) > try(system("convert tmp/20nqd1261581565.ps tmp/20nqd1261581565.png",intern=TRUE)) character(0) > try(system("convert tmp/3r20v1261581565.ps tmp/3r20v1261581565.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.781 0.501 1.078