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(11.1,10.9,10,9.2,9.2,9.5,9.6,9.5,9.1,8.9,9,10.1,10.3,10.2,9.6,9.2,9.3,9.4,9.4,9.2,9,9,9,9.8,10,9.8,9.3,9,9,9.1,9.1,9.1,9.2,8.8,8.3,8.4,8.1,7.7,7.9,7.9,8,7.9,7.6,7.1,6.8,6.5,6.9,8.2,8.7,8.3,7.9,7.5,7.8,8.3,8.4,8.2,7.7,7.2,7.3,8.1) > #'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.7318161 -0.7320786 -0.7323408 -0.7326025 -0.7328638 -0.7331247 [7] -0.7333852 -0.7336453 -0.7339049 -0.7341641 -0.7344229 -0.7346813 [13] -0.7349392 -0.7351968 -0.7354539 -0.7357105 -0.7359668 -0.7362226 [19] -0.7364780 -0.7367329 -0.7369875 -0.7372416 -0.7374952 -0.7377485 [25] -0.7380013 -0.7382537 -0.7385056 -0.7387571 -0.7390082 -0.7392588 [31] -0.7395090 -0.7397587 -0.7400081 -0.7402569 -0.7405054 -0.7407534 [37] -0.7410009 -0.7412481 -0.7414947 -0.7417410 -0.7419868 -0.7422321 [43] -0.7424770 -0.7427215 -0.7429655 -0.7432090 -0.7434522 -0.7436948 [49] -0.7439370 -0.7441788 -0.7444201 -0.7446610 -0.7449014 -0.7451414 [55] -0.7453809 -0.7456199 -0.7458585 -0.7460967 -0.7463344 -0.7465716 [61] -0.7468084 -0.7470447 -0.7472805 -0.7475160 -0.7477509 -0.7479854 [67] -0.7482194 -0.7484530 -0.7486861 -0.7489187 -0.7491509 -0.7493826 [73] -0.7496138 -0.7498446 -0.7500749 -0.7503047 -0.7505341 -0.7507630 [79] -0.7509915 -0.7512194 -0.7514469 -0.7516740 -0.7519005 -0.7521266 [85] -0.7523522 -0.7525774 -0.7528021 -0.7530263 -0.7532500 -0.7534732 [91] -0.7536960 -0.7539183 -0.7541401 -0.7543615 -0.7545823 -0.7548027 [97] -0.7550226 -0.7552420 -0.7554610 -0.7556794 -0.7558974 -0.7561149 [103] -0.7563319 -0.7565485 -0.7567645 -0.7569801 -0.7571952 -0.7574098 [109] -0.7576239 -0.7578375 -0.7580506 -0.7582633 -0.7584754 -0.7586871 [115] -0.7588983 -0.7591090 -0.7593192 -0.7595289 -0.7597381 -0.7599468 [121] -0.7601550 -0.7603628 -0.7605700 -0.7607768 -0.7609830 -0.7611888 [127] -0.7613940 -0.7615988 -0.7618031 -0.7620068 -0.7622101 -0.7624129 [133] -0.7626151 -0.7628169 -0.7630182 -0.7632190 -0.7634192 -0.7636190 [139] -0.7638183 -0.7640170 -0.7642153 -0.7644130 -0.7646103 -0.7648070 [145] -0.7650033 -0.7651990 -0.7653943 -0.7655890 -0.7657832 -0.7659769 [151] -0.7661701 -0.7663628 -0.7665550 -0.7667466 -0.7669378 -0.7671284 [157] -0.7673186 -0.7675082 -0.7676973 -0.7678859 -0.7680740 -0.7682616 [163] -0.7684487 -0.7686352 -0.7688212 -0.7690068 -0.7691918 -0.7693762 [169] -0.7695602 -0.7697437 -0.7699266 -0.7701090 -0.7702909 -0.7704723 [175] -0.7706531 -0.7708335 -0.7710133 -0.7711926 -0.7713714 -0.7715496 [181] -0.7717274 -0.7719046 -0.7720813 -0.7722574 -0.7724331 -0.7726082 [187] -0.7727828 -0.7729568 -0.7731304 -0.7733034 -0.7734759 -0.7736479 [193] -0.7738193 -0.7739902 -0.7741606 -0.7743304 -0.7744998 -0.7746686 [199] -0.7748368 -0.7750046 -0.7751718 -0.7753385 -0.7755046 -0.7756702 [205] -0.7758353 -0.7759999 -0.7761639 -0.7763274 -0.7764903 -0.7766528 [211] -0.7768146 -0.7769760 -0.7771368 -0.7772971 -0.7774569 -0.7776161 [217] -0.7777747 -0.7779329 -0.7780905 -0.7782476 -0.7784041 -0.7785601 [223] -0.7787155 -0.7788705 -0.7790248 -0.7791787 -0.7793320 -0.7794848 [229] -0.7796370 -0.7797887 -0.7799398 -0.7800904 -0.7802405 -0.7803900 [235] -0.7805390 -0.7806874 -0.7808353 -0.7809827 -0.7811295 -0.7812757 [241] -0.7814215 -0.7815666 -0.7817113 -0.7818554 -0.7819989 -0.7821419 [247] -0.7822844 -0.7824263 -0.7825676 -0.7827085 -0.7828487 -0.7829884 [253] -0.7831276 -0.7832663 -0.7834043 -0.7835419 -0.7836789 -0.7838153 [259] -0.7839512 -0.7840866 -0.7842213 -0.7843556 -0.7844893 -0.7846224 [265] -0.7847550 -0.7848871 -0.7850186 -0.7851495 -0.7852799 -0.7854098 [271] -0.7855391 -0.7856678 -0.7857960 -0.7859236 -0.7860507 -0.7861773 [277] -0.7863032 -0.7864287 -0.7865536 -0.7866779 -0.7868017 -0.7869249 [283] -0.7870475 -0.7871696 -0.7872912 -0.7874122 -0.7875326 -0.7876525 [289] -0.7877719 -0.7878907 -0.7880089 -0.7881266 -0.7882437 -0.7883602 [295] -0.7884762 -0.7885917 -0.7887066 -0.7888209 -0.7889347 -0.7890479 [301] -0.7891606 -0.7892727 -0.7893843 -0.7894952 -0.7896057 -0.7897156 [307] -0.7898249 -0.7899337 -0.7900419 -0.7901495 -0.7902566 -0.7903631 [313] -0.7904691 -0.7905745 -0.7906794 -0.7907837 -0.7908874 -0.7909906 [319] -0.7910932 -0.7911953 -0.7912968 -0.7913977 -0.7914981 -0.7915979 [325] -0.7916972 -0.7917959 -0.7918940 -0.7919916 -0.7920886 -0.7921851 [331] -0.7922810 -0.7923763 -0.7924711 -0.7925653 -0.7926590 -0.7927521 [337] -0.7928446 -0.7929366 -0.7930280 -0.7931189 -0.7932092 -0.7932989 [343] -0.7933881 -0.7934767 -0.7935647 -0.7936522 -0.7937392 -0.7938255 [349] -0.7939113 -0.7939966 -0.7940812 -0.7941654 -0.7942489 -0.7943319 [355] -0.7944143 -0.7944962 -0.7945775 -0.7946583 -0.7947385 -0.7948181 [361] -0.7948972 -0.7949757 -0.7950536 -0.7951310 -0.7952078 -0.7952840 [367] -0.7953597 -0.7954349 -0.7955094 -0.7955834 -0.7956569 -0.7957298 [373] -0.7958021 -0.7958739 -0.7959451 -0.7960157 -0.7960858 -0.7961553 [379] -0.7962242 -0.7962926 -0.7963604 -0.7964277 -0.7964944 -0.7965606 [385] -0.7966261 -0.7966912 -0.7967556 -0.7968195 -0.7968829 -0.7969456 [391] -0.7970079 -0.7970695 -0.7971306 -0.7971911 -0.7972511 -0.7973105 [397] -0.7973694 -0.7974277 -0.7974854 -0.7975426 -0.7975992 > 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/1mne31257364164.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/20dkp1257364164.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/3savu1257364164.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/49b5t1257364164.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/5pcei1257364164.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/6q4n11257364164.tab") > > system("convert tmp/1mne31257364164.ps tmp/1mne31257364164.png") > system("convert tmp/20dkp1257364164.ps tmp/20dkp1257364164.png") > system("convert tmp/3savu1257364164.ps tmp/3savu1257364164.png") > system("convert tmp/49b5t1257364164.ps tmp/49b5t1257364164.png") > system("convert tmp/5pcei1257364164.ps tmp/5pcei1257364164.png") > > > proc.time() user system elapsed 1.055 0.767 1.711