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(274412,272433,268361,268586,264768,269974,304744,309365,308347,298427,289231,291975,294912,293488,290555,284736,281818,287854,316263,325412,326011,328282,317480,317539,313737,312276,309391,302950,300316,304035,333476,337698,335932,323931,313927,314485,313218,309664,302963,298989,298423,301631,329765,335083,327616,309119,295916,291413,291542,284678,276475,272566,264981,263290,296806,303598,286994,276427,266424,267153,268381,262522,255542,253158,243803,250741,280445,285257,270976,261076,255603,260376,263903,264291,263276,262572,256167,264221,293860) > #'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.4035480 -0.4034595 -0.4033790 -0.4032966 -0.4032181 -0.4031376 [7] -0.4030552 -0.4029723 -0.4028886 -0.4028077 -0.4027248 -0.4026419 [13] -0.4025580 -0.4024777 -0.4023946 -0.4023106 -0.4022266 -0.4021446 [19] -0.4020614 -0.4019781 -0.4018945 -0.4018116 -0.4017276 -0.4016439 [25] -0.4015607 -0.4014769 -0.4013935 -0.4013093 -0.4012256 -0.4011417 [31] -0.4010576 -0.4009733 -0.4008892 -0.4008050 -0.4007206 -0.4006362 [37] -0.4005517 -0.4004672 -0.4003825 -0.4002978 -0.4002131 -0.4001282 [43] -0.4000433 -0.3999583 -0.3998733 -0.3997882 -0.3997029 -0.3996177 [49] -0.3995323 -0.3994469 -0.3993614 -0.3992759 -0.3991902 -0.3991045 [55] -0.3990188 -0.3989329 -0.3988470 -0.3987610 -0.3986750 -0.3985888 [61] -0.3985026 -0.3984164 -0.3983300 -0.3982436 -0.3981571 -0.3980706 [67] -0.3979840 -0.3978973 -0.3978105 -0.3977237 -0.3976368 -0.3975498 [73] -0.3974628 -0.3973757 -0.3972885 -0.3972012 -0.3971139 -0.3970265 [79] -0.3969390 -0.3968515 -0.3967639 -0.3966762 -0.3965885 -0.3965007 [85] -0.3964128 -0.3963249 -0.3962368 -0.3961487 -0.3960606 -0.3959724 [91] -0.3958841 -0.3957957 -0.3957073 -0.3956188 -0.3955302 -0.3954416 [97] -0.3953529 -0.3952641 -0.3951752 -0.3950863 -0.3949974 -0.3949083 [103] -0.3948192 -0.3947300 -0.3946408 -0.3945514 -0.3944621 -0.3943726 [109] -0.3942831 -0.3941935 -0.3941038 -0.3940141 -0.3939243 -0.3938344 [115] -0.3937445 -0.3936545 -0.3935645 -0.3934743 -0.3933841 -0.3932939 [121] -0.3932035 -0.3931131 -0.3930227 -0.3929321 -0.3928415 -0.3927509 [127] -0.3926602 -0.3925694 -0.3924785 -0.3923876 -0.3922966 -0.3922055 [133] -0.3921144 -0.3920232 -0.3919319 -0.3918406 -0.3917492 -0.3916577 [139] -0.3915662 -0.3914746 -0.3913830 -0.3912913 -0.3911995 -0.3911076 [145] -0.3910157 -0.3909237 -0.3908317 -0.3907396 -0.3906474 -0.3905551 [151] -0.3904628 -0.3903705 -0.3902780 -0.3901855 -0.3900930 -0.3900003 [157] -0.3899076 -0.3898149 -0.3897221 -0.3896292 -0.3895362 -0.3894432 [163] -0.3893501 -0.3892570 -0.3891638 -0.3890705 -0.3889772 -0.3888838 [169] -0.3887903 -0.3886968 -0.3886032 -0.3885095 -0.3884158 -0.3883221 [175] -0.3882282 -0.3881343 -0.3880403 -0.3879463 -0.3878522 -0.3877581 [181] -0.3876638 -0.3875696 -0.3874752 -0.3873808 -0.3872863 -0.3871918 [187] -0.3870972 -0.3870026 -0.3869078 -0.3868131 -0.3867182 -0.3866233 [193] -0.3865284 -0.3864333 -0.3863382 -0.3862431 -0.3861479 -0.3860526 [199] -0.3859573 -0.3858619 -0.3857664 -0.3856709 -0.3855753 -0.3854797 [205] -0.3853840 -0.3852882 -0.3851924 -0.3850965 -0.3850006 -0.3849046 [211] -0.3848085 -0.3847124 -0.3846162 -0.3845199 -0.3844236 -0.3843273 [217] -0.3842308 -0.3841343 -0.3840378 -0.3839412 -0.3838445 -0.3837478 [223] -0.3836510 -0.3835542 -0.3834573 -0.3833603 -0.3832633 -0.3831662 [229] -0.3830691 -0.3829719 -0.3828746 -0.3827773 -0.3826799 -0.3825825 [235] -0.3824850 -0.3823874 -0.3822898 -0.3821921 -0.3820944 -0.3819966 [241] -0.3818988 -0.3818009 -0.3817029 -0.3816049 -0.3815068 -0.3814087 [247] -0.3813105 -0.3812123 -0.3811140 -0.3810156 -0.3809172 -0.3808187 [253] -0.3807202 -0.3806216 -0.3805229 -0.3804242 -0.3803254 -0.3802266 [259] -0.3801277 -0.3800288 -0.3799298 -0.3798308 -0.3797317 -0.3796325 [265] -0.3795333 -0.3794340 -0.3793347 -0.3792353 -0.3791359 -0.3790364 [271] -0.3789368 -0.3788372 -0.3787375 -0.3786378 -0.3785380 -0.3784382 [277] -0.3783383 -0.3782384 -0.3781384 -0.3780383 -0.3779382 -0.3778381 [283] -0.3777378 -0.3776376 -0.3775373 -0.3774369 -0.3773364 -0.3772359 [289] -0.3771354 -0.3770348 -0.3769342 -0.3768334 -0.3767327 -0.3766319 [295] -0.3765310 -0.3764301 -0.3763291 -0.3762281 -0.3761270 -0.3760259 [301] -0.3759247 -0.3758234 -0.3757221 -0.3756208 -0.3755194 -0.3754179 [307] -0.3753164 -0.3752149 -0.3751132 -0.3750116 -0.3749099 -0.3748081 [313] -0.3747063 -0.3746044 -0.3745025 -0.3744005 -0.3742984 -0.3741964 [319] -0.3740942 -0.3739920 -0.3738898 -0.3737875 -0.3736852 -0.3735828 [325] -0.3734803 -0.3733778 -0.3732753 -0.3731727 -0.3730700 -0.3729673 [331] -0.3728646 -0.3727618 -0.3726589 -0.3725560 -0.3724531 -0.3723500 [337] -0.3722470 -0.3721439 -0.3720407 -0.3719375 -0.3718343 -0.3717310 [343] -0.3716276 -0.3715242 -0.3714207 -0.3713172 -0.3712137 -0.3711101 [349] -0.3710064 -0.3709027 -0.3707990 -0.3706952 -0.3705913 -0.3704874 [355] -0.3703835 -0.3702795 -0.3701754 -0.3700713 -0.3699672 -0.3698630 [361] -0.3697588 -0.3696545 -0.3695501 -0.3694457 -0.3693413 -0.3692368 [367] -0.3691323 -0.3690277 -0.3689231 -0.3688184 -0.3687137 -0.3686090 [373] -0.3685041 -0.3683993 -0.3682944 -0.3681894 -0.3680844 -0.3679794 [379] -0.3678743 -0.3677691 -0.3676639 -0.3675587 -0.3674534 -0.3673481 [385] -0.3672427 -0.3671373 -0.3670318 -0.3669263 -0.3668208 -0.3667152 [391] -0.3666095 -0.3665038 -0.3663981 -0.3662923 -0.3661865 -0.3660806 [397] -0.3659747 -0.3658687 -0.3657627 -0.3656566 -0.3655505 > mx [1] 0 > mxli [1] -999 > if (mxli != 0) + { + x1 <- (x^mxli - 1) / mxli + } else { + x1 <- log(x) + } > postscript(file="/var/www/html/freestat/rcomp/tmp/1opgy1257984494.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/freestat/rcomp/tmp/2zs7t1257984494.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/freestat/rcomp/tmp/3n2nn1257984494.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/freestat/rcomp/tmp/41mmj1257984494.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/freestat/rcomp/tmp/5jr9v1257984494.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/6r9kb1257984494.tab") > system("convert tmp/1opgy1257984494.ps tmp/1opgy1257984494.png") > system("convert tmp/2zs7t1257984494.ps tmp/2zs7t1257984494.png") > system("convert tmp/3n2nn1257984494.ps tmp/3n2nn1257984494.png") > system("convert tmp/41mmj1257984494.ps tmp/41mmj1257984494.png") > system("convert tmp/5jr9v1257984494.ps tmp/5jr9v1257984494.png") > > > proc.time() user system elapsed 1.677 1.236 2.023