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(308347,298427,289231,291975,294912,293488,290555,284736,281818,287854,316263,325412,326011,328282,317480,317539,313737,312276,309391,302950,300316,304035,333476,337698,335932,323931,313927,314485,313218,309664,302963,298989,298423,301631,329765,335083,327616,309119,295916,291413,291542,284678,276475,272566,264981,263290,296806,303598,286994,276427,266424,267153,268381,262522,255542,253158,243803,250741,280445,285257,270976) > #'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.5555331 -0.5554307 -0.5553423 -0.5552530 -0.5551659 -0.5550743 [7] -0.5549775 -0.5548859 -0.5547938 -0.5547002 -0.5546063 -0.5545127 [13] -0.5544198 -0.5543266 -0.5542327 -0.5541383 -0.5540430 -0.5539487 [19] -0.5538542 -0.5537593 -0.5536635 -0.5535687 -0.5534729 -0.5533772 [25] -0.5532823 -0.5531860 -0.5530903 -0.5529938 -0.5528973 -0.5528009 [31] -0.5527041 -0.5526071 -0.5525102 -0.5524129 -0.5523155 -0.5522178 [37] -0.5521200 -0.5520221 -0.5519241 -0.5518258 -0.5517274 -0.5516288 [43] -0.5515300 -0.5514311 -0.5513320 -0.5512327 -0.5511333 -0.5510337 [49] -0.5509339 -0.5508340 -0.5507339 -0.5506337 -0.5505332 -0.5504326 [55] -0.5503319 -0.5502309 -0.5501299 -0.5500286 -0.5499272 -0.5498256 [61] -0.5497238 -0.5496219 -0.5495198 -0.5494176 -0.5493152 -0.5492126 [67] -0.5491099 -0.5490070 -0.5489039 -0.5488007 -0.5486973 -0.5485937 [73] -0.5484900 -0.5483861 -0.5482821 -0.5481778 -0.5480735 -0.5479689 [79] -0.5478642 -0.5477594 -0.5476543 -0.5475492 -0.5474438 -0.5473383 [85] -0.5472326 -0.5471268 -0.5470208 -0.5469146 -0.5468083 -0.5467018 [91] -0.5465952 -0.5464884 -0.5463814 -0.5462743 -0.5461670 -0.5460596 [97] -0.5459520 -0.5458442 -0.5457363 -0.5456282 -0.5455200 -0.5454116 [103] -0.5453030 -0.5451943 -0.5450854 -0.5449764 -0.5448672 -0.5447578 [109] -0.5446483 -0.5445386 -0.5444288 -0.5443188 -0.5442087 -0.5440984 [115] -0.5439879 -0.5438773 -0.5437665 -0.5436556 -0.5435445 -0.5434332 [121] -0.5433218 -0.5432103 -0.5430986 -0.5429867 -0.5428747 -0.5427625 [127] -0.5426501 -0.5425376 -0.5424250 -0.5423122 -0.5421992 -0.5420861 [133] -0.5419729 -0.5418594 -0.5417459 -0.5416321 -0.5415182 -0.5414042 [139] -0.5412900 -0.5411757 -0.5410612 -0.5409465 -0.5408317 -0.5407168 [145] -0.5406016 -0.5404864 -0.5403710 -0.5402554 -0.5401397 -0.5400238 [151] -0.5399078 -0.5397916 -0.5396753 -0.5395588 -0.5394422 -0.5393254 [157] -0.5392085 -0.5390914 -0.5389741 -0.5388568 -0.5387392 -0.5386215 [163] -0.5385037 -0.5383857 -0.5382676 -0.5381493 -0.5380309 -0.5379123 [169] -0.5377936 -0.5376747 -0.5375557 -0.5374365 -0.5373172 -0.5371977 [175] -0.5370781 -0.5369583 -0.5368384 -0.5367184 -0.5365982 -0.5364778 [181] -0.5363573 -0.5362367 -0.5361159 -0.5359949 -0.5358738 -0.5357526 [187] -0.5356312 -0.5355097 -0.5353880 -0.5352662 -0.5351443 -0.5350222 [193] -0.5348999 -0.5347775 -0.5346550 -0.5345323 -0.5344095 -0.5342865 [199] -0.5341634 -0.5340402 -0.5339168 -0.5337932 -0.5336695 -0.5335457 [205] -0.5334218 -0.5332976 -0.5331734 -0.5330490 -0.5329245 -0.5327998 [211] -0.5326750 -0.5325500 -0.5324249 -0.5322997 -0.5321743 -0.5320488 [217] -0.5319231 -0.5317973 -0.5316713 -0.5315453 -0.5314190 -0.5312927 [223] -0.5311662 -0.5310395 -0.5309128 -0.5307858 -0.5306588 -0.5305316 [229] -0.5304043 -0.5302768 -0.5301492 -0.5300214 -0.5298935 -0.5297655 [235] -0.5296374 -0.5295091 -0.5293806 -0.5292521 -0.5291234 -0.5289945 [241] -0.5288656 -0.5287364 -0.5286072 -0.5284778 -0.5283483 -0.5282187 [247] -0.5280889 -0.5279589 -0.5278289 -0.5276987 -0.5275684 -0.5274379 [253] -0.5273073 -0.5271766 -0.5270458 -0.5269148 -0.5267836 -0.5266524 [259] -0.5265210 -0.5263895 -0.5262578 -0.5261261 -0.5259941 -0.5258621 [265] -0.5257299 -0.5255976 -0.5254652 -0.5253326 -0.5251999 -0.5250671 [271] -0.5249341 -0.5248010 -0.5246678 -0.5245345 -0.5244010 -0.5242674 [277] -0.5241336 -0.5239998 -0.5238658 -0.5237317 -0.5235974 -0.5234630 [283] -0.5233285 -0.5231939 -0.5230591 -0.5229242 -0.5227892 -0.5226541 [289] -0.5225188 -0.5223834 -0.5222479 -0.5221123 -0.5219765 -0.5218406 [295] -0.5217046 -0.5215684 -0.5214322 -0.5212958 -0.5211593 -0.5210226 [301] -0.5208859 -0.5207490 -0.5206119 -0.5204748 -0.5203375 -0.5202002 [307] -0.5200627 -0.5199250 -0.5197873 -0.5196494 -0.5195114 -0.5193733 [313] -0.5192350 -0.5190967 -0.5189582 -0.5188196 -0.5186809 -0.5185420 [319] -0.5184031 -0.5182640 -0.5181248 -0.5179855 -0.5178460 -0.5177064 [325] -0.5175668 -0.5174270 -0.5172870 -0.5171470 -0.5170069 -0.5168666 [331] -0.5167262 -0.5165857 -0.5164451 -0.5163043 -0.5161634 -0.5160225 [337] -0.5158814 -0.5157402 -0.5155988 -0.5154574 -0.5153158 -0.5151742 [343] -0.5150324 -0.5148905 -0.5147485 -0.5146063 -0.5144641 -0.5143217 [349] -0.5141792 -0.5140366 -0.5138939 -0.5137511 -0.5136082 -0.5134651 [355] -0.5133220 -0.5131787 -0.5130353 -0.5128919 -0.5127482 -0.5126045 [361] -0.5124607 -0.5123168 -0.5121727 -0.5120286 -0.5118843 -0.5117399 [367] -0.5115954 -0.5114508 -0.5113061 -0.5111613 -0.5110163 -0.5108713 [373] -0.5107262 -0.5105809 -0.5104355 -0.5102901 -0.5101445 -0.5099988 [379] -0.5098530 -0.5097071 -0.5095611 -0.5094149 -0.5092687 -0.5091224 [385] -0.5089760 -0.5088294 -0.5086828 -0.5085360 -0.5083891 -0.5082422 [391] -0.5080951 -0.5079479 -0.5078006 -0.5076533 -0.5075058 -0.5073582 [397] -0.5072105 -0.5070627 -0.5069148 -0.5067668 -0.5066187 > 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/18b7t1226438810.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/2o03e1226438810.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/3bqrj1226438810.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/4ujb91226438810.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/5z74y1226438810.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/6l1h21226438810.tab") > > system("convert tmp/18b7t1226438810.ps tmp/18b7t1226438810.png") > system("convert tmp/2o03e1226438810.ps tmp/2o03e1226438810.png") > system("convert tmp/3bqrj1226438810.ps tmp/3bqrj1226438810.png") > system("convert tmp/4ujb91226438810.ps tmp/4ujb91226438810.png") > system("convert tmp/5z74y1226438810.ps tmp/5z74y1226438810.png") > > > proc.time() user system elapsed 1.727 1.284 1.972