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(613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502,516,528,533,536,537,524,536,587,597,581) > #'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.5520010 -0.5520781 -0.5521552 -0.5522321 -0.5523089 -0.5523855 [7] -0.5524621 -0.5525385 -0.5526148 -0.5526911 -0.5527671 -0.5528431 [13] -0.5529190 -0.5529947 -0.5530703 -0.5531458 -0.5532212 -0.5532964 [19] -0.5533716 -0.5534466 -0.5535215 -0.5535963 -0.5536710 -0.5537455 [25] -0.5538199 -0.5538943 -0.5539684 -0.5540425 -0.5541165 -0.5541903 [31] -0.5542640 -0.5543376 -0.5544111 -0.5544845 -0.5545577 -0.5546309 [37] -0.5547039 -0.5547768 -0.5548495 -0.5549222 -0.5549947 -0.5550671 [43] -0.5551394 -0.5552116 -0.5552837 -0.5553556 -0.5554274 -0.5554991 [49] -0.5555707 -0.5556422 -0.5557135 -0.5557848 -0.5558559 -0.5559268 [55] -0.5559977 -0.5560685 -0.5561391 -0.5562096 -0.5562800 -0.5563503 [61] -0.5564204 -0.5564904 -0.5565604 -0.5566302 -0.5566998 -0.5567694 [67] -0.5568388 -0.5569081 -0.5569773 -0.5570464 -0.5571154 -0.5571842 [73] -0.5572529 -0.5573215 -0.5573900 -0.5574584 -0.5575266 -0.5575947 [79] -0.5576627 -0.5577306 -0.5577984 -0.5578660 -0.5579335 -0.5580009 [85] -0.5580682 -0.5581354 -0.5582024 -0.5582693 -0.5583361 -0.5584028 [91] -0.5584694 -0.5585358 -0.5586021 -0.5586683 -0.5587344 -0.5588004 [97] -0.5588662 -0.5589319 -0.5589975 -0.5590630 -0.5591284 -0.5591936 [103] -0.5592587 -0.5593237 -0.5593886 -0.5594534 -0.5595180 -0.5595825 [109] -0.5596469 -0.5597112 -0.5597754 -0.5598394 -0.5599033 -0.5599671 [115] -0.5600308 -0.5600943 -0.5601578 -0.5602211 -0.5602843 -0.5603474 [121] -0.5604103 -0.5604731 -0.5605358 -0.5605984 -0.5606609 -0.5607233 [127] -0.5607855 -0.5608476 -0.5609096 -0.5609715 -0.5610332 -0.5610948 [133] -0.5611563 -0.5612177 -0.5612790 -0.5613401 -0.5614011 -0.5614621 [139] -0.5615228 -0.5615835 -0.5616440 -0.5617045 -0.5617648 -0.5618249 [145] -0.5618850 -0.5619449 -0.5620047 -0.5620644 -0.5621240 -0.5621835 [151] -0.5622428 -0.5623020 -0.5623611 -0.5624201 -0.5624789 -0.5625376 [157] -0.5625962 -0.5626547 -0.5627131 -0.5627713 -0.5628295 -0.5628875 [163] -0.5629453 -0.5630031 -0.5630607 -0.5631183 -0.5631757 -0.5632329 [169] -0.5632901 -0.5633471 -0.5634040 -0.5634608 -0.5635175 -0.5635740 [175] -0.5636305 -0.5636868 -0.5637430 -0.5637990 -0.5638550 -0.5639108 [181] -0.5639665 -0.5640221 -0.5640776 -0.5641329 -0.5641881 -0.5642432 [187] -0.5642982 -0.5643530 -0.5644078 -0.5644624 -0.5645169 -0.5645712 [193] -0.5646255 -0.5646796 -0.5647336 -0.5647875 -0.5648413 -0.5648949 [199] -0.5649485 -0.5650019 -0.5650551 -0.5651083 -0.5651613 -0.5652143 [205] -0.5652671 -0.5653197 -0.5653723 -0.5654247 -0.5654770 -0.5655292 [211] -0.5655813 -0.5656332 -0.5656851 -0.5657368 -0.5657884 -0.5658398 [217] -0.5658912 -0.5659424 -0.5659935 -0.5660445 -0.5660953 -0.5661461 [223] -0.5661967 -0.5662472 -0.5662976 -0.5663478 -0.5663979 -0.5664480 [229] -0.5664978 -0.5665476 -0.5665973 -0.5666468 -0.5666962 -0.5667455 [235] -0.5667946 -0.5668437 -0.5668926 -0.5669414 -0.5669901 -0.5670387 [241] -0.5670871 -0.5671354 -0.5671836 -0.5672317 -0.5672796 -0.5673275 [247] -0.5673752 -0.5674228 -0.5674702 -0.5675176 -0.5675648 -0.5676119 [253] -0.5676589 -0.5677058 -0.5677525 -0.5677992 -0.5678457 -0.5678920 [259] -0.5679383 -0.5679844 -0.5680305 -0.5680764 -0.5681221 -0.5681678 [265] -0.5682133 -0.5682587 -0.5683040 -0.5683492 -0.5683943 -0.5684392 [271] -0.5684840 -0.5685287 -0.5685733 -0.5686177 -0.5686621 -0.5687063 [277] -0.5687503 -0.5687943 -0.5688382 -0.5688819 -0.5689255 -0.5689690 [283] -0.5690123 -0.5690556 -0.5690987 -0.5691417 -0.5691846 -0.5692273 [289] -0.5692700 -0.5693125 -0.5693549 -0.5693972 -0.5694393 -0.5694814 [295] -0.5695233 -0.5695651 -0.5696068 -0.5696483 -0.5696898 -0.5697311 [301] -0.5697723 -0.5698133 -0.5698543 -0.5698951 -0.5699358 -0.5699764 [307] -0.5700169 -0.5700573 -0.5700975 -0.5701376 -0.5701776 -0.5702175 [313] -0.5702572 -0.5702968 -0.5703363 -0.5703757 -0.5704150 -0.5704542 [319] -0.5704932 -0.5705321 -0.5705709 -0.5706096 -0.5706481 -0.5706865 [325] -0.5707248 -0.5707630 -0.5708011 -0.5708391 -0.5708769 -0.5709146 [331] -0.5709522 -0.5709897 -0.5710270 -0.5710642 -0.5711014 -0.5711383 [337] -0.5711752 -0.5712120 -0.5712486 -0.5712851 -0.5713215 -0.5713578 [343] -0.5713939 -0.5714300 -0.5714659 -0.5715017 -0.5715373 -0.5715729 [349] -0.5716083 -0.5716437 -0.5716788 -0.5717139 -0.5717489 -0.5717837 [355] -0.5718184 -0.5718530 -0.5718875 -0.5719219 -0.5719561 -0.5719902 [361] -0.5720243 -0.5720581 -0.5720919 -0.5721255 -0.5721591 -0.5721925 [367] -0.5722258 -0.5722589 -0.5722920 -0.5723249 -0.5723577 -0.5723904 [373] -0.5724230 -0.5724555 -0.5724878 -0.5725200 -0.5725521 -0.5725841 [379] -0.5726160 -0.5726477 -0.5726793 -0.5727108 -0.5727422 -0.5727735 [385] -0.5728046 -0.5728357 -0.5728666 -0.5728974 -0.5729280 -0.5729586 [391] -0.5729890 -0.5730194 -0.5730496 -0.5730796 -0.5731096 -0.5731394 [397] -0.5731692 -0.5731988 -0.5732283 -0.5732576 -0.5732869 > 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/1imt81261047785.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/2vu2z1261047785.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/3x8od1261047785.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/4w3fe1261047785.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/51vkg1261047785.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/6pcg51261047785.tab") > > try(system("convert tmp/1imt81261047785.ps tmp/1imt81261047785.png",intern=TRUE)) character(0) > try(system("convert tmp/2vu2z1261047785.ps tmp/2vu2z1261047785.png",intern=TRUE)) character(0) > try(system("convert tmp/3x8od1261047785.ps tmp/3x8od1261047785.png",intern=TRUE)) character(0) > try(system("convert tmp/4w3fe1261047785.ps tmp/4w3fe1261047785.png",intern=TRUE)) character(0) > try(system("convert tmp/51vkg1261047785.ps tmp/51vkg1261047785.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.050 0.770 1.282