R version 2.7.0 (2008-04-22) 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(0.989130435,0.919087137,0.925417076,0.925612053,1.066666667,0.851108765,1.030693069,0.989031079,0.913000978,0.792723264,0.978170478,0.987513007,0.909433962,0.883608147,0.82745098,0.8252149,1.023255814,0.815418024,1.026192703,0.914742451,0.807276303,0.739130435,0.98973306,0.972164948,0.853889943,0.856864654,0.775739042,0.789473684,0.931350114,0.73971079,0.885245902,0.842435094,0.818458418,0.72755418,0.923238696,0.922680412,0.883762201,0.818270165,0.771047228,0.825852783,0.924485126,0.755165289,0.874671341,0.815956482,0.799807507,0.712598425,0.832980973,0.910323253,0.869149952,0.779182879,0.750254842,0.75856014,0.920889988,0.743991641,0.816254417,0.769593957,0.784007353,0.683284457,0.850505051,0.900695134,0.868398268) > #'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.4865459 -0.4866319 -0.4867179 -0.4868038 -0.4868895 -0.4869751 [7] -0.4870607 -0.4871461 -0.4872315 -0.4873167 -0.4874018 -0.4874868 [13] -0.4875717 -0.4876565 -0.4877412 -0.4878258 -0.4879103 -0.4879946 [19] -0.4880789 -0.4881630 -0.4882471 -0.4883310 -0.4884149 -0.4884986 [25] -0.4885822 -0.4886657 -0.4887491 -0.4888324 -0.4889156 -0.4889986 [31] -0.4890816 -0.4891644 -0.4892472 -0.4893298 -0.4894123 -0.4894947 [37] -0.4895770 -0.4896592 -0.4897413 -0.4898233 -0.4899051 -0.4899869 [43] -0.4900685 -0.4901500 -0.4902314 -0.4903127 -0.4903939 -0.4904750 [49] -0.4905559 -0.4906368 -0.4907175 -0.4907981 -0.4908786 -0.4909590 [55] -0.4910393 -0.4911195 -0.4911995 -0.4912795 -0.4913593 -0.4914390 [61] -0.4915186 -0.4915981 -0.4916774 -0.4917567 -0.4918358 -0.4919148 [67] -0.4919937 -0.4920725 -0.4921512 -0.4922297 -0.4923082 -0.4923865 [73] -0.4924647 -0.4925428 -0.4926208 -0.4926986 -0.4927764 -0.4928540 [79] -0.4929315 -0.4930089 -0.4930861 -0.4931633 -0.4932403 -0.4933172 [85] -0.4933940 -0.4934707 -0.4935472 -0.4936237 -0.4937000 -0.4937762 [91] -0.4938523 -0.4939282 -0.4940040 -0.4940798 -0.4941554 -0.4942308 [97] -0.4943062 -0.4943814 -0.4944565 -0.4945315 -0.4946064 -0.4946812 [103] -0.4947558 -0.4948303 -0.4949047 -0.4949790 -0.4950531 -0.4951271 [109] -0.4952010 -0.4952748 -0.4953484 -0.4954220 -0.4954954 -0.4955687 [115] -0.4956418 -0.4957149 -0.4957878 -0.4958606 -0.4959332 -0.4960058 [121] -0.4960782 -0.4961505 -0.4962226 -0.4962947 -0.4963666 -0.4964384 [127] -0.4965101 -0.4965816 -0.4966530 -0.4967243 -0.4967955 -0.4968665 [133] -0.4969374 -0.4970082 -0.4970789 -0.4971494 -0.4972198 -0.4972901 [139] -0.4973602 -0.4974303 -0.4975002 -0.4975699 -0.4976396 -0.4977091 [145] -0.4977785 -0.4978478 -0.4979169 -0.4979859 -0.4980548 -0.4981235 [151] -0.4981921 -0.4982606 -0.4983290 -0.4983972 -0.4984653 -0.4985333 [157] -0.4986011 -0.4986689 -0.4987364 -0.4988039 -0.4988712 -0.4989384 [163] -0.4990055 -0.4990724 -0.4991392 -0.4992059 -0.4992724 -0.4993388 [169] -0.4994051 -0.4994712 -0.4995373 -0.4996031 -0.4996689 -0.4997345 [175] -0.4998000 -0.4998654 -0.4999306 -0.4999957 -0.5000606 -0.5001254 [181] -0.5001901 -0.5002547 -0.5003191 -0.5003834 -0.5004476 -0.5005116 [187] -0.5005755 -0.5006393 -0.5007029 -0.5007664 -0.5008297 -0.5008929 [193] -0.5009560 -0.5010190 -0.5010818 -0.5011445 -0.5012070 -0.5012694 [199] -0.5013317 -0.5013939 -0.5014559 -0.5015177 -0.5015795 -0.5016411 [205] -0.5017025 -0.5017639 -0.5018251 -0.5018861 -0.5019470 -0.5020078 [211] -0.5020684 -0.5021290 -0.5021893 -0.5022496 -0.5023097 -0.5023696 [217] -0.5024294 -0.5024891 -0.5025487 -0.5026081 -0.5026673 -0.5027265 [223] -0.5027855 -0.5028443 -0.5029030 -0.5029616 -0.5030201 -0.5030784 [229] -0.5031365 -0.5031945 -0.5032524 -0.5033102 -0.5033678 -0.5034252 [235] -0.5034826 -0.5035398 -0.5035968 -0.5036537 -0.5037105 -0.5037671 [241] -0.5038236 -0.5038799 -0.5039361 -0.5039922 -0.5040481 -0.5041039 [247] -0.5041595 -0.5042150 -0.5042704 -0.5043256 -0.5043807 -0.5044356 [253] -0.5044904 -0.5045451 -0.5045996 -0.5046540 -0.5047082 -0.5047623 [259] -0.5048162 -0.5048700 -0.5049237 -0.5049772 -0.5050306 -0.5050838 [265] -0.5051369 -0.5051898 -0.5052426 -0.5052953 -0.5053478 -0.5054002 [271] -0.5054524 -0.5055045 -0.5055564 -0.5056082 -0.5056598 -0.5057114 [277] -0.5057627 -0.5058139 -0.5058650 -0.5059159 -0.5059667 -0.5060174 [283] -0.5060679 -0.5061182 -0.5061684 -0.5062185 -0.5062684 -0.5063182 [289] -0.5063678 -0.5064173 -0.5064666 -0.5065158 -0.5065649 -0.5066138 [295] -0.5066625 -0.5067111 -0.5067596 -0.5068079 -0.5068561 -0.5069041 [301] -0.5069520 -0.5069997 -0.5070473 -0.5070947 -0.5071420 -0.5071891 [307] -0.5072361 -0.5072830 -0.5073297 -0.5073763 -0.5074227 -0.5074689 [313] -0.5075150 -0.5075610 -0.5076068 -0.5076525 -0.5076980 -0.5077434 [319] -0.5077886 -0.5078337 -0.5078786 -0.5079234 -0.5079681 -0.5080125 [325] -0.5080569 -0.5081011 -0.5081451 -0.5081890 -0.5082328 -0.5082764 [331] -0.5083198 -0.5083631 -0.5084063 -0.5084493 -0.5084921 -0.5085348 [337] -0.5085774 -0.5086198 -0.5086620 -0.5087041 -0.5087461 -0.5087879 [343] -0.5088295 -0.5088711 -0.5089124 -0.5089536 -0.5089947 -0.5090356 [349] -0.5090763 -0.5091170 -0.5091574 -0.5091977 -0.5092379 -0.5092779 [355] -0.5093177 -0.5093574 -0.5093970 -0.5094364 -0.5094757 -0.5095148 [361] -0.5095537 -0.5095925 -0.5096312 -0.5096697 -0.5097080 -0.5097462 [367] -0.5097842 -0.5098221 -0.5098599 -0.5098975 -0.5099349 -0.5099722 [373] -0.5100093 -0.5100463 -0.5100832 -0.5101198 -0.5101564 -0.5101928 [379] -0.5102290 -0.5102651 -0.5103010 -0.5103368 -0.5103724 -0.5104078 [385] -0.5104432 -0.5104783 -0.5105133 -0.5105482 -0.5105829 -0.5106174 [391] -0.5106519 -0.5106861 -0.5107202 -0.5107541 -0.5107879 -0.5108216 [397] -0.5108551 -0.5108884 -0.5109216 -0.5109546 -0.5109875 > 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/1ja561225034308.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/23sd51225034308.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/39nok1225034308.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/456qy1225034308.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/5me4j1225034308.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/60vil1225034308.tab") > > system("convert tmp/1ja561225034308.ps tmp/1ja561225034308.png") > system("convert tmp/23sd51225034308.ps tmp/23sd51225034308.png") > system("convert tmp/39nok1225034308.ps tmp/39nok1225034308.png") > system("convert tmp/456qy1225034308.ps tmp/456qy1225034308.png") > system("convert tmp/5me4j1225034308.ps tmp/5me4j1225034308.png") > > > proc.time() user system elapsed 2.409 1.316 2.567