R version 2.8.0 (2008-10-20) 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(217859,208679,213188,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) > #'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.6845739 -0.6845153 -0.6844560 -0.6843950 -0.6843346 -0.6842748 [7] -0.6842134 -0.6841512 -0.6840885 -0.6840264 -0.6839626 -0.6838983 [13] -0.6838342 -0.6837692 -0.6837042 -0.6836382 -0.6835716 -0.6835049 [19] -0.6834375 -0.6833697 -0.6833014 -0.6832326 -0.6831631 -0.6830933 [25] -0.6830230 -0.6829521 -0.6828808 -0.6828089 -0.6827365 -0.6826637 [31] -0.6825903 -0.6825165 -0.6824422 -0.6823674 -0.6822920 -0.6822162 [37] -0.6821399 -0.6820630 -0.6819857 -0.6819079 -0.6818295 -0.6817507 [43] -0.6816713 -0.6815915 -0.6815112 -0.6814303 -0.6813490 -0.6812671 [49] -0.6811848 -0.6811019 -0.6810186 -0.6809347 -0.6808504 -0.6807655 [55] -0.6806801 -0.6805943 -0.6805079 -0.6804210 -0.6803337 -0.6802458 [61] -0.6801574 -0.6800685 -0.6799791 -0.6798892 -0.6797988 -0.6797079 [67] -0.6796165 -0.6795246 -0.6794322 -0.6793393 -0.6792458 -0.6791519 [73] -0.6790575 -0.6789625 -0.6788671 -0.6787711 -0.6786747 -0.6785777 [79] -0.6784803 -0.6783823 -0.6782838 -0.6781848 -0.6780853 -0.6779854 [85] -0.6778849 -0.6777839 -0.6776823 -0.6775803 -0.6774778 -0.6773748 [91] -0.6772713 -0.6771672 -0.6770627 -0.6769576 -0.6768521 -0.6767460 [97] -0.6766394 -0.6765324 -0.6764248 -0.6763167 -0.6762081 -0.6760990 [103] -0.6759894 -0.6758793 -0.6757687 -0.6756576 -0.6755459 -0.6754338 [109] -0.6753212 -0.6752080 -0.6750944 -0.6749802 -0.6748655 -0.6747504 [115] -0.6746347 -0.6745185 -0.6744018 -0.6742846 -0.6741669 -0.6740487 [121] -0.6739300 -0.6738108 -0.6736911 -0.6735709 -0.6734501 -0.6733289 [127] -0.6732071 -0.6730849 -0.6729621 -0.6728389 -0.6727151 -0.6725909 [133] -0.6724661 -0.6723408 -0.6722150 -0.6720887 -0.6719619 -0.6718346 [139] -0.6717068 -0.6715785 -0.6714497 -0.6713204 -0.6711906 -0.6710603 [145] -0.6709295 -0.6707981 -0.6706663 -0.6705340 -0.6704011 -0.6702678 [151] -0.6701340 -0.6699996 -0.6698648 -0.6697294 -0.6695936 -0.6694572 [157] -0.6693203 -0.6691830 -0.6690451 -0.6689068 -0.6687679 -0.6686285 [163] -0.6684887 -0.6683483 -0.6682074 -0.6680661 -0.6679242 -0.6677818 [169] -0.6676390 -0.6674956 -0.6673517 -0.6672074 -0.6670625 -0.6669172 [175] -0.6667713 -0.6666249 -0.6664781 -0.6663307 -0.6661829 -0.6660345 [181] -0.6658857 -0.6657363 -0.6655865 -0.6654361 -0.6652853 -0.6651340 [187] -0.6649821 -0.6648298 -0.6646770 -0.6645237 -0.6643699 -0.6642156 [193] -0.6640608 -0.6639055 -0.6637497 -0.6635934 -0.6634366 -0.6632794 [199] -0.6631216 -0.6629634 -0.6628046 -0.6626454 -0.6624856 -0.6623254 [205] -0.6621647 -0.6620035 -0.6618418 -0.6616796 -0.6615170 -0.6613538 [211] -0.6611902 -0.6610260 -0.6608614 -0.6606963 -0.6605307 -0.6603646 [217] -0.6601980 -0.6600310 -0.6598634 -0.6596954 -0.6595268 -0.6593578 [223] -0.6591883 -0.6590184 -0.6588479 -0.6586770 -0.6585055 -0.6583336 [229] -0.6581612 -0.6579883 -0.6578150 -0.6576411 -0.6574668 -0.6572920 [235] -0.6571167 -0.6569410 -0.6567647 -0.6565880 -0.6564108 -0.6562331 [241] -0.6560550 -0.6558763 -0.6556972 -0.6555176 -0.6553376 -0.6551570 [247] -0.6549760 -0.6547945 -0.6546125 -0.6544301 -0.6542472 -0.6540638 [253] -0.6538799 -0.6536956 -0.6535108 -0.6533255 -0.6531397 -0.6529535 [259] -0.6527668 -0.6525797 -0.6523920 -0.6522039 -0.6520154 -0.6518263 [265] -0.6516368 -0.6514469 -0.6512564 -0.6510655 -0.6508742 -0.6506823 [271] -0.6504900 -0.6502973 -0.6501040 -0.6499104 -0.6497162 -0.6495216 [277] -0.6493265 -0.6491310 -0.6489350 -0.6487385 -0.6485416 -0.6483443 [283] -0.6481464 -0.6479481 -0.6477494 -0.6475502 -0.6473505 -0.6471504 [289] -0.6469499 -0.6467488 -0.6465474 -0.6463454 -0.6461431 -0.6459402 [295] -0.6457369 -0.6455332 -0.6453290 -0.6451244 -0.6449193 -0.6447138 [301] -0.6445078 -0.6443013 -0.6440945 -0.6438872 -0.6436794 -0.6434712 [307] -0.6432625 -0.6430534 -0.6428439 -0.6426339 -0.6424235 -0.6422126 [313] -0.6420013 -0.6417895 -0.6415773 -0.6413647 -0.6411516 -0.6409381 [319] -0.6407242 -0.6405098 -0.6402950 -0.6400797 -0.6398641 -0.6396479 [325] -0.6394314 -0.6392144 -0.6389970 -0.6387791 -0.6385609 -0.6383422 [331] -0.6381230 -0.6379035 -0.6376835 -0.6374630 -0.6372422 -0.6370209 [337] -0.6367992 -0.6365771 -0.6363546 -0.6361316 -0.6359082 -0.6356844 [343] -0.6354602 -0.6352355 -0.6350104 -0.6347850 -0.6345590 -0.6343327 [349] -0.6341060 -0.6338788 -0.6336512 -0.6334233 -0.6331949 -0.6329660 [355] -0.6327368 -0.6325072 -0.6322771 -0.6320467 -0.6318158 -0.6315845 [361] -0.6313528 -0.6311207 -0.6308882 -0.6306553 -0.6304220 -0.6301883 [367] -0.6299542 -0.6297197 -0.6294848 -0.6292494 -0.6290137 -0.6287776 [373] -0.6285411 -0.6283042 -0.6280668 -0.6278291 -0.6275910 -0.6273525 [379] -0.6271136 -0.6268743 -0.6266347 -0.6263946 -0.6261541 -0.6259133 [385] -0.6256720 -0.6254304 -0.6251884 -0.6249460 -0.6247032 -0.6244600 [391] -0.6242164 -0.6239725 -0.6237282 -0.6234835 -0.6232384 -0.6229929 [397] -0.6227471 -0.6225008 -0.6222542 -0.6220072 -0.6217599 > mx [1] 0 > mxli [1] -999 > if (mxli != 0) + { + x1 <- (x^mxli - 1) / mxli + } else { + x1 <- log(x) + } > postscript(file="/var/www/html/freestat/rcomp/tmp/1sorf1229270932.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/freestat/rcomp/tmp/2hchr1229270932.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/freestat/rcomp/tmp/3a8xm1229270932.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/freestat/rcomp/tmp/4w54q1229270932.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/freestat/rcomp/tmp/5soin1229270932.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/62cz31229270932.tab") > > system("convert tmp/1sorf1229270932.ps tmp/1sorf1229270932.png") > system("convert tmp/2hchr1229270932.ps tmp/2hchr1229270932.png") > system("convert tmp/3a8xm1229270932.ps tmp/3a8xm1229270932.png") > system("convert tmp/4w54q1229270932.ps tmp/4w54q1229270932.png") > system("convert tmp/5soin1229270932.ps tmp/5soin1229270932.png") > > > proc.time() user system elapsed 1.729 1.288 1.905