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(124.06,124.58,122.00,124.02,124.16,124.29,123.93,124.62,121.81,124.14,124.31,125.15,125.35,125.48,124.17,125.33,124.46,123.39,123.14,122.24,119.31,120.87,120.43,119.41,118.85,119.08,117.25,118.51,118.42,118.56,117.97,117.98,115.25,117.23,117.08,116.83,117.17,117.73,115.74,116.99,116.90,116.49,115.84,115.92,113.32,114.84,114.75,114.84,115.03,115.03,112.99,114.15,113.77,113.57,113.38,112.71,110.27,111.73,112.12,112.31,111.73,111.83,109.99,111.15,111.25,110.87,110.27,110.18,108.15,109.60,109.60,109.41,109.80,109.60,107.76,109.02,108.62,109.02,109.22,108.92,106.69,107.76,107.66,107.85,107.95,107.85,106.30,107.37,107.66,107.46,107.37,107.18,105.43,106.39,106.50,106.50,106.69,106.50,105.14,106.50,106.20,105.72,104.76,104.55,102.71,104.36,104.65,104.46,104.65,103.88,102.32,103.39,103.00,102.71,102.51,102.04,100.00) > #'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.9688224 -0.9688080 -0.9687936 -0.9687791 -0.9687646 -0.9687500 [7] -0.9687353 -0.9687205 -0.9687057 -0.9686908 -0.9686759 -0.9686608 [13] -0.9686457 -0.9686305 -0.9686153 -0.9686000 -0.9685846 -0.9685691 [19] -0.9685536 -0.9685380 -0.9685223 -0.9685065 -0.9684907 -0.9684748 [25] -0.9684589 -0.9684429 -0.9684268 -0.9684106 -0.9683944 -0.9683781 [31] -0.9683617 -0.9683452 -0.9683287 -0.9683121 -0.9682955 -0.9682787 [37] -0.9682619 -0.9682451 -0.9682281 -0.9682111 -0.9681940 -0.9681769 [43] -0.9681597 -0.9681424 -0.9681250 -0.9681076 -0.9680901 -0.9680725 [49] -0.9680549 -0.9680372 -0.9680194 -0.9680015 -0.9679836 -0.9679656 [55] -0.9679476 -0.9679294 -0.9679112 -0.9678930 -0.9678746 -0.9678562 [61] -0.9678377 -0.9678192 -0.9678006 -0.9677819 -0.9677631 -0.9677443 [67] -0.9677254 -0.9677064 -0.9676874 -0.9676683 -0.9676491 -0.9676299 [73] -0.9676105 -0.9675911 -0.9675717 -0.9675522 -0.9675326 -0.9675129 [79] -0.9674932 -0.9674734 -0.9674535 -0.9674335 -0.9674135 -0.9673934 [85] -0.9673733 -0.9673531 -0.9673328 -0.9673124 -0.9672920 -0.9672715 [91] -0.9672509 -0.9672303 -0.9672096 -0.9671888 -0.9671680 -0.9671470 [97] -0.9671261 -0.9671050 -0.9670839 -0.9670627 -0.9670414 -0.9670201 [103] -0.9669987 -0.9669772 -0.9669557 -0.9669341 -0.9669124 -0.9668907 [109] -0.9668688 -0.9668470 -0.9668250 -0.9668030 -0.9667809 -0.9667587 [115] -0.9667365 -0.9667142 -0.9666918 -0.9666694 -0.9666469 -0.9666243 [121] -0.9666017 -0.9665790 -0.9665562 -0.9665334 -0.9665104 -0.9664875 [127] -0.9664644 -0.9664413 -0.9664181 -0.9663948 -0.9663715 -0.9663481 [133] -0.9663246 -0.9663011 -0.9662775 -0.9662538 -0.9662301 -0.9662063 [139] -0.9661824 -0.9661585 -0.9661344 -0.9661104 -0.9660862 -0.9660620 [145] -0.9660377 -0.9660134 -0.9659889 -0.9659644 -0.9659399 -0.9659152 [151] -0.9658906 -0.9658658 -0.9658410 -0.9658161 -0.9657911 -0.9657660 [157] -0.9657409 -0.9657158 -0.9656905 -0.9656652 -0.9656398 -0.9656144 [163] -0.9655889 -0.9655633 -0.9655377 -0.9655119 -0.9654862 -0.9654603 [169] -0.9654344 -0.9654084 -0.9653823 -0.9653562 -0.9653300 -0.9653038 [175] -0.9652774 -0.9652510 -0.9652246 -0.9651980 -0.9651715 -0.9651448 [181] -0.9651181 -0.9650913 -0.9650644 -0.9650375 -0.9650105 -0.9649834 [187] -0.9649562 -0.9649290 -0.9649018 -0.9648744 -0.9648470 -0.9648196 [193] -0.9647920 -0.9647644 -0.9647367 -0.9647090 -0.9646812 -0.9646533 [199] -0.9646254 -0.9645973 -0.9645693 -0.9645411 -0.9645129 -0.9644846 [205] -0.9644563 -0.9644279 -0.9643994 -0.9643708 -0.9643422 -0.9643136 [211] -0.9642848 -0.9642560 -0.9642271 -0.9641982 -0.9641692 -0.9641401 [217] -0.9641109 -0.9640817 -0.9640524 -0.9640231 -0.9639937 -0.9639642 [223] -0.9639346 -0.9639050 -0.9638753 -0.9638456 -0.9638158 -0.9637859 [229] -0.9637560 -0.9637260 -0.9636959 -0.9636657 -0.9636355 -0.9636052 [235] -0.9635749 -0.9635445 -0.9635140 -0.9634835 -0.9634529 -0.9634222 [241] -0.9633915 -0.9633606 -0.9633298 -0.9632988 -0.9632678 -0.9632368 [247] -0.9632056 -0.9631744 -0.9631432 -0.9631118 -0.9630804 -0.9630490 [253] -0.9630174 -0.9629858 -0.9629542 -0.9629225 -0.9628907 -0.9628588 [259] -0.9628269 -0.9627949 -0.9627628 -0.9627307 -0.9626985 -0.9626663 [265] -0.9626340 -0.9626016 -0.9625691 -0.9625366 -0.9625041 -0.9624714 [271] -0.9624387 -0.9624059 -0.9623731 -0.9623402 -0.9623072 -0.9622742 [277] -0.9622411 -0.9622079 -0.9621747 -0.9621414 -0.9621080 -0.9620746 [283] -0.9620411 -0.9620076 -0.9619740 -0.9619403 -0.9619065 -0.9618727 [289] -0.9618389 -0.9618049 -0.9617709 -0.9617368 -0.9617027 -0.9616685 [295] -0.9616342 -0.9615999 -0.9615655 -0.9615311 -0.9614965 -0.9614620 [301] -0.9614273 -0.9613926 -0.9613578 -0.9613230 -0.9612881 -0.9612531 [307] -0.9612181 -0.9611830 -0.9611478 -0.9611126 -0.9610773 -0.9610419 [313] -0.9610065 -0.9609710 -0.9609355 -0.9608999 -0.9608642 -0.9608284 [319] -0.9607926 -0.9607568 -0.9607208 -0.9606848 -0.9606488 -0.9606127 [325] -0.9605765 -0.9605402 -0.9605039 -0.9604675 -0.9604311 -0.9603946 [331] -0.9603580 -0.9603214 -0.9602847 -0.9602480 -0.9602111 -0.9601743 [337] -0.9601373 -0.9601003 -0.9600632 -0.9600261 -0.9599889 -0.9599516 [343] -0.9599143 -0.9598769 -0.9598395 -0.9598020 -0.9597644 -0.9597268 [349] -0.9596891 -0.9596513 -0.9596135 -0.9595756 -0.9595376 -0.9594996 [355] -0.9594615 -0.9594234 -0.9593852 -0.9593469 -0.9593086 -0.9592702 [361] -0.9592318 -0.9591932 -0.9591547 -0.9591160 -0.9590773 -0.9590386 [367] -0.9589997 -0.9589608 -0.9589219 -0.9588829 -0.9588438 -0.9588047 [373] -0.9587655 -0.9587262 -0.9586869 -0.9586475 -0.9586081 -0.9585685 [379] -0.9585290 -0.9584893 -0.9584496 -0.9584099 -0.9583701 -0.9583302 [385] -0.9582903 -0.9582503 -0.9582102 -0.9581701 -0.9581299 -0.9580896 [391] -0.9580493 -0.9580090 -0.9579685 -0.9579280 -0.9578875 -0.9578469 [397] -0.9578062 -0.9577654 -0.9577246 -0.9576838 -0.9576429 > 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/1icx91257771756.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/2wbjp1257771756.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/3bymo1257771756.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/4ccml1257771756.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/5ir9o1257771756.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/6rq161257771756.tab") > > system("convert tmp/1icx91257771756.ps tmp/1icx91257771756.png") > system("convert tmp/2wbjp1257771756.ps tmp/2wbjp1257771756.png") > system("convert tmp/3bymo1257771756.ps tmp/3bymo1257771756.png") > system("convert tmp/4ccml1257771756.ps tmp/4ccml1257771756.png") > system("convert tmp/5ir9o1257771756.ps tmp/5ir9o1257771756.png") > > > proc.time() user system elapsed 1.123 0.830 1.407