R version 2.8.0 (2008-10-20) 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(3884.2,3868.9,2224.9,2091.1,2462.5,2671.5,3171.8,2481.5,2731.6,3247.5,4005.7,2416.4,3673.2,3952.1,3277,2447.2,3361.2,3235.2,3573.6,3466.9,3689.8,3593.5,4282.7,2429.6,3971.6,3773.8,3400.8,1589.8,2799.8,2960.2,3177.2,3437.1,3765.4,3775.6,4082.6,2345.8,4167.6,3583.1,3391.7,2473.5,2923.4,3162.8,3211.4,3493.3,3633.2,2843.9,3915.8,1968.2,3693.6,3701.3,3305.6,2335.2,2827.3,2723.7,3175.8,3449.7,3204.4,2765.6,3706,1941.8,3566.8,3477.8,2707.1,1519.3,1913.6,2475.7,2082.5,2604.7,3249.5,3342.3,3676,1769.7,3411.6,3162.1,3039.1,2264,2786.9,2997.4,3412,3019.4,2760.1,3445.2,2912.7,2445.8,3092.8,2679.9,1951.4,814.2,459,1451.3,791.6,949.3,849.8,1588.7) > #'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.3680023 -0.3689408 -0.3698803 -0.3708207 -0.3717619 -0.3727039 [7] -0.3736467 -0.3745902 -0.3755343 -0.3764789 -0.3774241 -0.3783697 [13] -0.3793158 -0.3802622 -0.3812088 -0.3821557 -0.3831027 -0.3840499 [19] -0.3849970 -0.3859442 -0.3868912 -0.3878381 -0.3887848 -0.3897312 [25] -0.3906772 -0.3916228 -0.3925680 -0.3935126 -0.3944566 -0.3953998 [31] -0.3963424 -0.3972841 -0.3982249 -0.3991647 -0.4001035 -0.4010413 [37] -0.4019778 -0.4029131 -0.4038470 -0.4047796 -0.4057107 -0.4066403 [43] -0.4075682 -0.4084945 -0.4094190 -0.4103416 -0.4112624 -0.4121811 [49] -0.4130978 -0.4140124 -0.4149248 -0.4158348 -0.4167425 -0.4176478 [55] -0.4185505 -0.4194507 -0.4203481 -0.4212429 -0.4221348 -0.4230238 [61] -0.4239098 -0.4247928 -0.4256726 -0.4265492 -0.4274226 -0.4282926 [67] -0.4291591 -0.4300221 -0.4308816 -0.4317374 -0.4325894 -0.4334376 [73] -0.4342819 -0.4351223 -0.4359586 -0.4367908 -0.4376188 -0.4384426 [79] -0.4392620 -0.4400769 -0.4408875 -0.4416934 -0.4424947 -0.4432913 [85] -0.4440832 -0.4448702 -0.4456523 -0.4464294 -0.4472014 -0.4479684 [91] -0.4487301 -0.4494866 -0.4502378 -0.4509836 -0.4517239 -0.4524588 [97] -0.4531880 -0.4539116 -0.4546295 -0.4553417 -0.4560480 -0.4567485 [103] -0.4574430 -0.4581315 -0.4588140 -0.4594903 -0.4601605 -0.4608245 [109] -0.4614821 -0.4621335 -0.4627785 -0.4634171 -0.4640492 -0.4646748 [115] -0.4652938 -0.4659062 -0.4665119 -0.4671109 -0.4677032 -0.4682888 [121] -0.4688674 -0.4694393 -0.4700042 -0.4705622 -0.4711132 -0.4716572 [127] -0.4721941 -0.4727240 -0.4732468 -0.4737625 -0.4742710 -0.4747723 [133] -0.4752664 -0.4757533 -0.4762329 -0.4767052 -0.4771702 -0.4776279 [139] -0.4780783 -0.4785213 -0.4789569 -0.4793852 -0.4798060 -0.4802194 [145] -0.4806255 -0.4810241 -0.4814152 -0.4817989 -0.4821752 -0.4825440 [151] -0.4829054 -0.4832592 -0.4836057 -0.4839447 -0.4842762 -0.4846003 [157] -0.4849169 -0.4852261 -0.4855279 -0.4858222 -0.4861092 -0.4863887 [163] -0.4866608 -0.4869256 -0.4871830 -0.4874330 -0.4876757 -0.4879111 [169] -0.4881392 -0.4883601 -0.4885736 -0.4887800 -0.4889791 -0.4891710 [175] -0.4893558 -0.4895335 -0.4897040 -0.4898675 -0.4900239 -0.4901733 [181] -0.4903157 -0.4904512 -0.4905797 -0.4907014 -0.4908162 -0.4909241 [187] -0.4910253 -0.4911198 -0.4912075 -0.4912886 -0.4913630 -0.4914309 [193] -0.4914922 -0.4915470 -0.4915954 -0.4916373 -0.4916728 -0.4917020 [199] -0.4917250 -0.4917417 -0.4917522 -0.4917565 -0.4917548 -0.4917470 [205] -0.4917332 -0.4917134 -0.4916877 -0.4916562 -0.4916189 -0.4915758 [211] -0.4915271 -0.4914727 -0.4914126 -0.4913471 -0.4912760 -0.4911995 [217] -0.4911176 -0.4910304 -0.4909379 -0.4908402 -0.4907373 -0.4906293 [223] -0.4905163 -0.4903982 -0.4902752 -0.4901473 -0.4900145 -0.4898770 [229] -0.4897348 -0.4895878 -0.4894363 -0.4892802 -0.4891196 -0.4889545 [235] -0.4887850 -0.4886113 -0.4884332 -0.4882509 -0.4880644 -0.4878739 [241] -0.4876792 -0.4874806 -0.4872780 -0.4870716 -0.4868613 -0.4866472 [247] -0.4864294 -0.4862080 -0.4859829 -0.4857542 -0.4855221 -0.4852865 [253] -0.4850475 -0.4848052 -0.4845596 -0.4843108 -0.4840588 -0.4838036 [259] -0.4835454 -0.4832842 -0.4830200 -0.4827528 -0.4824828 -0.4822100 [265] -0.4819345 -0.4816562 -0.4813753 -0.4810917 -0.4808056 -0.4805170 [271] -0.4802259 -0.4799324 -0.4796366 -0.4793384 -0.4790380 -0.4787353 [277] -0.4784305 -0.4781235 -0.4778145 -0.4775034 -0.4771904 -0.4768754 [283] -0.4765585 -0.4762397 -0.4759192 -0.4755968 -0.4752728 -0.4749471 [289] -0.4746197 -0.4742907 -0.4739602 -0.4736282 -0.4732947 -0.4729598 [295] -0.4726235 -0.4722858 -0.4719469 -0.4716066 -0.4712652 -0.4709225 [301] -0.4705787 -0.4702337 -0.4698877 -0.4695406 -0.4691925 -0.4688435 [307] -0.4684934 -0.4681425 -0.4677908 -0.4674381 -0.4670847 -0.4667305 [313] -0.4663756 -0.4660199 -0.4656636 -0.4653067 -0.4649491 -0.4645910 [319] -0.4642323 -0.4638730 -0.4635133 -0.4631532 -0.4627926 -0.4624315 [325] -0.4620702 -0.4617084 -0.4613463 -0.4609840 -0.4606214 -0.4602585 [331] -0.4598954 -0.4595321 -0.4591686 -0.4588050 -0.4584413 -0.4580775 [337] -0.4577136 -0.4573497 -0.4569857 -0.4566217 -0.4562578 -0.4558939 [343] -0.4555300 -0.4551662 -0.4548025 -0.4544390 -0.4540756 -0.4537123 [349] -0.4533492 -0.4529864 -0.4526237 -0.4522613 -0.4518991 -0.4515372 [355] -0.4511756 -0.4508143 -0.4504533 -0.4500926 -0.4497323 -0.4493724 [361] -0.4490129 -0.4486537 -0.4482950 -0.4479367 -0.4475788 -0.4472214 [367] -0.4468645 -0.4465081 -0.4461521 -0.4457967 -0.4454418 -0.4450874 [373] -0.4447336 -0.4443803 -0.4440277 -0.4436756 -0.4433240 -0.4429731 [379] -0.4426228 -0.4422732 -0.4419242 -0.4415758 -0.4412281 -0.4408810 [385] -0.4405346 -0.4401889 -0.4398439 -0.4394996 -0.4391560 -0.4388132 [391] -0.4384710 -0.4381296 -0.4377889 -0.4374490 -0.4371099 -0.4367715 [397] -0.4364338 -0.4360970 -0.4357609 -0.4354256 -0.4350912 > 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/1mxu31229903865.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/224tu1229903865.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/3kime1229903865.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/4l1hz1229903865.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/5wg3s1229903865.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/6hbul1229903865.tab") > > system("convert tmp/1mxu31229903865.ps tmp/1mxu31229903865.png") > system("convert tmp/224tu1229903865.ps tmp/224tu1229903865.png") > system("convert tmp/3kime1229903865.ps tmp/3kime1229903865.png") > system("convert tmp/4l1hz1229903865.ps tmp/4l1hz1229903865.png") > system("convert tmp/5wg3s1229903865.ps tmp/5wg3s1229903865.png") > > > proc.time() user system elapsed 1.079 0.791 1.459