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(90.2 + ,90 + ,88.8 + ,85.8 + ,84.2 + ,80 + ,77.8 + ,76.8 + ,86.4 + ,89.2 + ,86.2 + ,84.6 + ,83.2 + ,83.2 + ,82.6 + ,79.8 + ,77.2 + ,74.8 + ,73 + ,73 + ,83.6 + ,85.6 + ,84.8 + ,84.2 + ,83.4 + ,84.6 + ,84.6 + ,83.8 + ,81.2 + ,79.6 + ,78 + ,78.2 + ,88.8 + ,92 + ,91 + ,91.2 + ,90.4 + ,91.8 + ,92.2 + ,90.2 + ,88.6 + ,87.8 + ,86 + ,87.2 + ,97.6 + ,101.2 + ,100.4 + ,100.2 + ,100.2 + ,103 + ,104.2 + ,104 + ,102.4 + ,101.8 + ,101 + ,102.2 + ,114 + ,118.4 + ,118.8 + ,117.2 + ,117.2 + ,118.4 + ,118.8 + ,117.2 + ,114.4 + ,112.6 + ,111 + ,110.8 + ,120.2 + ,124.4 + ,123.4 + ,121.2 + ,119 + ,119.8 + ,120 + ,118.4 + ,115 + ,113.4 + ,111 + ,111 + ,121.6 + ,126.2 + ,125.8 + ,124.8 + ,122 + ,123.2 + ,124.2 + ,120.8 + ,116.8 + ,114.8 + ,111 + ,109 + ,119.8 + ,124 + ,121.6 + ,118 + ,115.8 + ,116 + ,115.8 + ,114.4 + ,112 + ,110.2 + ,107.4 + ,108.2 + ,117.6 + ,121.4 + ,119.8 + ,115.6 + ,112.6 + ,113.2 + ,112.2 + ,110.8 + ,108 + ,105.2 + ,102.4 + ,101 + ,110.8 + ,116.8 + ,113.8 + ,108 + ,104.4 + ,105.2 + ,105.4 + ,103.2 + ,100.6 + ,97.8 + ,95.8 + ,95 + ,104.8 + ,110.4 + ,106.4 + ,102.2 + ,98.4 + ,98.4 + ,98.6 + ,96.2 + ,92.4 + ,91.4 + ,88.4 + ,87.8 + ,97.6 + ,104.2 + ,100.2 + ,97 + ,92.8 + ,92 + ,93.4 + ,92 + ,89.6 + ,88.6 + ,87.2 + ,86.2 + ,96.8 + ,102 + ,102.6 + ,100.6 + ,94.2 + ,94.2 + ,95.2 + ,95 + ,94 + ,92.2 + ,91 + ,91.2 + ,103.4 + ,105 + ,104.6 + ,103.8 + ,101.8 + ,102.4 + ,103.8 + ,103.4 + ,102 + ,101.8 + ,100.2 + ,101.4 + ,113.8 + ,116 + ,115.6 + ,113 + ,109.4 + ,111 + ,112.4 + ,112.2 + ,111 + ,108.8 + ,107.4 + ,108.6 + ,118.8 + ,122.2 + ,122.6 + ,122.2 + ,118.8 + ,119 + ,118.2 + ,117.8 + ,116.8 + ,114.6 + ,113.4 + ,113.8 + ,124.2 + ,125.8 + ,125.6 + ,122.4 + ,119 + ,119.4 + ,118.6 + ,118 + ,116 + ,114.8 + ,114.6 + ,114.6 + ,124 + ,125.2 + ,124 + ,117.6 + ,113.2 + ,111.4 + ,112.2 + ,109.8 + ,106.4 + ,105.2 + ,102.2 + ,99.8 + ,111 + ,113 + ,108.4 + ,105.4 + ,102 + ,102.8 + ,103.4 + ,101.6 + ,98.6 + ,98 + ,93.8 + ,95.6 + ,105.6 + ,106.8 + ,103.6 + ,101.2 + ,100.4 + ,103.2 + ,105.6 + ,106.6 + ,107.2 + ,107.4 + ,104.8 + ,107.2 + ,117.4 + ,119.4 + ,116.2 + ,112.8 + ,111.6) > #'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.5137554 0.5135973 0.5134389 0.5132800 0.5131207 0.5129610 0.5128008 [8] 0.5126402 0.5124791 0.5123177 0.5121558 0.5119935 0.5118307 0.5116675 [15] 0.5115039 0.5113399 0.5111755 0.5110106 0.5108453 0.5106796 0.5105134 [22] 0.5103469 0.5101799 0.5100125 0.5098447 0.5096765 0.5095078 0.5093387 [29] 0.5091692 0.5089993 0.5088290 0.5086583 0.5084871 0.5083156 0.5081436 [36] 0.5079712 0.5077984 0.5076252 0.5074516 0.5072776 0.5071032 0.5069284 [43] 0.5067531 0.5065775 0.5064014 0.5062250 0.5060481 0.5058708 0.5056932 [50] 0.5055151 0.5053367 0.5051578 0.5049785 0.5047989 0.5046188 0.5044383 [57] 0.5042575 0.5040762 0.5038946 0.5037126 0.5035301 0.5033473 0.5031641 [64] 0.5029805 0.5027965 0.5026121 0.5024273 0.5022422 0.5020566 0.5018707 [71] 0.5016844 0.5014977 0.5013106 0.5011231 0.5009353 0.5007470 0.5005584 [78] 0.5003694 0.5001800 0.4999903 0.4998002 0.4996096 0.4994188 0.4992275 [85] 0.4990359 0.4988439 0.4986515 0.4984587 0.4982656 0.4980721 0.4978782 [92] 0.4976840 0.4974894 0.4972944 0.4970991 0.4969034 0.4967073 0.4965109 [99] 0.4963141 0.4961169 0.4959194 0.4957215 0.4955233 0.4953247 0.4951257 [106] 0.4949264 0.4947267 0.4945267 0.4943263 0.4941256 0.4939245 0.4937231 [113] 0.4935213 0.4933191 0.4931166 0.4929138 0.4927106 0.4925070 0.4923031 [120] 0.4920989 0.4918943 0.4916894 0.4914841 0.4912785 0.4910726 0.4908663 [127] 0.4906597 0.4904527 0.4902454 0.4900377 0.4898297 0.4896214 0.4894128 [134] 0.4892038 0.4889945 0.4887848 0.4885748 0.4883645 0.4881539 0.4879429 [141] 0.4877316 0.4875200 0.4873080 0.4870957 0.4868831 0.4866702 0.4864569 [148] 0.4862434 0.4860295 0.4858153 0.4856007 0.4853859 0.4851707 0.4849552 [155] 0.4847394 0.4845233 0.4843069 0.4840902 0.4838731 0.4836557 0.4834381 [162] 0.4832201 0.4830018 0.4827832 0.4825643 0.4823451 0.4821255 0.4819057 [169] 0.4816856 0.4814652 0.4812444 0.4810234 0.4808021 0.4805805 0.4803585 [176] 0.4801363 0.4799138 0.4796910 0.4794679 0.4792445 0.4790208 0.4787968 [183] 0.4785725 0.4783480 0.4781231 0.4778980 0.4776725 0.4774468 0.4772208 [190] 0.4769945 0.4767680 0.4765411 0.4763140 0.4760866 0.4758589 0.4756309 [197] 0.4754027 0.4751741 0.4749453 0.4747163 0.4744869 0.4742573 0.4740274 [204] 0.4737972 0.4735668 0.4733361 0.4731051 0.4728739 0.4726424 0.4724106 [211] 0.4721786 0.4719463 0.4717137 0.4714809 0.4712478 0.4710144 0.4707808 [218] 0.4705469 0.4703128 0.4700784 0.4698438 0.4696089 0.4693738 0.4691384 [225] 0.4689027 0.4686668 0.4684307 0.4681943 0.4679576 0.4677207 0.4674836 [232] 0.4672462 0.4670085 0.4667707 0.4665325 0.4662942 0.4660556 0.4658167 [239] 0.4655777 0.4653383 0.4650988 0.4648590 0.4646190 0.4643787 0.4641382 [246] 0.4638975 0.4636565 0.4634153 0.4631739 0.4629323 0.4626904 0.4624483 [253] 0.4622059 0.4619634 0.4617206 0.4614776 0.4612344 0.4609909 0.4607473 [260] 0.4605034 0.4602593 0.4600150 0.4597704 0.4595257 0.4592807 0.4590355 [267] 0.4587901 0.4585445 0.4582987 0.4580527 0.4578064 0.4575600 0.4573133 [274] 0.4570665 0.4568194 0.4565721 0.4563247 0.4560770 0.4558291 0.4555810 [281] 0.4553327 0.4550843 0.4548356 0.4545867 0.4543376 0.4540884 0.4538389 [288] 0.4535893 0.4533394 0.4530894 0.4528392 0.4525887 0.4523381 0.4520873 [295] 0.4518364 0.4515852 0.4513338 0.4510823 0.4508306 0.4505787 0.4503266 [302] 0.4500743 0.4498219 0.4495693 0.4493165 0.4490635 0.4488103 0.4485570 [309] 0.4483035 0.4480498 0.4477960 0.4475420 0.4472878 0.4470334 0.4467789 [316] 0.4465242 0.4462693 0.4460143 0.4457591 0.4455038 0.4452482 0.4449926 [323] 0.4447367 0.4444807 0.4442246 0.4439682 0.4437118 0.4434551 0.4431983 [330] 0.4429414 0.4426843 0.4424270 0.4421696 0.4419121 0.4416544 0.4413965 [337] 0.4411385 0.4408803 0.4406220 0.4403636 0.4401050 0.4398463 0.4395874 [344] 0.4393284 0.4390692 0.4388099 0.4385505 0.4382909 0.4380312 0.4377713 [351] 0.4375113 0.4372512 0.4369909 0.4367306 0.4364700 0.4362094 0.4359486 [358] 0.4356877 0.4354266 0.4351654 0.4349041 0.4346427 0.4343812 0.4341195 [365] 0.4338577 0.4335958 0.4333337 0.4330716 0.4328093 0.4325469 0.4322843 [372] 0.4320217 0.4317589 0.4314961 0.4312331 0.4309700 0.4307068 0.4304434 [379] 0.4301800 0.4299164 0.4296528 0.4293890 0.4291251 0.4288612 0.4285971 [386] 0.4283329 0.4280686 0.4278042 0.4275397 0.4272751 0.4270104 0.4267456 [393] 0.4264807 0.4262157 0.4259506 0.4256854 0.4254201 0.4251547 0.4248892 [400] 0.4246236 0.4243580 > mx [1] 0.5137554 > mxli [1] -2 > if (mxli != 0) + { + x1 <- (x^mxli - 1) / mxli + } else { + x1 <- log(x) + } > postscript(file="/var/www/html/rcomp/tmp/1tmpo1261298642.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/2lrfo1261298642.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/3ly3t1261298642.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/4u1b41261298642.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/5feqe1261298642.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/6l07r1261298642.tab") > > try(system("convert tmp/1tmpo1261298642.ps tmp/1tmpo1261298642.png",intern=TRUE)) character(0) > try(system("convert tmp/2lrfo1261298642.ps tmp/2lrfo1261298642.png",intern=TRUE)) character(0) > try(system("convert tmp/3ly3t1261298642.ps tmp/3ly3t1261298642.png",intern=TRUE)) character(0) > try(system("convert tmp/4u1b41261298642.ps tmp/4u1b41261298642.png",intern=TRUE)) character(0) > try(system("convert tmp/5feqe1261298642.ps tmp/5feqe1261298642.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.157 0.831 1.550