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. > x <- c(8.9,8.6,8.3,8.3,8.3,8.4,8.5,8.4,8.6,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.6,8.4,8.1,8,8,8,8,7.9,7.8,7.8,7.9,8.1,8,7.6,7.3,7,6.8,7,7.1,7.2,7.1,6.9,6.7,6.7,6.6,6.9,7.3,7.5,7.3,7.1,6.9,7.1,7.5,7.7,7.8,7.8,7.7,7.7,7.8,7.9) > 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(qnorm(ppoints(x), mean=0, sd=1),x1) + if (mx < c[i]) + { + mx <- c[i] + mxli <- l[i] + } + } > c [1] -0.6234588 -0.6236320 -0.6238053 -0.6239785 -0.6241516 -0.6243246 [7] -0.6244977 -0.6246706 -0.6248435 -0.6250163 -0.6251891 -0.6253619 [13] -0.6255345 -0.6257071 -0.6258797 -0.6260522 -0.6262246 -0.6263970 [19] -0.6265693 -0.6267416 -0.6269138 -0.6270860 -0.6272580 -0.6274301 [25] -0.6276020 -0.6277740 -0.6279458 -0.6281176 -0.6282893 -0.6284610 [31] -0.6286326 -0.6288042 -0.6289757 -0.6291471 -0.6293185 -0.6294898 [37] -0.6296611 -0.6298323 -0.6300034 -0.6301745 -0.6303455 -0.6305164 [43] -0.6306873 -0.6308581 -0.6310289 -0.6311996 -0.6313702 -0.6315408 [49] -0.6317113 -0.6318818 -0.6320522 -0.6322225 -0.6323928 -0.6325630 [55] -0.6327331 -0.6329032 -0.6330732 -0.6332432 -0.6334131 -0.6335829 [61] -0.6337526 -0.6339223 -0.6340920 -0.6342615 -0.6344310 -0.6346005 [67] -0.6347698 -0.6349391 -0.6351084 -0.6352776 -0.6354467 -0.6356157 [73] -0.6357847 -0.6359536 -0.6361225 -0.6362913 -0.6364600 -0.6366286 [79] -0.6367972 -0.6369657 -0.6371342 -0.6373026 -0.6374709 -0.6376392 [85] -0.6378073 -0.6379755 -0.6381435 -0.6383115 -0.6384794 -0.6386473 [91] -0.6388150 -0.6389827 -0.6391504 -0.6393180 -0.6394855 -0.6396529 [97] -0.6398203 -0.6399876 -0.6401548 -0.6403220 -0.6404891 -0.6406561 [103] -0.6408230 -0.6409899 -0.6411567 -0.6413235 -0.6414902 -0.6416568 [109] -0.6418233 -0.6419898 -0.6421562 -0.6423225 -0.6424887 -0.6426549 [115] -0.6428210 -0.6429871 -0.6431530 -0.6433189 -0.6434848 -0.6436505 [121] -0.6438162 -0.6439818 -0.6441473 -0.6443128 -0.6444782 -0.6446435 [127] -0.6448088 -0.6449739 -0.6451390 -0.6453041 -0.6454690 -0.6456339 [133] -0.6457987 -0.6459634 -0.6461281 -0.6462927 -0.6464572 -0.6466216 [139] -0.6467860 -0.6469503 -0.6471145 -0.6472787 -0.6474427 -0.6476067 [145] -0.6477706 -0.6479345 -0.6480982 -0.6482619 -0.6484256 -0.6485891 [151] -0.6487526 -0.6489160 -0.6490793 -0.6492425 -0.6494057 -0.6495687 [157] -0.6497318 -0.6498947 -0.6500575 -0.6502203 -0.6503830 -0.6505456 [163] -0.6507082 -0.6508707 -0.6510331 -0.6511954 -0.6513576 -0.6515198 [169] -0.6516819 -0.6518439 -0.6520058 -0.6521676 -0.6523294 -0.6524911 [175] -0.6526527 -0.6528142 -0.6529757 -0.6531371 -0.6532984 -0.6534596 [181] -0.6536207 -0.6537818 -0.6539427 -0.6541036 -0.6542645 -0.6544252 [187] -0.6545859 -0.6547464 -0.6549069 -0.6550673 -0.6552277 -0.6553879 [193] -0.6555481 -0.6557082 -0.6558682 -0.6560281 -0.6561880 -0.6563478 [199] -0.6565075 -0.6566671 -0.6568266 -0.6569860 -0.6571454 -0.6573047 [205] -0.6574639 -0.6576230 -0.6577820 -0.6579409 -0.6580998 -0.6582586 [211] -0.6584173 -0.6585759 -0.6587344 -0.6588929 -0.6590513 -0.6592095 [217] -0.6593677 -0.6595259 -0.6596839 -0.6598418 -0.6599997 -0.6601575 [223] -0.6603152 -0.6604728 -0.6606303 -0.6607877 -0.6609451 -0.6611024 [229] -0.6612596 -0.6614167 -0.6615737 -0.6617306 -0.6618875 -0.6620442 [235] -0.6622009 -0.6623575 -0.6625140 -0.6626704 -0.6628267 -0.6629830 [241] -0.6631391 -0.6632952 -0.6634512 -0.6636071 -0.6637629 -0.6639186 [247] -0.6640742 -0.6642298 -0.6643853 -0.6645406 -0.6646959 -0.6648511 [253] -0.6650062 -0.6651612 -0.6653162 -0.6654710 -0.6656258 -0.6657805 [259] -0.6659350 -0.6660895 -0.6662439 -0.6663983 -0.6665525 -0.6667066 [265] -0.6668607 -0.6670146 -0.6671685 -0.6673223 -0.6674760 -0.6676296 [271] -0.6677831 -0.6679365 -0.6680899 -0.6682431 -0.6683963 -0.6685493 [277] -0.6687023 -0.6688552 -0.6690080 -0.6691607 -0.6693133 -0.6694658 [283] -0.6696183 -0.6697706 -0.6699228 -0.6700750 -0.6702271 -0.6703790 [289] -0.6705309 -0.6706827 -0.6708344 -0.6709860 -0.6711375 -0.6712890 [295] -0.6714403 -0.6715915 -0.6717427 -0.6718937 -0.6720447 -0.6721956 [301] -0.6723463 -0.6724970 -0.6726476 -0.6727981 -0.6729485 -0.6730988 [307] -0.6732490 -0.6733992 -0.6735492 -0.6736991 -0.6738490 -0.6739987 [313] -0.6741484 -0.6742979 -0.6744474 -0.6745968 -0.6747460 -0.6748952 [319] -0.6750443 -0.6751933 -0.6753422 -0.6754910 -0.6756397 -0.6757883 [325] -0.6759369 -0.6760853 -0.6762336 -0.6763819 -0.6765300 -0.6766780 [331] -0.6768260 -0.6769738 -0.6771216 -0.6772692 -0.6774168 -0.6775643 [337] -0.6777116 -0.6778589 -0.6780061 -0.6781532 -0.6783002 -0.6784471 [343] -0.6785938 -0.6787405 -0.6788871 -0.6790336 -0.6791800 -0.6793263 [349] -0.6794725 -0.6796187 -0.6797647 -0.6799106 -0.6800564 -0.6802021 [355] -0.6803477 -0.6804933 -0.6806387 -0.6807840 -0.6809293 -0.6810744 [361] -0.6812194 -0.6813643 -0.6815092 -0.6816539 -0.6817986 -0.6819431 [367] -0.6820875 -0.6822319 -0.6823761 -0.6825203 -0.6826643 -0.6828082 [373] -0.6829521 -0.6830958 -0.6832395 -0.6833830 -0.6835265 -0.6836698 [379] -0.6838131 -0.6839562 -0.6840992 -0.6842422 -0.6843850 -0.6845278 [385] -0.6846704 -0.6848130 -0.6849554 -0.6850977 -0.6852400 -0.6853821 [391] -0.6855241 -0.6856661 -0.6858079 -0.6859496 -0.6860913 -0.6862328 [397] -0.6863742 -0.6865156 -0.6866568 -0.6867979 -0.6869389 > mx [1] 0 > mxli [1] -999 > if (mxli != 0) + { + x1 <- (x^mxli - 1) / mxli + } else { + x1 <- log(x) + } > postscript(file="/var/www/html/rcomp/tmp/1ksyr1257950843.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/rcomp/tmp/2sip61257950843.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/rcomp/tmp/3g0wa1257950843.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/rcomp/tmp/4x8101257950843.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/rcomp/tmp/5qpv81257950843.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/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 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/rcomp/tmp/60cwj1257950843.tab") > > system("convert tmp/1ksyr1257950843.ps tmp/1ksyr1257950843.png") > system("convert tmp/2sip61257950843.ps tmp/2sip61257950843.png") > system("convert tmp/3g0wa1257950843.ps tmp/3g0wa1257950843.png") > system("convert tmp/4x8101257950843.ps tmp/4x8101257950843.png") > system("convert tmp/5qpv81257950843.ps tmp/5qpv81257950843.png") > > > proc.time() user system elapsed 1.110 0.788 1.345