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(216234,213587,209465,204045,200237,203666,241476,260307,243324,244460,233575,237217,235243,230354,227184,221678,217142,219452,256446,265845,248624,241114,229245,231805,219277,219313,212610,214771,211142,211457,240048,240636,230580,208795,197922,194596,194581,185686,178106,172608,167302,168053,202300,202388,182516,173476,166444,171297,169701,164182,161914,159612,151001,158114,186530,187069,174330,169362,166827,178037,186412,189226,191563,188906,186005,195309,223532,226899,214126) > #'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.5078217 -0.5079125 -0.5080036 -0.5080932 -0.5081831 -0.5082736 [7] -0.5083628 -0.5084528 -0.5085416 -0.5086313 -0.5087186 -0.5088066 [13] -0.5088949 -0.5089821 -0.5090695 -0.5091562 -0.5092427 -0.5093292 [19] -0.5094154 -0.5095011 -0.5095865 -0.5096717 -0.5097563 -0.5098410 [25] -0.5099253 -0.5100090 -0.5100927 -0.5101760 -0.5102590 -0.5103417 [31] -0.5104241 -0.5105062 -0.5105880 -0.5106695 -0.5107507 -0.5108315 [37] -0.5109121 -0.5109924 -0.5110723 -0.5111520 -0.5112313 -0.5113103 [43] -0.5113891 -0.5114675 -0.5115456 -0.5116234 -0.5117009 -0.5117781 [49] -0.5118549 -0.5119315 -0.5120077 -0.5120837 -0.5121593 -0.5122346 [55] -0.5123096 -0.5123843 -0.5124587 -0.5125327 -0.5126065 -0.5126799 [61] -0.5127530 -0.5128258 -0.5128983 -0.5129705 -0.5130424 -0.5131139 [67] -0.5131851 -0.5132560 -0.5133266 -0.5133969 -0.5134669 -0.5135365 [73] -0.5136058 -0.5136749 -0.5137435 -0.5138119 -0.5138800 -0.5139477 [79] -0.5140151 -0.5140822 -0.5141490 -0.5142154 -0.5142816 -0.5143474 [85] -0.5144128 -0.5144780 -0.5145429 -0.5146074 -0.5146716 -0.5147355 [91] -0.5147990 -0.5148622 -0.5149251 -0.5149877 -0.5150500 -0.5151119 [97] -0.5151735 -0.5152348 -0.5152958 -0.5153564 -0.5154167 -0.5154767 [103] -0.5155363 -0.5155957 -0.5156547 -0.5157133 -0.5157717 -0.5158297 [109] -0.5158874 -0.5159448 -0.5160018 -0.5160585 -0.5161149 -0.5161709 [115] -0.5162266 -0.5162820 -0.5163371 -0.5163918 -0.5164462 -0.5165003 [121] -0.5165540 -0.5166074 -0.5166605 -0.5167132 -0.5167656 -0.5168177 [127] -0.5168695 -0.5169209 -0.5169719 -0.5170227 -0.5170731 -0.5171232 [133] -0.5171729 -0.5172223 -0.5172714 -0.5173202 -0.5173686 -0.5174167 [139] -0.5174644 -0.5175118 -0.5175589 -0.5176056 -0.5176520 -0.5176981 [145] -0.5177438 -0.5177892 -0.5178342 -0.5178790 -0.5179233 -0.5179674 [151] -0.5180111 -0.5180545 -0.5180975 -0.5181402 -0.5181825 -0.5182246 [157] -0.5182662 -0.5183076 -0.5183486 -0.5183892 -0.5184296 -0.5184695 [163] -0.5185092 -0.5185485 -0.5185874 -0.5186261 -0.5186644 -0.5187023 [169] -0.5187399 -0.5187772 -0.5188141 -0.5188507 -0.5188869 -0.5189228 [175] -0.5189584 -0.5189936 -0.5190284 -0.5190630 -0.5190972 -0.5191310 [181] -0.5191645 -0.5191977 -0.5192305 -0.5192630 -0.5192951 -0.5193269 [187] -0.5193584 -0.5193895 -0.5194202 -0.5194506 -0.5194807 -0.5195104 [193] -0.5195398 -0.5195689 -0.5195976 -0.5196259 -0.5196539 -0.5196816 [199] -0.5197089 -0.5197359 -0.5197625 -0.5197888 -0.5198147 -0.5198403 [205] -0.5198656 -0.5198905 -0.5199151 -0.5199393 -0.5199631 -0.5199867 [211] -0.5200098 -0.5200327 -0.5200551 -0.5200773 -0.5200991 -0.5201205 [217] -0.5201416 -0.5201624 -0.5201828 -0.5202028 -0.5202225 -0.5202419 [223] -0.5202609 -0.5202796 -0.5202979 -0.5203159 -0.5203335 -0.5203508 [229] -0.5203678 -0.5203843 -0.5204006 -0.5204165 -0.5204320 -0.5204472 [235] -0.5204621 -0.5204766 -0.5204907 -0.5205045 -0.5205180 -0.5205311 [241] -0.5205439 -0.5205563 -0.5205684 -0.5205801 -0.5205914 -0.5206025 [247] -0.5206131 -0.5206235 -0.5206335 -0.5206431 -0.5206524 -0.5206613 [253] -0.5206699 -0.5206781 -0.5206860 -0.5206936 -0.5207007 -0.5207076 [259] -0.5207141 -0.5207202 -0.5207260 -0.5207315 -0.5207366 -0.5207413 [265] -0.5207457 -0.5207498 -0.5207535 -0.5207569 -0.5207599 -0.5207625 [271] -0.5207649 -0.5207668 -0.5207684 -0.5207697 -0.5207706 -0.5207712 [277] -0.5207714 -0.5207713 -0.5207708 -0.5207700 -0.5207689 -0.5207673 [283] -0.5207655 -0.5207633 -0.5207607 -0.5207578 -0.5207545 -0.5207509 [289] -0.5207470 -0.5207427 -0.5207380 -0.5207330 -0.5207277 -0.5207220 [295] -0.5207160 -0.5207096 -0.5207028 -0.5206957 -0.5206883 -0.5206805 [301] -0.5206724 -0.5206639 -0.5206551 -0.5206460 -0.5206365 -0.5206266 [307] -0.5206164 -0.5206058 -0.5205949 -0.5205837 -0.5205721 -0.5205601 [313] -0.5205479 -0.5205352 -0.5205223 -0.5205089 -0.5204953 -0.5204812 [319] -0.5204669 -0.5204522 -0.5204371 -0.5204217 -0.5204060 -0.5203899 [325] -0.5203734 -0.5203567 -0.5203395 -0.5203221 -0.5203042 -0.5202861 [331] -0.5202676 -0.5202487 -0.5202295 -0.5202100 -0.5201901 -0.5201699 [337] -0.5201493 -0.5201284 -0.5201071 -0.5200855 -0.5200636 -0.5200413 [343] -0.5200187 -0.5199957 -0.5199724 -0.5199487 -0.5199247 -0.5199003 [349] -0.5198757 -0.5198506 -0.5198253 -0.5197995 -0.5197735 -0.5197471 [355] -0.5197203 -0.5196933 -0.5196658 -0.5196381 -0.5196100 -0.5195815 [361] -0.5195527 -0.5195236 -0.5194941 -0.5194643 -0.5194342 -0.5194037 [367] -0.5193729 -0.5193417 -0.5193102 -0.5192784 -0.5192462 -0.5192137 [373] -0.5191808 -0.5191476 -0.5191141 -0.5190802 -0.5190460 -0.5190115 [379] -0.5189766 -0.5189414 -0.5189058 -0.5188699 -0.5188337 -0.5187971 [385] -0.5187602 -0.5187230 -0.5186854 -0.5186475 -0.5186092 -0.5185707 [391] -0.5185317 -0.5184925 -0.5184529 -0.5184130 -0.5183727 -0.5183321 [397] -0.5182912 -0.5182500 -0.5182084 -0.5181665 -0.5181242 > 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/1lsgh1259261414.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/2szb81259261414.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/3gkzd1259261414.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/4zarm1259261414.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/5uqyw1259261414.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/6aakl1259261414.tab") > > system("convert tmp/1lsgh1259261414.ps tmp/1lsgh1259261414.png") > system("convert tmp/2szb81259261414.ps tmp/2szb81259261414.png") > system("convert tmp/3gkzd1259261414.ps tmp/3gkzd1259261414.png") > system("convert tmp/4zarm1259261414.ps tmp/4zarm1259261414.png") > system("convert tmp/5uqyw1259261414.ps tmp/5uqyw1259261414.png") > > > proc.time() user system elapsed 1.085 0.785 1.296