R version 2.7.2 (2008-08-25) 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(308.347,298.427,289.231,291.975,294.912,293.488,290.555,284.736,281.818,287.854,316.263,325.412,326.011,328.282,317.480,317.539,313.737,312.276,309.391,302.950,300.316,304.035,333.476,337.698,335.932,323.931,313.927,314.485,313.218,309.664,302.963,298.989,298.423,301.631,329.765,335.083,327.616,309.119,295.916,291.413,291.542,284.678,276.475,272.566,264.981,263.290,296.806,303.598,286.994,276.427,266.424,267.153,268.381,262.522,255.542,253.158,243.803,250.741,280.445,285.257) > #'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.5481145 -0.5480129 -0.5479111 -0.5478091 -0.5477070 -0.5476047 [7] -0.5475023 -0.5473996 -0.5472969 -0.5471939 -0.5470908 -0.5469875 [13] -0.5468841 -0.5467805 -0.5466767 -0.5465728 -0.5464687 -0.5463645 [19] -0.5462601 -0.5461555 -0.5460508 -0.5459459 -0.5458408 -0.5457356 [25] -0.5456303 -0.5455247 -0.5454190 -0.5453132 -0.5452072 -0.5451010 [31] -0.5449946 -0.5448881 -0.5447815 -0.5446747 -0.5445677 -0.5444605 [37] -0.5443532 -0.5442458 -0.5441382 -0.5440304 -0.5439225 -0.5438144 [43] -0.5437061 -0.5435977 -0.5434891 -0.5433804 -0.5432715 -0.5431625 [49] -0.5430533 -0.5429439 -0.5428344 -0.5427247 -0.5426149 -0.5425049 [55] -0.5423947 -0.5422844 -0.5421740 -0.5420633 -0.5419526 -0.5418416 [61] -0.5417305 -0.5416193 -0.5415079 -0.5413963 -0.5412846 -0.5411727 [67] -0.5410607 -0.5409485 -0.5408362 -0.5407237 -0.5406111 -0.5404982 [73] -0.5403853 -0.5402722 -0.5401589 -0.5400455 -0.5399319 -0.5398182 [79] -0.5397043 -0.5395903 -0.5394761 -0.5393617 -0.5392472 -0.5391326 [85] -0.5390178 -0.5389028 -0.5387877 -0.5386724 -0.5385570 -0.5384415 [91] -0.5383257 -0.5382099 -0.5380938 -0.5379777 -0.5378613 -0.5377449 [97] -0.5376282 -0.5375114 -0.5373945 -0.5372774 -0.5371602 -0.5370428 [103] -0.5369253 -0.5368076 -0.5366898 -0.5365718 -0.5364536 -0.5363354 [109] -0.5362169 -0.5360983 -0.5359796 -0.5358607 -0.5357417 -0.5356225 [115] -0.5355032 -0.5353837 -0.5352641 -0.5351443 -0.5350244 -0.5349043 [121] -0.5347841 -0.5346637 -0.5345432 -0.5344226 -0.5343017 -0.5341808 [127] -0.5340597 -0.5339384 -0.5338171 -0.5336955 -0.5335738 -0.5334520 [133] -0.5333300 -0.5332079 -0.5330856 -0.5329632 -0.5328407 -0.5327180 [139] -0.5325951 -0.5324721 -0.5323490 -0.5322257 -0.5321023 -0.5319787 [145] -0.5318550 -0.5317311 -0.5316071 -0.5314830 -0.5313587 -0.5312343 [151] -0.5311097 -0.5309850 -0.5308601 -0.5307351 -0.5306100 -0.5304847 [157] -0.5303593 -0.5302337 -0.5301080 -0.5299822 -0.5298562 -0.5297300 [163] -0.5296038 -0.5294773 -0.5293508 -0.5292241 -0.5290973 -0.5289703 [169] -0.5288432 -0.5287159 -0.5285885 -0.5284610 -0.5283333 -0.5282055 [175] -0.5280776 -0.5279495 -0.5278213 -0.5276929 -0.5275644 -0.5274358 [181] -0.5273070 -0.5271781 -0.5270490 -0.5269198 -0.5267905 -0.5266610 [187] -0.5265314 -0.5264017 -0.5262718 -0.5261418 -0.5260117 -0.5258814 [193] -0.5257510 -0.5256204 -0.5254898 -0.5253589 -0.5252280 -0.5250969 [199] -0.5249657 -0.5248343 -0.5247028 -0.5245712 -0.5244395 -0.5243076 [205] -0.5241755 -0.5240434 -0.5239111 -0.5237787 -0.5236461 -0.5235134 [211] -0.5233806 -0.5232476 -0.5231146 -0.5229813 -0.5228480 -0.5227145 [217] -0.5225809 -0.5224472 -0.5223133 -0.5221793 -0.5220452 -0.5219109 [223] -0.5217765 -0.5216420 -0.5215073 -0.5213726 -0.5212376 -0.5211026 [229] -0.5209674 -0.5208321 -0.5206967 -0.5205612 -0.5204255 -0.5202897 [235] -0.5201537 -0.5200177 -0.5198815 -0.5197452 -0.5196087 -0.5194721 [241] -0.5193354 -0.5191986 -0.5190617 -0.5189246 -0.5187874 -0.5186501 [247] -0.5185126 -0.5183750 -0.5182373 -0.5180995 -0.5179616 -0.5178235 [253] -0.5176853 -0.5175470 -0.5174085 -0.5172699 -0.5171312 -0.5169924 [259] -0.5168535 -0.5167144 -0.5165752 -0.5164359 -0.5162965 -0.5161569 [265] -0.5160173 -0.5158775 -0.5157375 -0.5155975 -0.5154573 -0.5153171 [271] -0.5151767 -0.5150361 -0.5148955 -0.5147547 -0.5146139 -0.5144729 [277] -0.5143317 -0.5141905 -0.5140491 -0.5139077 -0.5137661 -0.5136243 [283] -0.5134825 -0.5133406 -0.5131985 -0.5130563 -0.5129140 -0.5127716 [289] -0.5126291 -0.5124864 -0.5123436 -0.5122007 -0.5120577 -0.5119146 [295] -0.5117714 -0.5116280 -0.5114846 -0.5113410 -0.5111973 -0.5110535 [301] -0.5109096 -0.5107655 -0.5106214 -0.5104771 -0.5103327 -0.5101882 [307] -0.5100436 -0.5098989 -0.5097541 -0.5096091 -0.5094641 -0.5093189 [313] -0.5091736 -0.5090282 -0.5088827 -0.5087371 -0.5085914 -0.5084456 [319] -0.5082996 -0.5081535 -0.5080074 -0.5078611 -0.5077147 -0.5075682 [325] -0.5074216 -0.5072749 -0.5071281 -0.5069811 -0.5068341 -0.5066869 [331] -0.5065397 -0.5063923 -0.5062448 -0.5060972 -0.5059495 -0.5058017 [337] -0.5056538 -0.5055058 -0.5053577 -0.5052095 -0.5050612 -0.5049127 [343] -0.5047642 -0.5046155 -0.5044668 -0.5043179 -0.5041690 -0.5040199 [349] -0.5038707 -0.5037214 -0.5035721 -0.5034226 -0.5032730 -0.5031233 [355] -0.5029735 -0.5028236 -0.5026736 -0.5025235 -0.5023733 -0.5022230 [361] -0.5020726 -0.5019221 -0.5017715 -0.5016208 -0.5014700 -0.5013190 [367] -0.5011680 -0.5010169 -0.5008657 -0.5007144 -0.5005630 -0.5004115 [373] -0.5002599 -0.5001081 -0.4999563 -0.4998044 -0.4996524 -0.4995003 [379] -0.4993481 -0.4991958 -0.4990434 -0.4988909 -0.4987383 -0.4985856 [385] -0.4984329 -0.4982800 -0.4981270 -0.4979739 -0.4978208 -0.4976675 [391] -0.4975141 -0.4973607 -0.4972071 -0.4970535 -0.4968998 -0.4967459 [397] -0.4965920 -0.4964380 -0.4962839 -0.4961297 -0.4959754 > 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/1p39y1226427164.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/2jjga1226427164.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/30u3o1226427164.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/4k1b31226427164.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/5g08f1226427164.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/60q721226427164.tab") > > system("convert tmp/1p39y1226427164.ps tmp/1p39y1226427164.png") > system("convert tmp/2jjga1226427164.ps tmp/2jjga1226427164.png") > system("convert tmp/30u3o1226427164.ps tmp/30u3o1226427164.png") > system("convert tmp/4k1b31226427164.ps tmp/4k1b31226427164.png") > system("convert tmp/5g08f1226427164.ps tmp/5g08f1226427164.png") > > > proc.time() user system elapsed 1.307 0.778 1.502