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(6.3,6.2,6.1,6.3,6.5,6.6,6.5,6.2,6.2,5.9,6.1,6.1,6.1,6.1,6.1,6.4,6.7,6.9,7,7,6.8,6.4,5.9,5.5,5.5,5.6,5.8,5.9,6.1,6.1,6,6,5.9,5.5,5.6,5.4,5.2,5.2,5.2,5.5,5.8,5.8,5.5,5.3,5.1,5.2,5.8,5.8,5.5,5,4.9,5.3,6.1,6.5,6.8,6.6,6.4,6.4) > #'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.3489820 -0.3489018 -0.3488214 -0.3487410 -0.3486603 -0.3485796 [7] -0.3484987 -0.3484178 -0.3483366 -0.3482554 -0.3481740 -0.3480926 [13] -0.3480110 -0.3479292 -0.3478474 -0.3477654 -0.3476833 -0.3476010 [19] -0.3475187 -0.3474362 -0.3473536 -0.3472709 -0.3471880 -0.3471050 [25] -0.3470219 -0.3469387 -0.3468553 -0.3467719 -0.3466883 -0.3466046 [31] -0.3465207 -0.3464367 -0.3463526 -0.3462684 -0.3461841 -0.3460996 [37] -0.3460150 -0.3459303 -0.3458455 -0.3457606 -0.3456755 -0.3455903 [43] -0.3455050 -0.3454195 -0.3453340 -0.3452483 -0.3451625 -0.3450765 [49] -0.3449905 -0.3449043 -0.3448180 -0.3447316 -0.3446450 -0.3445584 [55] -0.3444716 -0.3443847 -0.3442976 -0.3442105 -0.3441232 -0.3440358 [61] -0.3439483 -0.3438607 -0.3437729 -0.3436850 -0.3435970 -0.3435089 [67] -0.3434207 -0.3433323 -0.3432438 -0.3431552 -0.3430665 -0.3429776 [73] -0.3428887 -0.3427996 -0.3427104 -0.3426211 -0.3425316 -0.3424421 [79] -0.3423524 -0.3422626 -0.3421726 -0.3420826 -0.3419924 -0.3419022 [85] -0.3418118 -0.3417212 -0.3416306 -0.3415398 -0.3414490 -0.3413580 [91] -0.3412669 -0.3411756 -0.3410843 -0.3409928 -0.3409012 -0.3408095 [97] -0.3407177 -0.3406258 -0.3405337 -0.3404415 -0.3403492 -0.3402568 [103] -0.3401643 -0.3400716 -0.3399789 -0.3398860 -0.3397930 -0.3396999 [109] -0.3396066 -0.3395133 -0.3394198 -0.3393262 -0.3392325 -0.3391387 [115] -0.3390448 -0.3389507 -0.3388566 -0.3387623 -0.3386679 -0.3385734 [121] -0.3384788 -0.3383840 -0.3382892 -0.3381942 -0.3380991 -0.3380039 [127] -0.3379086 -0.3378131 -0.3377176 -0.3376219 -0.3375261 -0.3374302 [133] -0.3373342 -0.3372381 -0.3371419 -0.3370455 -0.3369491 -0.3368525 [139] -0.3367558 -0.3366590 -0.3365621 -0.3364650 -0.3363679 -0.3362706 [145] -0.3361732 -0.3360758 -0.3359782 -0.3358804 -0.3357826 -0.3356847 [151] -0.3355866 -0.3354885 -0.3353902 -0.3352918 -0.3351933 -0.3350947 [157] -0.3349960 -0.3348971 -0.3347982 -0.3346991 -0.3346000 -0.3345007 [163] -0.3344013 -0.3343018 -0.3342022 -0.3341025 -0.3340026 -0.3339027 [169] -0.3338026 -0.3337025 -0.3336022 -0.3335018 -0.3334013 -0.3333007 [175] -0.3332000 -0.3330992 -0.3329983 -0.3328972 -0.3327961 -0.3326948 [181] -0.3325934 -0.3324920 -0.3323904 -0.3322887 -0.3321869 -0.3320850 [187] -0.3319829 -0.3318808 -0.3317786 -0.3316762 -0.3315738 -0.3314712 [193] -0.3313686 -0.3312658 -0.3311629 -0.3310599 -0.3309568 -0.3308536 [199] -0.3307503 -0.3306469 -0.3305434 -0.3304398 -0.3303360 -0.3302322 [205] -0.3301283 -0.3300242 -0.3299201 -0.3298158 -0.3297114 -0.3296070 [211] -0.3295024 -0.3293977 -0.3292929 -0.3291880 -0.3290830 -0.3289779 [217] -0.3288727 -0.3287674 -0.3286620 -0.3285565 -0.3284509 -0.3283452 [223] -0.3282394 -0.3281334 -0.3280274 -0.3279213 -0.3278150 -0.3277087 [229] -0.3276022 -0.3274957 -0.3273891 -0.3272823 -0.3271755 -0.3270685 [235] -0.3269615 -0.3268543 -0.3267470 -0.3266397 -0.3265322 -0.3264247 [241] -0.3263170 -0.3262092 -0.3261014 -0.3259934 -0.3258854 -0.3257772 [247] -0.3256689 -0.3255606 -0.3254521 -0.3253435 -0.3252349 -0.3251261 [253] -0.3250173 -0.3249083 -0.3247993 -0.3246901 -0.3245808 -0.3244715 [259] -0.3243620 -0.3242525 -0.3241429 -0.3240331 -0.3239233 -0.3238133 [265] -0.3237033 -0.3235932 -0.3234829 -0.3233726 -0.3232622 -0.3231517 [271] -0.3230410 -0.3229303 -0.3228195 -0.3227086 -0.3225976 -0.3224865 [277] -0.3223753 -0.3222641 -0.3221527 -0.3220412 -0.3219296 -0.3218180 [283] -0.3217062 -0.3215943 -0.3214824 -0.3213704 -0.3212582 -0.3211460 [289] -0.3210337 -0.3209212 -0.3208087 -0.3206961 -0.3205834 -0.3204706 [295] -0.3203578 -0.3202448 -0.3201317 -0.3200186 -0.3199053 -0.3197920 [301] -0.3196785 -0.3195650 -0.3194514 -0.3193377 -0.3192239 -0.3191100 [307] -0.3189960 -0.3188820 -0.3187678 -0.3186535 -0.3185392 -0.3184248 [313] -0.3183102 -0.3181956 -0.3180809 -0.3179661 -0.3178513 -0.3177363 [319] -0.3176212 -0.3175061 -0.3173909 -0.3172756 -0.3171601 -0.3170446 [325] -0.3169291 -0.3168134 -0.3166976 -0.3165818 -0.3164659 -0.3163498 [331] -0.3162337 -0.3161175 -0.3160013 -0.3158849 -0.3157684 -0.3156519 [337] -0.3155353 -0.3154186 -0.3153018 -0.3151849 -0.3150679 -0.3149509 [343] -0.3148338 -0.3147165 -0.3145992 -0.3144819 -0.3143644 -0.3142468 [349] -0.3141292 -0.3140115 -0.3138937 -0.3137758 -0.3136578 -0.3135398 [355] -0.3134216 -0.3133034 -0.3131851 -0.3130667 -0.3129483 -0.3128297 [361] -0.3127111 -0.3125924 -0.3124736 -0.3123547 -0.3122358 -0.3121168 [367] -0.3119977 -0.3118785 -0.3117592 -0.3116398 -0.3115204 -0.3114009 [373] -0.3112813 -0.3111616 -0.3110419 -0.3109221 -0.3108022 -0.3106822 [379] -0.3105621 -0.3104420 -0.3103218 -0.3102015 -0.3100811 -0.3099606 [385] -0.3098401 -0.3097195 -0.3095988 -0.3094781 -0.3093572 -0.3092363 [391] -0.3091153 -0.3089943 -0.3088731 -0.3087519 -0.3086306 -0.3085093 [397] -0.3083878 -0.3082663 -0.3081447 -0.3080231 -0.3079013 > 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/1jm021258131803.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/2gjt01258131803.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/34k3j1258131803.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/4e2mt1258131803.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/5gj8r1258131803.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/6spsb1258131803.tab") > > system("convert tmp/1jm021258131803.ps tmp/1jm021258131803.png") > system("convert tmp/2gjt01258131803.ps tmp/2gjt01258131803.png") > system("convert tmp/34k3j1258131803.ps tmp/34k3j1258131803.png") > system("convert tmp/4e2mt1258131803.ps tmp/4e2mt1258131803.png") > system("convert tmp/5gj8r1258131803.ps tmp/5gj8r1258131803.png") > > > proc.time() user system elapsed 1.069 0.770 1.299