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(2756.76,2849.27,2921.44,2981.85,3080.58,3106.22,3119.31,3061.26,3097.31,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3667.03,3813.06,3917.96,3895.51,3801.06,3570.12,3701.61,3862.27,3970.10,4138.52,4199.75,4290.89,4443.91,4502.64,4356.98,4591.27,4696.96,4621.40,4562.84,4202.52,4296.49,4435.23,4105.18,4116.68,3844.49,3720.98,3674.40,3857.62,3801.06,3504.37,3032.60,3047.03,2962.34,2197.82,2014.45,1862.83,1905.41,1810.99,1670.07,1864.44,2052.02,2029.60,2070.83,2293.41) > #'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.5055458 -0.5051708 -0.5047939 -0.5044150 -0.5040341 -0.5036513 [7] -0.5032666 -0.5028798 -0.5024911 -0.5021004 -0.5017078 -0.5013132 [13] -0.5009166 -0.5005181 -0.5001176 -0.4997151 -0.4993107 -0.4989043 [19] -0.4984959 -0.4980856 -0.4976733 -0.4972590 -0.4968428 -0.4964246 [25] -0.4960044 -0.4955823 -0.4951582 -0.4947321 -0.4943041 -0.4938741 [31] -0.4934422 -0.4930083 -0.4925724 -0.4921346 -0.4916948 -0.4912530 [37] -0.4908093 -0.4903637 -0.4899161 -0.4894665 -0.4890150 -0.4885615 [43] -0.4881061 -0.4876487 -0.4871894 -0.4867281 -0.4862649 -0.4857997 [49] -0.4853326 -0.4848636 -0.4843926 -0.4839197 -0.4834448 -0.4829680 [55] -0.4824893 -0.4820086 -0.4815260 -0.4810415 -0.4805551 -0.4800667 [61] -0.4795765 -0.4790843 -0.4785901 -0.4780941 -0.4775962 -0.4770963 [67] -0.4765946 -0.4760909 -0.4755853 -0.4750779 -0.4745685 -0.4740573 [73] -0.4735441 -0.4730291 -0.4725122 -0.4719934 -0.4714727 -0.4709501 [79] -0.4704257 -0.4698994 -0.4693712 -0.4688412 -0.4683093 -0.4677755 [85] -0.4672399 -0.4667025 -0.4661632 -0.4656220 -0.4650791 -0.4645342 [91] -0.4639876 -0.4634391 -0.4628888 -0.4623367 -0.4617827 -0.4612270 [97] -0.4606694 -0.4601101 -0.4595489 -0.4589859 -0.4584212 -0.4578546 [103] -0.4572863 -0.4567162 -0.4561443 -0.4555707 -0.4549953 -0.4544181 [109] -0.4538392 -0.4532585 -0.4526761 -0.4520919 -0.4515060 -0.4509184 [115] -0.4503290 -0.4497379 -0.4491452 -0.4485507 -0.4479544 -0.4473565 [121] -0.4467569 -0.4461557 -0.4455527 -0.4449480 -0.4443417 -0.4437337 [127] -0.4431241 -0.4425128 -0.4418999 -0.4412853 -0.4406690 -0.4400512 [133] -0.4394317 -0.4388106 -0.4381879 -0.4375636 -0.4369377 -0.4363102 [139] -0.4356811 -0.4350504 -0.4344181 -0.4337843 -0.4331490 -0.4325120 [145] -0.4318735 -0.4312335 -0.4305920 -0.4299489 -0.4293043 -0.4286582 [151] -0.4280106 -0.4273614 -0.4267108 -0.4260587 -0.4254052 -0.4247501 [157] -0.4240936 -0.4234357 -0.4227763 -0.4221154 -0.4214531 -0.4207894 [163] -0.4201243 -0.4194578 -0.4187898 -0.4181205 -0.4174498 -0.4167777 [169] -0.4161042 -0.4154294 -0.4147532 -0.4140757 -0.4133968 -0.4127166 [175] -0.4120351 -0.4113523 -0.4106681 -0.4099827 -0.4092959 -0.4086079 [181] -0.4079186 -0.4072281 -0.4065363 -0.4058432 -0.4051490 -0.4044534 [187] -0.4037567 -0.4030587 -0.4023596 -0.4016592 -0.4009577 -0.4002550 [193] -0.3995511 -0.3988461 -0.3981399 -0.3974326 -0.3967241 -0.3960145 [199] -0.3953038 -0.3945920 -0.3938791 -0.3931651 -0.3924500 -0.3917339 [205] -0.3910167 -0.3902985 -0.3895792 -0.3888589 -0.3881376 -0.3874152 [211] -0.3866919 -0.3859676 -0.3852423 -0.3845160 -0.3837887 -0.3830605 [217] -0.3823314 -0.3816013 -0.3808703 -0.3801384 -0.3794055 -0.3786718 [223] -0.3779372 -0.3772017 -0.3764654 -0.3757282 -0.3749902 -0.3742513 [229] -0.3735116 -0.3727711 -0.3720297 -0.3712876 -0.3705447 -0.3698010 [235] -0.3690566 -0.3683114 -0.3675655 -0.3668188 -0.3660714 -0.3653233 [241] -0.3645745 -0.3638250 -0.3630748 -0.3623239 -0.3615724 -0.3608202 [247] -0.3600674 -0.3593139 -0.3585599 -0.3578052 -0.3570499 -0.3562940 [253] -0.3555376 -0.3547805 -0.3540229 -0.3532648 -0.3525061 -0.3517469 [259] -0.3509872 -0.3502270 -0.3494663 -0.3487051 -0.3479434 -0.3471813 [265] -0.3464187 -0.3456556 -0.3448921 -0.3441282 -0.3433639 -0.3425992 [271] -0.3418341 -0.3410686 -0.3403028 -0.3395365 -0.3387700 -0.3380031 [277] -0.3372358 -0.3364683 -0.3357004 -0.3349322 -0.3341638 -0.3333951 [283] -0.3326261 -0.3318568 -0.3310873 -0.3303176 -0.3295476 -0.3287775 [289] -0.3280071 -0.3272365 -0.3264658 -0.3256948 -0.3249237 -0.3241525 [295] -0.3233811 -0.3226096 -0.3218380 -0.3210662 -0.3202944 -0.3195224 [301] -0.3187504 -0.3179783 -0.3172062 -0.3164339 -0.3156617 -0.3148894 [307] -0.3141171 -0.3133448 -0.3125725 -0.3118002 -0.3110280 -0.3102557 [313] -0.3094835 -0.3087114 -0.3079393 -0.3071673 -0.3063953 -0.3056235 [319] -0.3048518 -0.3040801 -0.3033086 -0.3025372 -0.3017660 -0.3009949 [325] -0.3002239 -0.2994531 -0.2986826 -0.2979121 -0.2971419 -0.2963719 [331] -0.2956022 -0.2948326 -0.2940633 -0.2932942 -0.2925254 -0.2917568 [337] -0.2909885 -0.2902205 -0.2894528 -0.2886854 -0.2879183 -0.2871515 [343] -0.2863851 -0.2856189 -0.2848532 -0.2840878 -0.2833227 -0.2825581 [349] -0.2817938 -0.2810299 -0.2802664 -0.2795033 -0.2787406 -0.2779784 [355] -0.2772166 -0.2764552 -0.2756943 -0.2749339 -0.2741739 -0.2734144 [361] -0.2726554 -0.2718969 -0.2711389 -0.2703814 -0.2696245 -0.2688680 [367] -0.2681121 -0.2673568 -0.2666020 -0.2658478 -0.2650941 -0.2643410 [373] -0.2635885 -0.2628366 -0.2620854 -0.2613347 -0.2605846 -0.2598352 [379] -0.2590864 -0.2583382 -0.2575907 -0.2568439 -0.2560977 -0.2553522 [385] -0.2546074 -0.2538632 -0.2531198 -0.2523770 -0.2516350 -0.2508937 [391] -0.2501531 -0.2494133 -0.2486742 -0.2479358 -0.2471982 -0.2464613 [397] -0.2457253 -0.2449900 -0.2442554 -0.2435217 -0.2427888 > 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/1u41z1258155193.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/2mvkw1258155193.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/35rqw1258155193.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/4irdf1258155193.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/52f7f1258155193.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/6wilu1258155193.tab") > > system("convert tmp/1u41z1258155193.ps tmp/1u41z1258155193.png") > system("convert tmp/2mvkw1258155193.ps tmp/2mvkw1258155193.png") > system("convert tmp/35rqw1258155193.ps tmp/35rqw1258155193.png") > system("convert tmp/4irdf1258155193.ps tmp/4irdf1258155193.png") > system("convert tmp/52f7f1258155193.ps tmp/52f7f1258155193.png") > > > proc.time() user system elapsed 1.064 0.771 1.383