R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(04.031636,03.702076,03.056167,03.280707,02.984728,03.693712,03.226317,02.190349,02.599515,03.080288,02.929672,02.922548,03.234943,02.983081,03.284389,03.806511,03.784579,02.645654,03.092081,03.204859,03.107225,03.466909,02.984404,03.218072,02.827310,03.182049,02.236319,02.033218,01.644804,01.627971,01.677559,02.330828,02.493615,02.257172,02.655517,02.298655,02.600402,03.045230,02.790583,03.227052,02.967479,02.938817,03.277961,03.423985,03.072646,02.754253,02.910431,03.174369,03.068387,03.089543,02.906654,02.931161,03.025660,02.939551,02.691019,03.198120,03.076390,02.863873,03.013802,03.053364,02.864753,03.057062,02.959365,03.252258,03.602988,03.497704,03.296867,03.602417,03.300100,03.401930,03.502591,03.402348,03.498551,03.199823,02.700064,02.801034,02.898628,02.800854,02.399942,02.402724,02.202331,02.102594,01.798293,01.202484,01.400201,01.200832,01.298083,01.099742,01.001377,00.836174) > #'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.5391322 -0.5392813 -0.5394285 -0.5395738 -0.5397173 -0.5398589 [7] -0.5399986 -0.5401365 -0.5402724 -0.5404064 -0.5405385 -0.5406688 [13] -0.5407971 -0.5409234 -0.5410479 -0.5411704 -0.5412910 -0.5414096 [19] -0.5415263 -0.5416411 -0.5417539 -0.5418647 -0.5419736 -0.5420805 [25] -0.5421854 -0.5422884 -0.5423893 -0.5424883 -0.5425853 -0.5426803 [31] -0.5427733 -0.5428643 -0.5429533 -0.5430403 -0.5431253 -0.5432083 [37] -0.5432893 -0.5433682 -0.5434451 -0.5435200 -0.5435929 -0.5436637 [43] -0.5437325 -0.5437993 -0.5438640 -0.5439267 -0.5439873 -0.5440459 [49] -0.5441025 -0.5441569 -0.5442094 -0.5442598 -0.5443081 -0.5443544 [55] -0.5443986 -0.5444408 -0.5444809 -0.5445189 -0.5445549 -0.5445888 [61] -0.5446206 -0.5446504 -0.5446781 -0.5447037 -0.5447273 -0.5447488 [67] -0.5447682 -0.5447856 -0.5448009 -0.5448141 -0.5448253 -0.5448344 [73] -0.5448414 -0.5448464 -0.5448492 -0.5448501 -0.5448488 -0.5448455 [79] -0.5448401 -0.5448327 -0.5448232 -0.5448116 -0.5447980 -0.5447823 [85] -0.5447646 -0.5447448 -0.5447229 -0.5446990 -0.5446731 -0.5446450 [91] -0.5446150 -0.5445829 -0.5445488 -0.5445126 -0.5444744 -0.5444342 [97] -0.5443919 -0.5443476 -0.5443013 -0.5442529 -0.5442025 -0.5441502 [103] -0.5440958 -0.5440394 -0.5439809 -0.5439205 -0.5438581 -0.5437937 [109] -0.5437273 -0.5436589 -0.5435886 -0.5435162 -0.5434419 -0.5433656 [115] -0.5432874 -0.5432071 -0.5431250 -0.5430409 -0.5429548 -0.5428668 [121] -0.5427768 -0.5426850 -0.5425911 -0.5424954 -0.5423978 -0.5422982 [127] -0.5421968 -0.5420934 -0.5419882 -0.5418811 -0.5417720 -0.5416612 [133] -0.5415484 -0.5414338 -0.5413173 -0.5411990 -0.5410788 -0.5409568 [139] -0.5408330 -0.5407073 -0.5405798 -0.5404505 -0.5403194 -0.5401866 [145] -0.5400519 -0.5399154 -0.5397772 -0.5396372 -0.5394954 -0.5393519 [151] -0.5392067 -0.5390597 -0.5389109 -0.5387605 -0.5386083 -0.5384545 [157] -0.5382989 -0.5381416 -0.5379827 -0.5378221 -0.5376598 -0.5374959 [163] -0.5373303 -0.5371631 -0.5369942 -0.5368237 -0.5366516 -0.5364779 [169] -0.5363026 -0.5361257 -0.5359472 -0.5357672 -0.5355856 -0.5354024 [175] -0.5352177 -0.5350315 -0.5348437 -0.5346544 -0.5344637 -0.5342714 [181] -0.5340776 -0.5338823 -0.5336856 -0.5334874 -0.5332878 -0.5330867 [187] -0.5328842 -0.5326802 -0.5324749 -0.5322681 -0.5320600 -0.5318505 [193] -0.5316396 -0.5314273 -0.5312137 -0.5309987 -0.5307824 -0.5305648 [199] -0.5303458 -0.5301256 -0.5299041 -0.5296812 -0.5294571 -0.5292318 [205] -0.5290052 -0.5287773 -0.5285482 -0.5283179 -0.5280864 -0.5278537 [211] -0.5276198 -0.5273847 -0.5271484 -0.5269110 -0.5266724 -0.5264327 [217] -0.5261918 -0.5259499 -0.5257068 -0.5254626 -0.5252174 -0.5249710 [223] -0.5247236 -0.5244752 -0.5242257 -0.5239751 -0.5237235 -0.5234710 [229] -0.5232174 -0.5229628 -0.5227072 -0.5224507 -0.5221932 -0.5219348 [235] -0.5216754 -0.5214150 -0.5211538 -0.5208917 -0.5206286 -0.5203647 [241] -0.5200999 -0.5198342 -0.5195676 -0.5193002 -0.5190320 -0.5187630 [247] -0.5184931 -0.5182224 -0.5179510 -0.5176787 -0.5174057 -0.5171319 [253] -0.5168574 -0.5165821 -0.5163061 -0.5160293 -0.5157519 -0.5154737 [259] -0.5151949 -0.5149154 -0.5146352 -0.5143543 -0.5140728 -0.5137906 [265] -0.5135078 -0.5132244 -0.5129404 -0.5126558 -0.5123706 -0.5120848 [271] -0.5117984 -0.5115115 -0.5112240 -0.5109360 -0.5106474 -0.5103583 [277] -0.5100688 -0.5097787 -0.5094881 -0.5091970 -0.5089054 -0.5086134 [283] -0.5083209 -0.5080280 -0.5077347 -0.5074409 -0.5071467 -0.5068521 [289] -0.5065571 -0.5062617 -0.5059659 -0.5056697 -0.5053732 -0.5050763 [295] -0.5047791 -0.5044816 -0.5041837 -0.5038855 -0.5035870 -0.5032882 [301] -0.5029891 -0.5026897 -0.5023900 -0.5020901 -0.5017899 -0.5014895 [307] -0.5011888 -0.5008879 -0.5005868 -0.5002854 -0.4999839 -0.4996821 [313] -0.4993802 -0.4990781 -0.4987758 -0.4984733 -0.4981707 -0.4978679 [319] -0.4975650 -0.4972619 -0.4969588 -0.4966555 -0.4963521 -0.4960486 [325] -0.4957450 -0.4954413 -0.4951375 -0.4948336 -0.4945297 -0.4942258 [331] -0.4939217 -0.4936177 -0.4933136 -0.4930094 -0.4927053 -0.4924011 [337] -0.4920969 -0.4917928 -0.4914886 -0.4911844 -0.4908803 -0.4905762 [343] -0.4902721 -0.4899681 -0.4896641 -0.4893601 -0.4890562 -0.4887524 [349] -0.4884487 -0.4881450 -0.4878414 -0.4875379 -0.4872345 -0.4869312 [355] -0.4866280 -0.4863250 -0.4860220 -0.4857192 -0.4854165 -0.4851140 [361] -0.4848116 -0.4845093 -0.4842072 -0.4839053 -0.4836035 -0.4833019 [367] -0.4830005 -0.4826993 -0.4823983 -0.4820974 -0.4817968 -0.4814963 [373] -0.4811961 -0.4808961 -0.4805963 -0.4802967 -0.4799974 -0.4796983 [379] -0.4793994 -0.4791008 -0.4788024 -0.4785043 -0.4782065 -0.4779089 [385] -0.4776115 -0.4773145 -0.4770177 -0.4767212 -0.4764250 -0.4761291 [391] -0.4758335 -0.4755382 -0.4752432 -0.4749485 -0.4746541 -0.4743600 [397] -0.4740662 -0.4737728 -0.4734797 -0.4731869 -0.4728945 > mx [1] 0 > mxli [1] -999 > if (mxli != 0) + { + x1 <- (x^mxli - 1) / mxli + } else { + x1 <- log(x) + } > postscript(file="/var/www/rcomp/tmp/17fyr1293626400.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/www/rcomp/tmp/27fyr1293626400.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/www/rcomp/tmp/37fyr1293626400.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/www/rcomp/tmp/47fyr1293626400.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/www/rcomp/tmp/5hoxu1293626400.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/62pe01293626400.tab") > try(system("convert tmp/17fyr1293626400.ps tmp/17fyr1293626400.png",intern=TRUE)) character(0) > try(system("convert tmp/27fyr1293626400.ps tmp/27fyr1293626400.png",intern=TRUE)) character(0) > try(system("convert tmp/37fyr1293626400.ps tmp/37fyr1293626400.png",intern=TRUE)) character(0) > try(system("convert tmp/47fyr1293626400.ps tmp/47fyr1293626400.png",intern=TRUE)) character(0) > try(system("convert tmp/5hoxu1293626400.ps tmp/5hoxu1293626400.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.560 1.130 3.079