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. > x <- c(100,100.00,93.55,88.17,89.25,91.40,92.47,91.40,88.17,87.10,84.95,92.47,93.55,93.55,91.40,90.32,91.40,93.55,93.55,92.47,91.40,89.25,86.02,88.17,87.10,87.10,86.02,84.95,84.95,86.02,86.02,84.95,86.02,82.80,77.42,80.65,78.49,75.27,75.27,75.27,77.42,78.49,76.34,73.12,68.82,65.59,69.89,82.80,84.95,80.65,74.19,70.97,74.19,82.80,86.02,86.02,82.80,78.49,79.57,87.10,89.25) > #'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(qnorm(ppoints(x), mean=0, sd=1),x1) + if (mx < c[i]) + { + mx <- c[i] + mxli <- l[i] + } + } > c [1] -0.5761044 -0.5763310 -0.5765574 -0.5767837 -0.5770099 -0.5772359 [7] -0.5774619 -0.5776876 -0.5779133 -0.5781388 -0.5783642 -0.5785895 [13] -0.5788146 -0.5790396 -0.5792644 -0.5794891 -0.5797137 -0.5799382 [19] -0.5801625 -0.5803867 -0.5806107 -0.5808346 -0.5810584 -0.5812820 [25] -0.5815055 -0.5817289 -0.5819521 -0.5821752 -0.5823982 -0.5826210 [31] -0.5828436 -0.5830662 -0.5832886 -0.5835108 -0.5837329 -0.5839549 [37] -0.5841767 -0.5843984 -0.5846200 -0.5848414 -0.5850626 -0.5852838 [43] -0.5855047 -0.5857256 -0.5859463 -0.5861668 -0.5863872 -0.5866075 [49] -0.5868276 -0.5870476 -0.5872674 -0.5874871 -0.5877067 -0.5879261 [55] -0.5881453 -0.5883644 -0.5885834 -0.5888022 -0.5890209 -0.5892394 [61] -0.5894578 -0.5896760 -0.5898941 -0.5901120 -0.5903298 -0.5905474 [67] -0.5907649 -0.5909822 -0.5911994 -0.5914165 -0.5916333 -0.5918501 [73] -0.5920667 -0.5922831 -0.5924994 -0.5927155 -0.5929315 -0.5931473 [79] -0.5933630 -0.5935785 -0.5937939 -0.5940091 -0.5942241 -0.5944390 [85] -0.5946538 -0.5948684 -0.5950828 -0.5952971 -0.5955113 -0.5957252 [91] -0.5959391 -0.5961527 -0.5963662 -0.5965796 -0.5967928 -0.5970058 [97] -0.5972187 -0.5974314 -0.5976440 -0.5978564 -0.5980686 -0.5982807 [103] -0.5984927 -0.5987044 -0.5989161 -0.5991275 -0.5993388 -0.5995499 [109] -0.5997609 -0.5999717 -0.6001824 -0.6003928 -0.6006032 -0.6008133 [115] -0.6010233 -0.6012332 -0.6014429 -0.6016524 -0.6018617 -0.6020709 [121] -0.6022799 -0.6024888 -0.6026975 -0.6029060 -0.6031144 -0.6033226 [127] -0.6035306 -0.6037385 -0.6039462 -0.6041537 -0.6043611 -0.6045683 [133] -0.6047753 -0.6049822 -0.6051889 -0.6053954 -0.6056018 -0.6058080 [139] -0.6060140 -0.6062198 -0.6064255 -0.6066311 -0.6068364 -0.6070416 [145] -0.6072466 -0.6074514 -0.6076561 -0.6078606 -0.6080649 -0.6082691 [151] -0.6084731 -0.6086769 -0.6088805 -0.6090840 -0.6092873 -0.6094904 [157] -0.6096933 -0.6098961 -0.6100987 -0.6103011 -0.6105034 -0.6107055 [163] -0.6109074 -0.6111091 -0.6113106 -0.6115120 -0.6117132 -0.6119142 [169] -0.6121151 -0.6123158 -0.6125163 -0.6127166 -0.6129167 -0.6131167 [175] -0.6133165 -0.6135161 -0.6137155 -0.6139147 -0.6141138 -0.6143127 [181] -0.6145114 -0.6147100 -0.6149083 -0.6151065 -0.6153045 -0.6155023 [187] -0.6156999 -0.6158974 -0.6160947 -0.6162917 -0.6164886 -0.6166854 [193] -0.6168819 -0.6170783 -0.6172745 -0.6174704 -0.6176663 -0.6178619 [199] -0.6180573 -0.6182526 -0.6184477 -0.6186426 -0.6188373 -0.6190318 [205] -0.6192261 -0.6194203 -0.6196143 -0.6198080 -0.6200016 -0.6201950 [211] -0.6203883 -0.6205813 -0.6207741 -0.6209668 -0.6211593 -0.6213516 [217] -0.6215437 -0.6217356 -0.6219273 -0.6221188 -0.6223102 -0.6225013 [223] -0.6226923 -0.6228831 -0.6230737 -0.6232641 -0.6234543 -0.6236443 [229] -0.6238341 -0.6240238 -0.6242132 -0.6244025 -0.6245915 -0.6247804 [235] -0.6249691 -0.6251575 -0.6253458 -0.6255339 -0.6257218 -0.6259096 [241] -0.6260971 -0.6262844 -0.6264715 -0.6266585 -0.6268452 -0.6270318 [247] -0.6272181 -0.6274043 -0.6275903 -0.6277760 -0.6279616 -0.6281470 [253] -0.6283322 -0.6285172 -0.6287019 -0.6288865 -0.6290709 -0.6292551 [259] -0.6294391 -0.6296229 -0.6298066 -0.6299900 -0.6301732 -0.6303562 [265] -0.6305390 -0.6307216 -0.6309040 -0.6310863 -0.6312683 -0.6314501 [271] -0.6316317 -0.6318131 -0.6319943 -0.6321754 -0.6323562 -0.6325368 [277] -0.6327172 -0.6328974 -0.6330774 -0.6332572 -0.6334369 -0.6336163 [283] -0.6337955 -0.6339745 -0.6341533 -0.6343319 -0.6345102 -0.6346884 [289] -0.6348664 -0.6350442 -0.6352218 -0.6353992 -0.6355763 -0.6357533 [295] -0.6359300 -0.6361066 -0.6362829 -0.6364591 -0.6366350 -0.6368108 [301] -0.6369863 -0.6371616 -0.6373367 -0.6375116 -0.6376863 -0.6378608 [307] -0.6380351 -0.6382092 -0.6383830 -0.6385567 -0.6387302 -0.6389034 [313] -0.6390764 -0.6392493 -0.6394219 -0.6395943 -0.6397665 -0.6399385 [319] -0.6401103 -0.6402819 -0.6404532 -0.6406244 -0.6407953 -0.6409661 [325] -0.6411366 -0.6413069 -0.6414770 -0.6416469 -0.6418166 -0.6419860 [331] -0.6421553 -0.6423243 -0.6424931 -0.6426618 -0.6428302 -0.6429984 [337] -0.6431663 -0.6433341 -0.6435017 -0.6436690 -0.6438361 -0.6440030 [343] -0.6441697 -0.6443362 -0.6445025 -0.6446685 -0.6448344 -0.6450000 [349] -0.6451654 -0.6453306 -0.6454956 -0.6456603 -0.6458249 -0.6459892 [355] -0.6461533 -0.6463172 -0.6464809 -0.6466444 -0.6468076 -0.6469707 [361] -0.6471335 -0.6472961 -0.6474585 -0.6476206 -0.6477826 -0.6479443 [367] -0.6481058 -0.6482671 -0.6484282 -0.6485890 -0.6487496 -0.6489101 [373] -0.6490703 -0.6492302 -0.6493900 -0.6495495 -0.6497088 -0.6498679 [379] -0.6500268 -0.6501855 -0.6503439 -0.6505021 -0.6506601 -0.6508179 [385] -0.6509754 -0.6511328 -0.6512899 -0.6514467 -0.6516034 -0.6517598 [391] -0.6519161 -0.6520721 -0.6522278 -0.6523834 -0.6525387 -0.6526938 [397] -0.6528487 -0.6530034 -0.6531578 -0.6533120 -0.6534660 > mx [1] 0 > mxli [1] -999 > if (mxli != 0) + { + x1 <- (x^mxli - 1) / mxli + } else { + x1 <- log(x) + } > postscript(file="/var/www/html/freestat/rcomp/tmp/182kn1258055276.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(l,c,main='Box-Cox Normality Plot',xlab='Lambda',ylab='correlation') > mtext(paste('Optimal Lambda =',mxli)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/2jntr1258055277.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(x,main='Histogram of Original Data',xlab='X',ylab='frequency') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/3b1j41258055277.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(x1,main='Histogram of Transformed Data',xlab='X',ylab='frequency') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/43xl61258055277.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(x) > qqline(x) > grid() > mtext('Original Data') > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/5bsz01258055277.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(x1) > qqline(x1) > grid() > mtext('Transformed Data') > 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 Normality 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',header=TRUE) > a<-table.element(a,mxli) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/63c951258055277.tab") > > system("convert tmp/182kn1258055276.ps tmp/182kn1258055276.png") > system("convert tmp/2jntr1258055277.ps tmp/2jntr1258055277.png") > system("convert tmp/3b1j41258055277.ps tmp/3b1j41258055277.png") > system("convert tmp/43xl61258055277.ps tmp/43xl61258055277.png") > system("convert tmp/5bsz01258055277.ps tmp/5bsz01258055277.png") > > > proc.time() user system elapsed 1.728 1.272 1.984