R version 2.7.2 (2008-08-25) 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(57.42,56.12,59.15,63.77,63.96,57.81,55.3,51.8,53.26,53.38,45.85,44.23,40.22,44.61,49.14,42.94,41.84,37.75,35.54,37.13,33.19,32.67,30.52,30.7,29.59,28.76,29.08,26.95,29.58,28.24,27.28,25.48,24.87,29.87,32.33,30.23,27.46,24.46,27.34,28.37,26.09,25.59,24.67,25.61,25.97,24.31,20.36,19.82,19.32,19.2,21.74,26.29,25.9,25.36,27.64,28.57,25.38,25.71,27.6,25.85,26.54) > #'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.7697012 -0.7703245 -0.7709456 -0.7715645 -0.7721811 -0.7727956 [7] -0.7734077 -0.7740177 -0.7746253 -0.7752307 -0.7758338 -0.7764346 [13] -0.7770331 -0.7776293 -0.7782232 -0.7788147 -0.7794039 -0.7799907 [19] -0.7805752 -0.7811573 -0.7817370 -0.7823144 -0.7828893 -0.7834618 [25] -0.7840319 -0.7845996 -0.7851648 -0.7857276 -0.7862879 -0.7868458 [31] -0.7874012 -0.7879541 -0.7885046 -0.7890525 -0.7895979 -0.7901409 [37] -0.7906813 -0.7912191 -0.7917545 -0.7922873 -0.7928175 -0.7933452 [43] -0.7938703 -0.7943928 -0.7949128 -0.7954302 -0.7959449 -0.7964571 [49] -0.7969667 -0.7974736 -0.7979780 -0.7984797 -0.7989787 -0.7994751 [55] -0.7999689 -0.8004600 -0.8009485 -0.8014343 -0.8019174 -0.8023978 [61] -0.8028756 -0.8033506 -0.8038230 -0.8042927 -0.8047596 -0.8052239 [67] -0.8056854 -0.8061442 -0.8066003 -0.8070537 -0.8075043 -0.8079522 [73] -0.8083973 -0.8088397 -0.8092793 -0.8097162 -0.8101503 -0.8105817 [79] -0.8110103 -0.8114361 -0.8118591 -0.8122793 -0.8126968 -0.8131115 [85] -0.8135234 -0.8139325 -0.8143388 -0.8147423 -0.8151430 -0.8155409 [91] -0.8159360 -0.8163282 -0.8167177 -0.8171043 -0.8174882 -0.8178692 [97] -0.8182474 -0.8186227 -0.8189953 -0.8193650 -0.8197319 -0.8200959 [103] -0.8204571 -0.8208155 -0.8211711 -0.8215238 -0.8218737 -0.8222207 [109] -0.8225649 -0.8229063 -0.8232448 -0.8235805 -0.8239134 -0.8242434 [115] -0.8245705 -0.8248949 -0.8252163 -0.8255350 -0.8258508 -0.8261637 [121] -0.8264738 -0.8267811 -0.8270855 -0.8273871 -0.8276859 -0.8279818 [127] -0.8282749 -0.8285651 -0.8288525 -0.8291371 -0.8294188 -0.8296977 [133] -0.8299738 -0.8302471 -0.8305175 -0.8307851 -0.8310499 -0.8313118 [139] -0.8315709 -0.8318272 -0.8320807 -0.8323314 -0.8325793 -0.8328244 [145] -0.8330666 -0.8333061 -0.8335427 -0.8337766 -0.8340076 -0.8342359 [151] -0.8344613 -0.8346840 -0.8349039 -0.8351210 -0.8353354 -0.8355469 [157] -0.8357557 -0.8359618 -0.8361650 -0.8363655 -0.8365633 -0.8367583 [163] -0.8369505 -0.8371400 -0.8373268 -0.8375108 -0.8376921 -0.8378706 [169] -0.8380465 -0.8382196 -0.8383900 -0.8385577 -0.8387227 -0.8388849 [175] -0.8390445 -0.8392014 -0.8393556 -0.8395071 -0.8396560 -0.8398021 [181] -0.8399457 -0.8400865 -0.8402247 -0.8403602 -0.8404931 -0.8406233 [187] -0.8407509 -0.8408759 -0.8409983 -0.8411180 -0.8412351 -0.8413496 [193] -0.8414615 -0.8415708 -0.8416776 -0.8417817 -0.8418833 -0.8419823 [199] -0.8420787 -0.8421725 -0.8422639 -0.8423526 -0.8424388 -0.8425225 [205] -0.8426037 -0.8426823 -0.8427584 -0.8428320 -0.8429032 -0.8429718 [211] -0.8430379 -0.8431015 -0.8431627 -0.8432214 -0.8432776 -0.8433314 [217] -0.8433828 -0.8434316 -0.8434781 -0.8435221 -0.8435637 -0.8436029 [223] -0.8436397 -0.8436741 -0.8437061 -0.8437358 -0.8437630 -0.8437879 [229] -0.8438104 -0.8438305 -0.8438484 -0.8438638 -0.8438770 -0.8438878 [235] -0.8438963 -0.8439025 -0.8439064 -0.8439079 -0.8439072 -0.8439043 [241] -0.8438990 -0.8438915 -0.8438818 -0.8438697 -0.8438555 -0.8438390 [247] -0.8438203 -0.8437994 -0.8437762 -0.8437509 -0.8437234 -0.8436936 [253] -0.8436618 -0.8436277 -0.8435915 -0.8435531 -0.8435126 -0.8434699 [259] -0.8434251 -0.8433782 -0.8433292 -0.8432781 -0.8432249 -0.8431696 [265] -0.8431122 -0.8430527 -0.8429912 -0.8429276 -0.8428620 -0.8427943 [271] -0.8427246 -0.8426529 -0.8425792 -0.8425034 -0.8424257 -0.8423459 [277] -0.8422642 -0.8421806 -0.8420949 -0.8420073 -0.8419177 -0.8418263 [283] -0.8417328 -0.8416375 -0.8415402 -0.8414410 -0.8413400 -0.8412370 [289] -0.8411322 -0.8410255 -0.8409169 -0.8408064 -0.8406942 -0.8405800 [295] -0.8404641 -0.8403463 -0.8402267 -0.8401053 -0.8399821 -0.8398571 [301] -0.8397303 -0.8396018 -0.8394715 -0.8393394 -0.8392056 -0.8390700 [307] -0.8389327 -0.8387937 -0.8386530 -0.8385105 -0.8383664 -0.8382205 [313] -0.8380730 -0.8379238 -0.8377730 -0.8376205 -0.8374663 -0.8373105 [319] -0.8371531 -0.8369940 -0.8368333 -0.8366710 -0.8365072 -0.8363417 [325] -0.8361746 -0.8360060 -0.8358358 -0.8356640 -0.8354907 -0.8353158 [331] -0.8351394 -0.8349615 -0.8347820 -0.8346011 -0.8344186 -0.8342346 [337] -0.8340492 -0.8338623 -0.8336739 -0.8334840 -0.8332927 -0.8330999 [343] -0.8329057 -0.8327101 -0.8325130 -0.8323145 -0.8321146 -0.8319134 [349] -0.8317107 -0.8315066 -0.8313012 -0.8310944 -0.8308862 -0.8306767 [355] -0.8304658 -0.8302536 -0.8300400 -0.8298252 -0.8296090 -0.8293915 [361] -0.8291727 -0.8289526 -0.8287312 -0.8285086 -0.8282847 -0.8280595 [367] -0.8278331 -0.8276054 -0.8273765 -0.8271463 -0.8269149 -0.8266823 [373] -0.8264485 -0.8262135 -0.8259773 -0.8257399 -0.8255013 -0.8252616 [379] -0.8250207 -0.8247786 -0.8245354 -0.8242910 -0.8240455 -0.8237989 [385] -0.8235511 -0.8233022 -0.8230522 -0.8228011 -0.8225489 -0.8222957 [391] -0.8220413 -0.8217859 -0.8215294 -0.8212718 -0.8210132 -0.8207535 [397] -0.8204928 -0.8202311 -0.8199684 -0.8197046 -0.8194398 > 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/1q8pe1226414674.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/2smaq1226414674.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/3dnlp1226414674.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/4mo7b1226414674.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/53l8a1226414674.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/67hre1226414674.tab") > > system("convert tmp/1q8pe1226414674.ps tmp/1q8pe1226414674.png") > system("convert tmp/2smaq1226414674.ps tmp/2smaq1226414674.png") > system("convert tmp/3dnlp1226414674.ps tmp/3dnlp1226414674.png") > system("convert tmp/4mo7b1226414674.ps tmp/4mo7b1226414674.png") > system("convert tmp/53l8a1226414674.ps tmp/53l8a1226414674.png") > > > proc.time() user system elapsed 1.280 0.787 1.528