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(10284.5,12792,12823.61538,13845.66667,15335.63636,11188.5,13633.25,12298.46667,15353.63636,12696.15385,12213.93333,13683.72727,11214.14286,13950.23077,11179.13333,11801.875,11188.82353,16456.27273,11110.0625,16530.69231,10038.41176,11681.25,11148.88235,8631,9386.444444,9764.736842,12043.75,12948.06667,10987.125,11648.3125,10633.35294,10219.3,9037.6,10296.31579,11705.41176,10681.94444,9362.947368,11306.35294,10984.45,10062.61905,8118.583333,8867.48,8346.72,8529.307692,10697.18182,8591.84,8695.607143,8125.571429,7009.758621,7883.466667,7527.645161,6763.758621,6682.333333,7855.681818,6738.88,7895.434783,6361.884615,6935.956522,8344.454545,9107.944444) > #'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.7582192 -0.7584043 -0.7585882 -0.7587709 -0.7589524 -0.7591326 [7] -0.7593116 -0.7594893 -0.7596658 -0.7598411 -0.7600151 -0.7601878 [13] -0.7603593 -0.7605295 -0.7606985 -0.7608661 -0.7610325 -0.7611976 [19] -0.7613614 -0.7615239 -0.7616851 -0.7618450 -0.7620036 -0.7621609 [25] -0.7623168 -0.7624714 -0.7626247 -0.7627767 -0.7629273 -0.7630765 [31] -0.7632244 -0.7633710 -0.7635162 -0.7636600 -0.7638025 -0.7639435 [37] -0.7640832 -0.7642216 -0.7643585 -0.7644940 -0.7646281 -0.7647609 [43] -0.7648922 -0.7650221 -0.7651506 -0.7652777 -0.7654033 -0.7655275 [49] -0.7656503 -0.7657716 -0.7658915 -0.7660099 -0.7661269 -0.7662424 [55] -0.7663564 -0.7664690 -0.7665801 -0.7666897 -0.7667979 -0.7669046 [61] -0.7670097 -0.7671134 -0.7672155 -0.7673162 -0.7674154 -0.7675130 [67] -0.7676091 -0.7677037 -0.7677968 -0.7678883 -0.7679783 -0.7680668 [73] -0.7681537 -0.7682390 -0.7683228 -0.7684051 -0.7684858 -0.7685649 [79] -0.7686424 -0.7687184 -0.7687928 -0.7688656 -0.7689368 -0.7690064 [85] -0.7690744 -0.7691409 -0.7692057 -0.7692689 -0.7693305 -0.7693905 [91] -0.7694488 -0.7695056 -0.7695607 -0.7696142 -0.7696660 -0.7697162 [97] -0.7697647 -0.7698116 -0.7698569 -0.7699005 -0.7699424 -0.7699826 [103] -0.7700212 -0.7700581 -0.7700934 -0.7701270 -0.7701588 -0.7701890 [109] -0.7702175 -0.7702443 -0.7702694 -0.7702928 -0.7703145 -0.7703345 [115] -0.7703528 -0.7703694 -0.7703842 -0.7703973 -0.7704087 -0.7704184 [121] -0.7704263 -0.7704325 -0.7704369 -0.7704396 -0.7704406 -0.7704398 [127] -0.7704373 -0.7704329 -0.7704269 -0.7704191 -0.7704095 -0.7703981 [133] -0.7703850 -0.7703700 -0.7703534 -0.7703349 -0.7703146 -0.7702926 [139] -0.7702687 -0.7702431 -0.7702157 -0.7701865 -0.7701554 -0.7701226 [145] -0.7700879 -0.7700515 -0.7700132 -0.7699731 -0.7699312 -0.7698875 [151] -0.7698420 -0.7697946 -0.7697454 -0.7696944 -0.7696415 -0.7695868 [157] -0.7695303 -0.7694719 -0.7694116 -0.7693496 -0.7692856 -0.7692199 [163] -0.7691523 -0.7690828 -0.7690114 -0.7689383 -0.7688632 -0.7687863 [169] -0.7687075 -0.7686268 -0.7685443 -0.7684599 -0.7683737 -0.7682855 [175] -0.7681955 -0.7681036 -0.7680099 -0.7679142 -0.7678167 -0.7677173 [181] -0.7676159 -0.7675128 -0.7674077 -0.7673007 -0.7671918 -0.7670811 [187] -0.7669684 -0.7668538 -0.7667374 -0.7666190 -0.7664988 -0.7663766 [193] -0.7662526 -0.7661266 -0.7659987 -0.7658690 -0.7657373 -0.7656037 [199] -0.7654682 -0.7653308 -0.7651915 -0.7650502 -0.7649071 -0.7647620 [205] -0.7646151 -0.7644662 -0.7643154 -0.7641627 -0.7640080 -0.7638515 [211] -0.7636930 -0.7635326 -0.7633703 -0.7632061 -0.7630399 -0.7628719 [217] -0.7627019 -0.7625300 -0.7623562 -0.7621804 -0.7620028 -0.7618232 [223] -0.7616417 -0.7614583 -0.7612729 -0.7610856 -0.7608965 -0.7607054 [229] -0.7605123 -0.7603174 -0.7601205 -0.7599218 -0.7597211 -0.7595184 [235] -0.7593139 -0.7591075 -0.7588991 -0.7586888 -0.7584766 -0.7582625 [241] -0.7580465 -0.7578285 -0.7576087 -0.7573869 -0.7571632 -0.7569377 [247] -0.7567102 -0.7564808 -0.7562495 -0.7560163 -0.7557811 -0.7555441 [253] -0.7553052 -0.7550644 -0.7548217 -0.7545771 -0.7543305 -0.7540821 [259] -0.7538318 -0.7535796 -0.7533255 -0.7530696 -0.7528117 -0.7525520 [265] -0.7522903 -0.7520268 -0.7517614 -0.7514942 -0.7512250 -0.7509540 [271] -0.7506811 -0.7504063 -0.7501297 -0.7498512 -0.7495708 -0.7492886 [277] -0.7490045 -0.7487185 -0.7484307 -0.7481411 -0.7478495 -0.7475562 [283] -0.7472610 -0.7469639 -0.7466650 -0.7463643 -0.7460617 -0.7457573 [289] -0.7454511 -0.7451430 -0.7448332 -0.7445215 -0.7442079 -0.7438926 [295] -0.7435754 -0.7432565 -0.7429357 -0.7426131 -0.7422887 -0.7419625 [301] -0.7416345 -0.7413048 -0.7409732 -0.7406399 -0.7403047 -0.7399678 [307] -0.7396292 -0.7392887 -0.7389465 -0.7386025 -0.7382567 -0.7379092 [313] -0.7375600 -0.7372089 -0.7368562 -0.7365017 -0.7361454 -0.7357874 [319] -0.7354277 -0.7350663 -0.7347031 -0.7343382 -0.7339716 -0.7336033 [325] -0.7332333 -0.7328616 -0.7324881 -0.7321130 -0.7317362 -0.7313577 [331] -0.7309775 -0.7305956 -0.7302121 -0.7298269 -0.7294400 -0.7290515 [337] -0.7286613 -0.7282694 -0.7278759 -0.7274808 -0.7270840 -0.7266856 [343] -0.7262855 -0.7258839 -0.7254806 -0.7250757 -0.7246692 -0.7242611 [349] -0.7238513 -0.7234400 -0.7230271 -0.7226126 -0.7221966 -0.7217789 [355] -0.7213597 -0.7209389 -0.7205166 -0.7200927 -0.7196672 -0.7192403 [361] -0.7188117 -0.7183817 -0.7179501 -0.7175169 -0.7170823 -0.7166462 [367] -0.7162085 -0.7157693 -0.7153287 -0.7148865 -0.7144429 -0.7139978 [373] -0.7135512 -0.7131031 -0.7126536 -0.7122026 -0.7117502 -0.7112963 [379] -0.7108410 -0.7103843 -0.7099261 -0.7094665 -0.7090054 -0.7085430 [385] -0.7080792 -0.7076139 -0.7071473 -0.7066793 -0.7062099 -0.7057391 [391] -0.7052669 -0.7047934 -0.7043185 -0.7038423 -0.7033647 -0.7028858 [397] -0.7024056 -0.7019240 -0.7014411 -0.7009569 -0.7004714 > 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/1shg61258117907.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/269f71258117907.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/32s5i1258117907.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/4ferl1258117907.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/5s6zv1258117907.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/6fen71258117907.tab") > > system("convert tmp/1shg61258117907.ps tmp/1shg61258117907.png") > system("convert tmp/269f71258117907.ps tmp/269f71258117907.png") > system("convert tmp/32s5i1258117907.ps tmp/32s5i1258117907.png") > system("convert tmp/4ferl1258117907.ps tmp/4ferl1258117907.png") > system("convert tmp/5s6zv1258117907.ps tmp/5s6zv1258117907.png") > > > proc.time() user system elapsed 1.057 0.765 1.538