R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(210907,179321,149061,237213,173326,133131,258873,324799,230964,236785,344297,174724,174415,223632,294424,325107,106408,96560,265769,269651,149112,152871,362301,183167,277965,218946,244052,341570,233328,206161,311473,207176,196553,143246,182192,194979,167488,143756,275541,152299,193339,130585,112611,148446,182079,243060,162765,85574,225060,133328,100750,101523,243511,152474,132487,317394,244749,184510,128423,97839,172494,229242,351619,324598,195838,254488,199476,92499,224330,181633,271856,95227,98146,118612,65475,108446,121848,76302,98104,30989,31774,150580,54157,59382,84105) > #'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.4163524 -0.4173604 -0.4183709 -0.4193841 -0.4203998 -0.4214178 [7] -0.4224382 -0.4234609 -0.4244859 -0.4255129 -0.4265421 -0.4275731 [13] -0.4286062 -0.4296410 -0.4306776 -0.4317158 -0.4327557 -0.4337970 [19] -0.4348397 -0.4358837 -0.4369290 -0.4379753 -0.4390227 -0.4400711 [25] -0.4411202 -0.4421701 -0.4432207 -0.4442717 -0.4453232 -0.4463750 [31] -0.4474270 -0.4484791 -0.4495312 -0.4505831 -0.4516348 -0.4526862 [37] -0.4537371 -0.4547874 -0.4558369 -0.4568856 -0.4579334 -0.4589801 [43] -0.4600255 -0.4610697 -0.4621123 -0.4631533 -0.4641926 -0.4652301 [49] -0.4662655 -0.4672988 -0.4683297 -0.4693583 -0.4703843 -0.4714076 [55] -0.4724281 -0.4734456 -0.4744600 -0.4754710 -0.4764787 -0.4774828 [61] -0.4784831 -0.4794796 -0.4804721 -0.4814604 -0.4824444 -0.4834239 [67] -0.4843988 -0.4853689 -0.4863341 -0.4872942 -0.4882491 -0.4891986 [73] -0.4901425 -0.4910808 -0.4920132 -0.4929395 -0.4938597 -0.4947736 [79] -0.4956811 -0.4965819 -0.4974759 -0.4983629 -0.4992429 -0.5001157 [85] -0.5009810 -0.5018388 -0.5026889 -0.5035312 -0.5043655 -0.5051916 [91] -0.5060094 -0.5068188 -0.5076196 -0.5084116 -0.5091948 -0.5099690 [97] -0.5107341 -0.5114898 -0.5122361 -0.5129728 -0.5136999 -0.5144171 [103] -0.5151243 -0.5158214 -0.5165083 -0.5171849 -0.5178510 -0.5185065 [109] -0.5191513 -0.5197853 -0.5204084 -0.5210204 -0.5216212 -0.5222108 [115] -0.5227889 -0.5233557 -0.5239108 -0.5244543 -0.5249860 -0.5255059 [121] -0.5260138 -0.5265097 -0.5269934 -0.5274650 -0.5279244 -0.5283713 [127] -0.5288059 -0.5292280 -0.5296375 -0.5300345 -0.5304188 -0.5307903 [133] -0.5311491 -0.5314951 -0.5318282 -0.5321484 -0.5324556 -0.5327499 [139] -0.5330311 -0.5332994 -0.5335545 -0.5337965 -0.5340255 -0.5342413 [145] -0.5344439 -0.5346334 -0.5348098 -0.5349730 -0.5351230 -0.5352599 [151] -0.5353836 -0.5354942 -0.5355916 -0.5356759 -0.5357472 -0.5358053 [157] -0.5358504 -0.5358825 -0.5359016 -0.5359077 -0.5359009 -0.5358813 [163] -0.5358487 -0.5358034 -0.5357454 -0.5356746 -0.5355912 -0.5354952 [169] -0.5353866 -0.5352656 -0.5351322 -0.5349864 -0.5348284 -0.5346581 [175] -0.5344758 -0.5342813 -0.5340749 -0.5338565 -0.5336264 -0.5333844 [181] -0.5331309 -0.5328657 -0.5325891 -0.5323010 -0.5320017 -0.5316911 [187] -0.5313695 -0.5310368 -0.5306931 -0.5303387 -0.5299735 -0.5295977 [193] -0.5292114 -0.5288146 -0.5284075 -0.5279902 -0.5275629 -0.5271255 [199] -0.5266782 -0.5262212 -0.5257545 -0.5252782 -0.5247925 -0.5242974 [205] -0.5237932 -0.5232798 -0.5227574 -0.5222262 -0.5216861 -0.5211375 [211] -0.5205803 -0.5200146 -0.5194407 -0.5188586 -0.5182684 -0.5176702 [217] -0.5170642 -0.5164505 -0.5158292 -0.5152003 -0.5145641 -0.5139206 [223] -0.5132700 -0.5126123 -0.5119477 -0.5112763 -0.5105982 -0.5099136 [229] -0.5092224 -0.5085249 -0.5078212 -0.5071113 -0.5063954 -0.5056736 [235] -0.5049460 -0.5042127 -0.5034738 -0.5027295 -0.5019797 -0.5012247 [241] -0.5004646 -0.4996994 -0.4989293 -0.4981543 -0.4973746 -0.4965903 [247] -0.4958014 -0.4950081 -0.4942104 -0.4934085 -0.4926025 -0.4917925 [253] -0.4909785 -0.4901606 -0.4893390 -0.4885138 -0.4876849 -0.4868526 [259] -0.4860169 -0.4851780 -0.4843358 -0.4834905 -0.4826422 -0.4817909 [265] -0.4809368 -0.4800799 -0.4792203 -0.4783581 -0.4774934 -0.4766263 [271] -0.4757568 -0.4748850 -0.4740110 -0.4731348 -0.4722566 -0.4713765 [277] -0.4704944 -0.4696105 -0.4687248 -0.4678375 -0.4669485 -0.4660580 [283] -0.4651660 -0.4642727 -0.4633779 -0.4624819 -0.4615847 -0.4606863 [289] -0.4597868 -0.4588863 -0.4579849 -0.4570825 -0.4561793 -0.4552754 [295] -0.4543707 -0.4534653 -0.4525593 -0.4516528 -0.4507457 -0.4498383 [301] -0.4489304 -0.4480222 -0.4471136 -0.4462049 -0.4452959 -0.4443869 [307] -0.4434777 -0.4425685 -0.4416592 -0.4407501 -0.4398410 -0.4389320 [313] -0.4380233 -0.4371147 -0.4362064 -0.4352985 -0.4343908 -0.4334836 [319] -0.4325768 -0.4316705 -0.4307646 -0.4298593 -0.4289546 -0.4280505 [325] -0.4271471 -0.4262443 -0.4253423 -0.4244410 -0.4235405 -0.4226409 [331] -0.4217420 -0.4208441 -0.4199471 -0.4190510 -0.4181559 -0.4172618 [337] -0.4163688 -0.4154768 -0.4145858 -0.4136961 -0.4128074 -0.4119199 [343] -0.4110336 -0.4101485 -0.4092647 -0.4083822 -0.4075009 -0.4066209 [349] -0.4057423 -0.4048650 -0.4039892 -0.4031147 -0.4022416 -0.4013700 [355] -0.4004998 -0.3996312 -0.3987640 -0.3978983 -0.3970342 -0.3961717 [361] -0.3953107 -0.3944513 -0.3935935 -0.3927373 -0.3918828 -0.3910300 [367] -0.3901788 -0.3893293 -0.3884814 -0.3876354 -0.3867910 -0.3859484 [373] -0.3851075 -0.3842684 -0.3834311 -0.3825955 -0.3817618 -0.3809299 [379] -0.3800998 -0.3792716 -0.3784452 -0.3776207 -0.3767980 -0.3759773 [385] -0.3751584 -0.3743414 -0.3735263 -0.3727132 -0.3719019 -0.3710926 [391] -0.3702853 -0.3694799 -0.3686764 -0.3678750 -0.3670755 -0.3662779 [397] -0.3654824 -0.3646889 -0.3638973 -0.3631078 -0.3623202 > mx [1] 0 > mxli [1] -999 > if (mxli != 0) + { + x1 <- (x^mxli - 1) / mxli + } else { + x1 <- log(x) + } > postscript(file="/var/wessaorg/rcomp/tmp/1f95u1323616821.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2ooaw1323616821.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3ovw71323616821.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/4m6dm1323616821.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/5do7l1323616821.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/6s6fn1323616821.tab") > > try(system("convert tmp/1f95u1323616821.ps tmp/1f95u1323616821.png",intern=TRUE)) character(0) > try(system("convert tmp/2ooaw1323616821.ps tmp/2ooaw1323616821.png",intern=TRUE)) character(0) > try(system("convert tmp/3ovw71323616821.ps tmp/3ovw71323616821.png",intern=TRUE)) character(0) > try(system("convert tmp/4m6dm1323616821.ps tmp/4m6dm1323616821.png",intern=TRUE)) character(0) > try(system("convert tmp/5do7l1323616821.ps tmp/5do7l1323616821.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.449 0.234 1.858