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(100,95.84395716,105.5073942,118.1540031,101.8612953,109.8419174,105.6348802,112.927078,133.0698623,125.6756757,146.736359,142.5803162,106.1448241,126.5170831,132.7893932,121.2391637,114.5079041,146.1499235,146.1244263,128.5058644,155.5838858,125.0382458,136.8944416,142.2233554,117.7715451,120.627231,127.7664457,135.1096379,105.7113717,117.9245283,120.754717,107.572667,130.4436512,107.2157063,105.0739419,130.1121877,109.6379398,116.7261601,97.11881693,140.8975013,108.2865885,97.65425803,112.0346762,123.0494646,112.4171341,116.4966854,104.6914839,122.2335543,99.79602244,96.71086181,112.3151453,102.5497195,104.5385008,122.0805711,80.64762876,91.40744518,99.51555329,106.527282,98.49566548,106.7567568) > #'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.3129312 -0.3129157 -0.3129000 -0.3128841 -0.3128680 -0.3128516 [7] -0.3128350 -0.3128182 -0.3128012 -0.3127840 -0.3127665 -0.3127488 [13] -0.3127309 -0.3127128 -0.3126945 -0.3126760 -0.3126572 -0.3126383 [19] -0.3126191 -0.3125997 -0.3125801 -0.3125602 -0.3125402 -0.3125200 [25] -0.3124995 -0.3124788 -0.3124579 -0.3124368 -0.3124155 -0.3123940 [31] -0.3123723 -0.3123504 -0.3123282 -0.3123059 -0.3122833 -0.3122606 [37] -0.3122376 -0.3122144 -0.3121910 -0.3121674 -0.3121436 -0.3121196 [43] -0.3120954 -0.3120710 -0.3120464 -0.3120216 -0.3119966 -0.3119714 [49] -0.3119459 -0.3119203 -0.3118945 -0.3118685 -0.3118422 -0.3118158 [55] -0.3117892 -0.3117624 -0.3117354 -0.3117081 -0.3116807 -0.3116531 [61] -0.3116253 -0.3115973 -0.3115691 -0.3115407 -0.3115121 -0.3114833 [67] -0.3114544 -0.3114252 -0.3113958 -0.3113663 -0.3113365 -0.3113066 [73] -0.3112765 -0.3112461 -0.3112156 -0.3111849 -0.3111540 -0.3111230 [79] -0.3110917 -0.3110602 -0.3110286 -0.3109968 -0.3109647 -0.3109325 [85] -0.3109001 -0.3108676 -0.3108348 -0.3108019 -0.3107687 -0.3107354 [91] -0.3107019 -0.3106682 -0.3106344 -0.3106003 -0.3105661 -0.3105317 [97] -0.3104971 -0.3104623 -0.3104274 -0.3103923 -0.3103570 -0.3103215 [103] -0.3102858 -0.3102500 -0.3102140 -0.3101778 -0.3101414 -0.3101048 [109] -0.3100681 -0.3100312 -0.3099942 -0.3099569 -0.3099195 -0.3098819 [115] -0.3098441 -0.3098062 -0.3097681 -0.3097298 -0.3096914 -0.3096527 [121] -0.3096139 -0.3095750 -0.3095358 -0.3094965 -0.3094571 -0.3094174 [127] -0.3093776 -0.3093377 -0.3092975 -0.3092572 -0.3092167 -0.3091761 [133] -0.3091353 -0.3090943 -0.3090532 -0.3090119 -0.3089705 -0.3089288 [139] -0.3088870 -0.3088451 -0.3088030 -0.3087607 -0.3087183 -0.3086757 [145] -0.3086329 -0.3085900 -0.3085470 -0.3085037 -0.3084604 -0.3084168 [151] -0.3083731 -0.3083292 -0.3082852 -0.3082411 -0.3081967 -0.3081522 [157] -0.3081076 -0.3080628 -0.3080179 -0.3079728 -0.3079275 -0.3078821 [163] -0.3078365 -0.3077908 -0.3077450 -0.3076989 -0.3076528 -0.3076064 [169] -0.3075600 -0.3075134 -0.3074666 -0.3074197 -0.3073726 -0.3073254 [175] -0.3072780 -0.3072305 -0.3071829 -0.3071351 -0.3070871 -0.3070390 [181] -0.3069908 -0.3069424 -0.3068939 -0.3068452 -0.3067964 -0.3067474 [187] -0.3066983 -0.3066491 -0.3065997 -0.3065502 -0.3065005 -0.3064507 [193] -0.3064007 -0.3063506 -0.3063004 -0.3062500 -0.3061995 -0.3061489 [199] -0.3060981 -0.3060471 -0.3059961 -0.3059449 -0.3058935 -0.3058421 [205] -0.3057904 -0.3057387 -0.3056868 -0.3056348 -0.3055826 -0.3055304 [211] -0.3054779 -0.3054254 -0.3053727 -0.3053199 -0.3052669 -0.3052138 [217] -0.3051606 -0.3051073 -0.3050538 -0.3050002 -0.3049465 -0.3048926 [223] -0.3048386 -0.3047845 -0.3047302 -0.3046758 -0.3046213 -0.3045667 [229] -0.3045119 -0.3044570 -0.3044020 -0.3043469 -0.3042916 -0.3042362 [235] -0.3041807 -0.3041250 -0.3040693 -0.3040134 -0.3039574 -0.3039012 [241] -0.3038449 -0.3037886 -0.3037320 -0.3036754 -0.3036187 -0.3035618 [247] -0.3035048 -0.3034477 -0.3033904 -0.3033331 -0.3032756 -0.3032180 [253] -0.3031603 -0.3031025 -0.3030445 -0.3029865 -0.3029283 -0.3028700 [259] -0.3028116 -0.3027530 -0.3026944 -0.3026356 -0.3025767 -0.3025177 [265] -0.3024586 -0.3023994 -0.3023400 -0.3022806 -0.3022210 -0.3021613 [271] -0.3021015 -0.3020416 -0.3019816 -0.3019215 -0.3018612 -0.3018009 [277] -0.3017404 -0.3016799 -0.3016192 -0.3015584 -0.3014975 -0.3014365 [283] -0.3013753 -0.3013141 -0.3012528 -0.3011913 -0.3011298 -0.3010681 [289] -0.3010063 -0.3009444 -0.3008825 -0.3008204 -0.3007582 -0.3006959 [295] -0.3006335 -0.3005710 -0.3005083 -0.3004456 -0.3003828 -0.3003199 [301] -0.3002568 -0.3001937 -0.3001305 -0.3000671 -0.3000037 -0.2999401 [307] -0.2998765 -0.2998127 -0.2997489 -0.2996849 -0.2996209 -0.2995567 [313] -0.2994925 -0.2994281 -0.2993637 -0.2992991 -0.2992345 -0.2991697 [319] -0.2991049 -0.2990400 -0.2989749 -0.2989098 -0.2988445 -0.2987792 [325] -0.2987138 -0.2986483 -0.2985826 -0.2985169 -0.2984511 -0.2983852 [331] -0.2983192 -0.2982531 -0.2981869 -0.2981206 -0.2980543 -0.2979878 [337] -0.2979212 -0.2978546 -0.2977878 -0.2977210 -0.2976541 -0.2975870 [343] -0.2975199 -0.2974527 -0.2973854 -0.2973180 -0.2972505 -0.2971830 [349] -0.2971153 -0.2970476 -0.2969797 -0.2969118 -0.2968438 -0.2967757 [355] -0.2967075 -0.2966392 -0.2965708 -0.2965024 -0.2964338 -0.2963652 [361] -0.2962965 -0.2962276 -0.2961588 -0.2960898 -0.2960207 -0.2959516 [367] -0.2958823 -0.2958130 -0.2957436 -0.2956741 -0.2956045 -0.2955349 [373] -0.2954651 -0.2953953 -0.2953254 -0.2952554 -0.2951853 -0.2951152 [379] -0.2950449 -0.2949746 -0.2949042 -0.2948337 -0.2947631 -0.2946925 [385] -0.2946218 -0.2945510 -0.2944801 -0.2944091 -0.2943380 -0.2942669 [391] -0.2941957 -0.2941244 -0.2940530 -0.2939816 -0.2939101 -0.2938385 [397] -0.2937668 -0.2936950 -0.2936232 -0.2935513 -0.2934793 > 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/1m6bu1258117547.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/2i3ld1258117547.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/3k54k1258117547.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/4zqsu1258117547.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/5rlu71258117547.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/62k3m1258117547.tab") > > system("convert tmp/1m6bu1258117547.ps tmp/1m6bu1258117547.png") > system("convert tmp/2i3ld1258117547.ps tmp/2i3ld1258117547.png") > system("convert tmp/3k54k1258117547.ps tmp/3k54k1258117547.png") > system("convert tmp/4zqsu1258117547.ps tmp/4zqsu1258117547.png") > system("convert tmp/5rlu71258117547.ps tmp/5rlu71258117547.png") > > > proc.time() user system elapsed 1.085 0.769 1.275