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(17.44882829,17.23968844,16.87169003,16.58114384,16.78103959,16.85529767,16.72365849,16.90960919,17.08723243,17.49037894,17.59188103,17.39123937,17.41919121,17.60948541,17.79564686,17.73817793,17.53934061,17.67148503,17.60548217,17.40753605,17.03135891,17.11980342,17.09461945,17.00142777,17.06290921,17.1488191,16.95065029,16.71530576,16.86598269,16.81276027,16.69517287,16.5080894,16.51145508,16.573667,16.37506628,16.43722584,16.25778915,16.04792594,15.76984363,15.83799935,15.74967365,15.73193313,15.28927402,15.16807022,15.27289001,15.27508076,15.15790652,15.59941332,15.95949348,16.63995622,17.05923948,16.55331321,16.6972516,17.02040019,16.82974618,16.73132794,16.41864159,16.18084481,16.13515788,16.02243489) > #'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.5493973 -0.5494504 -0.5495035 -0.5495566 -0.5496096 -0.5496625 [7] -0.5497155 -0.5497684 -0.5498212 -0.5498740 -0.5499268 -0.5499795 [13] -0.5500322 -0.5500849 -0.5501375 -0.5501901 -0.5502426 -0.5502951 [19] -0.5503476 -0.5504000 -0.5504524 -0.5505047 -0.5505570 -0.5506093 [25] -0.5506615 -0.5507137 -0.5507658 -0.5508179 -0.5508700 -0.5509220 [31] -0.5509740 -0.5510259 -0.5510778 -0.5511297 -0.5511815 -0.5512333 [37] -0.5512850 -0.5513367 -0.5513884 -0.5514400 -0.5514916 -0.5515432 [43] -0.5515947 -0.5516461 -0.5516975 -0.5517489 -0.5518003 -0.5518516 [49] -0.5519028 -0.5519541 -0.5520052 -0.5520564 -0.5521075 -0.5521586 [55] -0.5522096 -0.5522606 -0.5523115 -0.5523624 -0.5524133 -0.5524641 [61] -0.5525149 -0.5525656 -0.5526163 -0.5526670 -0.5527176 -0.5527682 [67] -0.5528187 -0.5528692 -0.5529197 -0.5529701 -0.5530204 -0.5530708 [73] -0.5531211 -0.5531713 -0.5532215 -0.5532717 -0.5533218 -0.5533719 [79] -0.5534220 -0.5534720 -0.5535220 -0.5535719 -0.5536218 -0.5536716 [85] -0.5537214 -0.5537712 -0.5538209 -0.5538706 -0.5539202 -0.5539698 [91] -0.5540194 -0.5540689 -0.5541184 -0.5541678 -0.5542172 -0.5542666 [97] -0.5543159 -0.5543652 -0.5544144 -0.5544636 -0.5545127 -0.5545619 [103] -0.5546109 -0.5546600 -0.5547089 -0.5547579 -0.5548068 -0.5548556 [109] -0.5549045 -0.5549532 -0.5550020 -0.5550507 -0.5550993 -0.5551479 [115] -0.5551965 -0.5552450 -0.5552935 -0.5553420 -0.5553904 -0.5554388 [121] -0.5554871 -0.5555354 -0.5555836 -0.5556318 -0.5556799 -0.5557281 [127] -0.5557761 -0.5558242 -0.5558722 -0.5559201 -0.5559680 -0.5560159 [133] -0.5560637 -0.5561115 -0.5561592 -0.5562069 -0.5562546 -0.5563022 [139] -0.5563498 -0.5563973 -0.5564448 -0.5564922 -0.5565396 -0.5565870 [145] -0.5566343 -0.5566816 -0.5567288 -0.5567760 -0.5568232 -0.5568703 [151] -0.5569174 -0.5569644 -0.5570114 -0.5570583 -0.5571052 -0.5571521 [157] -0.5571989 -0.5572457 -0.5572924 -0.5573391 -0.5573857 -0.5574324 [163] -0.5574789 -0.5575254 -0.5575719 -0.5576184 -0.5576647 -0.5577111 [169] -0.5577574 -0.5578037 -0.5578499 -0.5578961 -0.5579422 -0.5579883 [175] -0.5580344 -0.5580804 -0.5581264 -0.5581723 -0.5582182 -0.5582640 [181] -0.5583098 -0.5583556 -0.5584013 -0.5584470 -0.5584926 -0.5585382 [187] -0.5585837 -0.5586292 -0.5586747 -0.5587201 -0.5587655 -0.5588108 [193] -0.5588561 -0.5589013 -0.5589465 -0.5589917 -0.5590368 -0.5590819 [199] -0.5591269 -0.5591719 -0.5592169 -0.5592618 -0.5593066 -0.5593515 [205] -0.5593962 -0.5594410 -0.5594856 -0.5595303 -0.5595749 -0.5596195 [211] -0.5596640 -0.5597084 -0.5597529 -0.5597973 -0.5598416 -0.5598859 [217] -0.5599302 -0.5599744 -0.5600186 -0.5600627 -0.5601068 -0.5601508 [223] -0.5601948 -0.5602388 -0.5602827 -0.5603266 -0.5603704 -0.5604142 [229] -0.5604579 -0.5605016 -0.5605453 -0.5605889 -0.5606324 -0.5606760 [235] -0.5607194 -0.5607629 -0.5608063 -0.5608496 -0.5608929 -0.5609362 [241] -0.5609794 -0.5610226 -0.5610657 -0.5611088 -0.5611519 -0.5611949 [247] -0.5612378 -0.5612807 -0.5613236 -0.5613664 -0.5614092 -0.5614520 [253] -0.5614947 -0.5615373 -0.5615799 -0.5616225 -0.5616650 -0.5617075 [259] -0.5617499 -0.5617923 -0.5618347 -0.5618770 -0.5619192 -0.5619615 [265] -0.5620036 -0.5620458 -0.5620878 -0.5621299 -0.5621719 -0.5622138 [271] -0.5622558 -0.5622976 -0.5623394 -0.5623812 -0.5624230 -0.5624646 [277] -0.5625063 -0.5625479 -0.5625895 -0.5626310 -0.5626724 -0.5627139 [283] -0.5627553 -0.5627966 -0.5628379 -0.5628791 -0.5629203 -0.5629615 [289] -0.5630026 -0.5630437 -0.5630847 -0.5631257 -0.5631667 -0.5632076 [295] -0.5632484 -0.5632892 -0.5633300 -0.5633707 -0.5634114 -0.5634520 [301] -0.5634926 -0.5635332 -0.5635737 -0.5636141 -0.5636545 -0.5636949 [307] -0.5637352 -0.5637755 -0.5638157 -0.5638559 -0.5638961 -0.5639362 [313] -0.5639762 -0.5640162 -0.5640562 -0.5640961 -0.5641360 -0.5641759 [319] -0.5642156 -0.5642554 -0.5642951 -0.5643348 -0.5643744 -0.5644139 [325] -0.5644535 -0.5644929 -0.5645324 -0.5645718 -0.5646111 -0.5646504 [331] -0.5646897 -0.5647289 -0.5647681 -0.5648072 -0.5648463 -0.5648853 [337] -0.5649243 -0.5649632 -0.5650021 -0.5650410 -0.5650798 -0.5651186 [343] -0.5651573 -0.5651960 -0.5652346 -0.5652732 -0.5653117 -0.5653502 [349] -0.5653887 -0.5654271 -0.5654654 -0.5655038 -0.5655420 -0.5655803 [355] -0.5656185 -0.5656566 -0.5656947 -0.5657327 -0.5657707 -0.5658087 [361] -0.5658466 -0.5658845 -0.5659223 -0.5659601 -0.5659978 -0.5660355 [367] -0.5660732 -0.5661108 -0.5661483 -0.5661858 -0.5662233 -0.5662607 [373] -0.5662981 -0.5663354 -0.5663727 -0.5664100 -0.5664472 -0.5664843 [379] -0.5665214 -0.5665585 -0.5665955 -0.5666325 -0.5666694 -0.5667063 [385] -0.5667431 -0.5667799 -0.5668166 -0.5668533 -0.5668900 -0.5669266 [391] -0.5669632 -0.5669997 -0.5670362 -0.5670726 -0.5671090 -0.5671453 [397] -0.5671816 -0.5672179 -0.5672541 -0.5672902 -0.5673263 > 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/1u5161257797972.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/23slw1257797972.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/37crn1257797972.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/4pk1f1257797972.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/5ztn91257797972.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/6qvg31257797972.tab") > > system("convert tmp/1u5161257797972.ps tmp/1u5161257797972.png") > system("convert tmp/23slw1257797972.ps tmp/23slw1257797972.png") > system("convert tmp/37crn1257797972.ps tmp/37crn1257797972.png") > system("convert tmp/4pk1f1257797972.ps tmp/4pk1f1257797972.png") > system("convert tmp/5ztn91257797972.ps tmp/5ztn91257797972.png") > > > proc.time() user system elapsed 1.719 1.265 1.970