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(0.5857,0.5858,0.5717,0.5945,0.5961,0.5973,0.6036,0.6096,0.6315,0.6262,0.6121,0.6326,0.6214,0.6274,0.6175,0.6208,0.6225,0.5889,0.6020,0.5932,0.5841,0.6000,0.5947,0.5891,0.6051,0.5960,0.6012,0.5957,0.5959,0.6049,0.6064,0.6137,0.6311,0.6258,0.6010,0.6232,0.6384,0.6014,0.5980,0.5987,0.6237,0.5813,0.5991,0.6160,0.6096,0.6051,0.5857,0.5565,0.5223,0.5091,0.4919,0.4995,0.5069,0.5190,0.5460,0.5648,0.5751,0.5862,0.5877) > #'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.4509982 -0.4510066 -0.4510148 -0.4510230 -0.4510311 -0.4510392 [7] -0.4510471 -0.4510550 -0.4510628 -0.4510705 -0.4510781 -0.4510857 [13] -0.4510932 -0.4511006 -0.4511079 -0.4511152 -0.4511224 -0.4511295 [19] -0.4511365 -0.4511434 -0.4511503 -0.4511571 -0.4511638 -0.4511704 [25] -0.4511770 -0.4511834 -0.4511898 -0.4511962 -0.4512024 -0.4512086 [31] -0.4512146 -0.4512207 -0.4512266 -0.4512324 -0.4512382 -0.4512439 [37] -0.4512495 -0.4512551 -0.4512605 -0.4512659 -0.4512712 -0.4512764 [43] -0.4512816 -0.4512866 -0.4512916 -0.4512965 -0.4513013 -0.4513061 [49] -0.4513108 -0.4513153 -0.4513199 -0.4513243 -0.4513286 -0.4513329 [55] -0.4513371 -0.4513412 -0.4513453 -0.4513492 -0.4513531 -0.4513569 [61] -0.4513606 -0.4513643 -0.4513678 -0.4513713 -0.4513747 -0.4513780 [67] -0.4513813 -0.4513844 -0.4513875 -0.4513905 -0.4513934 -0.4513963 [73] -0.4513990 -0.4514017 -0.4514043 -0.4514068 -0.4514093 -0.4514116 [79] -0.4514139 -0.4514161 -0.4514182 -0.4514203 -0.4514222 -0.4514241 [85] -0.4514259 -0.4514276 -0.4514293 -0.4514308 -0.4514323 -0.4514337 [91] -0.4514350 -0.4514363 -0.4514374 -0.4514385 -0.4514395 -0.4514404 [97] -0.4514412 -0.4514420 -0.4514427 -0.4514433 -0.4514438 -0.4514442 [103] -0.4514445 -0.4514448 -0.4514450 -0.4514451 -0.4514451 -0.4514451 [109] -0.4514449 -0.4514447 -0.4514444 -0.4514440 -0.4514436 -0.4514430 [115] -0.4514424 -0.4514417 -0.4514409 -0.4514400 -0.4514391 -0.4514380 [121] -0.4514369 -0.4514357 -0.4514345 -0.4514331 -0.4514316 -0.4514301 [127] -0.4514285 -0.4514268 -0.4514251 -0.4514232 -0.4514213 -0.4514193 [133] -0.4514172 -0.4514150 -0.4514127 -0.4514104 -0.4514080 -0.4514055 [139] -0.4514029 -0.4514002 -0.4513975 -0.4513946 -0.4513917 -0.4513887 [145] -0.4513856 -0.4513825 -0.4513792 -0.4513759 -0.4513725 -0.4513690 [151] -0.4513654 -0.4513618 -0.4513580 -0.4513542 -0.4513503 -0.4513463 [157] -0.4513422 -0.4513381 -0.4513338 -0.4513295 -0.4513251 -0.4513206 [163] -0.4513161 -0.4513114 -0.4513067 -0.4513019 -0.4512970 -0.4512920 [169] -0.4512870 -0.4512818 -0.4512766 -0.4512713 -0.4512659 -0.4512604 [175] -0.4512548 -0.4512492 -0.4512435 -0.4512377 -0.4512318 -0.4512258 [181] -0.4512197 -0.4512136 -0.4512074 -0.4512011 -0.4511947 -0.4511882 [187] -0.4511817 -0.4511750 -0.4511683 -0.4511615 -0.4511546 -0.4511476 [193] -0.4511406 -0.4511334 -0.4511262 -0.4511189 -0.4511115 -0.4511041 [199] -0.4510965 -0.4510889 -0.4510811 -0.4510733 -0.4510655 -0.4510575 [205] -0.4510494 -0.4510413 -0.4510331 -0.4510248 -0.4510164 -0.4510079 [211] -0.4509993 -0.4509907 -0.4509820 -0.4509732 -0.4509643 -0.4509553 [217] -0.4509462 -0.4509371 -0.4509279 -0.4509186 -0.4509092 -0.4508997 [223] -0.4508901 -0.4508805 -0.4508708 -0.4508610 -0.4508511 -0.4508411 [229] -0.4508310 -0.4508209 -0.4508106 -0.4508003 -0.4507899 -0.4507794 [235] -0.4507689 -0.4507582 -0.4507475 -0.4507367 -0.4507258 -0.4507148 [241] -0.4507037 -0.4506926 -0.4506813 -0.4506700 -0.4506586 -0.4506471 [247] -0.4506355 -0.4506239 -0.4506121 -0.4506003 -0.4505884 -0.4505764 [253] -0.4505643 -0.4505522 -0.4505399 -0.4505276 -0.4505152 -0.4505027 [259] -0.4504901 -0.4504774 -0.4504647 -0.4504518 -0.4504389 -0.4504259 [265] -0.4504128 -0.4503997 -0.4503864 -0.4503731 -0.4503596 -0.4503461 [271] -0.4503325 -0.4503189 -0.4503051 -0.4502913 -0.4502773 -0.4502633 [277] -0.4502492 -0.4502350 -0.4502208 -0.4502064 -0.4501920 -0.4501775 [283] -0.4501629 -0.4501482 -0.4501334 -0.4501186 -0.4501036 -0.4500886 [289] -0.4500735 -0.4500583 -0.4500430 -0.4500277 -0.4500122 -0.4499967 [295] -0.4499811 -0.4499654 -0.4499496 -0.4499337 -0.4499178 -0.4499017 [301] -0.4498856 -0.4498694 -0.4498531 -0.4498368 -0.4498203 -0.4498038 [307] -0.4497872 -0.4497704 -0.4497537 -0.4497368 -0.4497198 -0.4497028 [313] -0.4496856 -0.4496684 -0.4496511 -0.4496338 -0.4496163 -0.4495987 [319] -0.4495811 -0.4495634 -0.4495456 -0.4495277 -0.4495097 -0.4494917 [325] -0.4494735 -0.4494553 -0.4494370 -0.4494186 -0.4494001 -0.4493816 [331] -0.4493629 -0.4493442 -0.4493254 -0.4493065 -0.4492875 -0.4492685 [337] -0.4492493 -0.4492301 -0.4492108 -0.4491914 -0.4491719 -0.4491523 [343] -0.4491327 -0.4491129 -0.4490931 -0.4490732 -0.4490532 -0.4490331 [349] -0.4490130 -0.4489927 -0.4489724 -0.4489520 -0.4489315 -0.4489109 [355] -0.4488903 -0.4488695 -0.4488487 -0.4488278 -0.4488068 -0.4487857 [361] -0.4487646 -0.4487433 -0.4487220 -0.4487006 -0.4486791 -0.4486575 [367] -0.4486358 -0.4486141 -0.4485922 -0.4485703 -0.4485483 -0.4485262 [373] -0.4485041 -0.4484818 -0.4484595 -0.4484371 -0.4484146 -0.4483920 [379] -0.4483693 -0.4483466 -0.4483237 -0.4483008 -0.4482778 -0.4482547 [385] -0.4482315 -0.4482083 -0.4481850 -0.4481615 -0.4481380 -0.4481144 [391] -0.4480908 -0.4480670 -0.4480432 -0.4480193 -0.4479952 -0.4479712 [397] -0.4479470 -0.4479227 -0.4478984 -0.4478740 -0.4478495 > 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/1dxgg1257454638.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/2x0kq1257454638.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/3fw5f1257454638.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/4xup71257454638.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/5t9qu1257454638.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/633y91257454638.tab") > > system("convert tmp/1dxgg1257454638.ps tmp/1dxgg1257454638.png") > system("convert tmp/2x0kq1257454638.ps tmp/2x0kq1257454638.png") > system("convert tmp/3fw5f1257454638.ps tmp/3fw5f1257454638.png") > system("convert tmp/4xup71257454638.ps tmp/4xup71257454638.png") > system("convert tmp/5t9qu1257454638.ps tmp/5t9qu1257454638.png") > > > proc.time() user system elapsed 1.158 0.839 8.866