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. > y <- c(2.28,2.26,2.71,2.77,2.77,2.64,2.56,2.07,2.32,2.16,2.23,2.40,2.84,2.77,2.93,2.91,2.69,2.38,2.58,3.19,2.82,2.72,2.53,2.70,2.42,2.50,2.31,2.41,2.56,2.76,2.71,2.44,2.46,2.12,1.99,1.86,1.88,1.82,1.74,1.71,1.38,1.27,1.19,1.28,1.19,1.22,1.47,1.46,1.96,1.88,2.03,2.04,1.90,1.80,1.92,1.92,1.97,2.46,2.36,2.53,2.31,1.98,1.46,1.26,1.58,1.74,1.89,1.85,1.62,1.30,1.42,1.15,0.42,0.74,1.02,1.51,1.86,1.59,1.03,0.44,0.82,0.86,0.58,0.59,0.95,0.98,1.23,1.17,0.84,0.74,0.65,0.91,1.19,1.30,1.53,1.94,1.79,1.95,2.26,2.04,2.16,2.75,2.79,2.88,3.36,2.97,3.10,2.49,2.20,2.25,2.09,2.79,3.14,2.93,2.65,2.67,2.26,2.35,2.13,2.18,2.90,2.63,2.67,1.81,1.33,0.88,1.28,1.26,1.26,1.29,1.10,1.37,1.21,1.74,1.76,1.48,1.04,1.62,1.49,1.79,1.80,1.58,1.86,1.74,1.59,1.26,1.13,1.92,2.61,2.26,2.41,2.26,2.03,2.86,2.55,2.27,2.26,2.57,3.07,2.76,2.51,2.87,3.14,3.11,3.16,2.47,2.57,2.89,2.63,2.38,1.69,1.96,2.19,1.87,1.6,1.63,1.22,1.21,1.49,1.64) > x <- c(6.9,6.8,6.7,6.6,6.5,6.5,7.0,7.5,7.6,7.6,7.6,7.8,8.0,8.0,8.0,7.9,7.9,8.0,8.5,9.2,9.4,9.5,9.5,9.6,9.7,9.7,9.6,9.5,9.4,9.3,9.6,10.2,10.2,10.1,9.9,9.8,9.8,9.7,9.5,9.3,9.1,9.0,9.5,10.0,10.2,10.1,10.0,9.9,10.0,9.9,9.7,9.5,9.2,9.0,9.3,9.8,9.8,9.6,9.4,9.3,9.2,9.2,9.0,8.8,8.7,8.7,9.1,9.7,9.8,9.6,9.4,9.4,9.5,9.4,9.3,9.2,9.0,8.9,9.2,9.8,9.9,9.6,9.2,9.1,9.1,9.0,8.9,8.7,8.5,8.3,8.5,8.7,8.4,8.1,7.8,7.7,7.5,7.2,6.8,6.7,6.4,6.3,6.8,7.3,7.1,7.0,6.8,6.6,6.3,6.1,6.1,6.3,6.3,6.0,6.2,6.4,6.8,7.5,7.5,7.6,7.6,7.4,7.3,7.1,6.9,6.8,7.5,7.6,7.8,8.0,8.1,8.2,8.3,8.2,8.0,7.9,7.6,7.6,8.3,8.4,8.4,8.4,8.4,8.6,8.9,8.8,8.3,7.5,7.2,7.4,8.8,9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.5,8.2,8.1,7.9,8.6,8.7,8.7,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8.0,8.2,8.1,8.1,8.0,7.9,7.9) > #'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(x1,y) + if (mx < abs(c[i])) + { + mx <- abs(c[i]) + mxli <- l[i] + } + } > c [1] -0.3373517 -0.3373149 -0.3372779 -0.3372406 -0.3372032 -0.3371655 [7] -0.3371276 -0.3370895 -0.3370512 -0.3370127 -0.3369740 -0.3369351 [13] -0.3368960 -0.3368567 -0.3368171 -0.3367774 -0.3367374 -0.3366972 [19] -0.3366569 -0.3366163 -0.3365755 -0.3365345 -0.3364933 -0.3364519 [25] -0.3364103 -0.3363685 -0.3363264 -0.3362842 -0.3362417 -0.3361991 [31] -0.3361562 -0.3361132 -0.3360699 -0.3360264 -0.3359827 -0.3359388 [37] -0.3358947 -0.3358504 -0.3358059 -0.3357612 -0.3357163 -0.3356711 [43] -0.3356258 -0.3355803 -0.3355345 -0.3354886 -0.3354424 -0.3353961 [49] -0.3353495 -0.3353027 -0.3352558 -0.3352086 -0.3351612 -0.3351136 [55] -0.3350658 -0.3350179 -0.3349697 -0.3349213 -0.3348727 -0.3348239 [61] -0.3347748 -0.3347256 -0.3346762 -0.3346266 -0.3345768 -0.3345268 [67] -0.3344765 -0.3344261 -0.3343755 -0.3343247 -0.3342736 -0.3342224 [73] -0.3341710 -0.3341193 -0.3340675 -0.3340155 -0.3339632 -0.3339108 [79] -0.3338581 -0.3338053 -0.3337523 -0.3336990 -0.3336456 -0.3335920 [85] -0.3335381 -0.3334841 -0.3334299 -0.3333754 -0.3333208 -0.3332660 [91] -0.3332109 -0.3331557 -0.3331003 -0.3330447 -0.3329889 -0.3329328 [97] -0.3328766 -0.3328202 -0.3327636 -0.3327068 -0.3326498 -0.3325926 [103] -0.3325352 -0.3324777 -0.3324199 -0.3323619 -0.3323037 -0.3322454 [109] -0.3321868 -0.3321280 -0.3320691 -0.3320100 -0.3319506 -0.3318911 [115] -0.3318314 -0.3317715 -0.3317113 -0.3316510 -0.3315906 -0.3315299 [121] -0.3314690 -0.3314079 -0.3313467 -0.3312852 -0.3312236 -0.3311617 [127] -0.3310997 -0.3310375 -0.3309751 -0.3309125 -0.3308497 -0.3307867 [133] -0.3307236 -0.3306602 -0.3305967 -0.3305329 -0.3304690 -0.3304049 [139] -0.3303406 -0.3302761 -0.3302115 -0.3301466 -0.3300816 -0.3300164 [145] -0.3299509 -0.3298853 -0.3298196 -0.3297536 -0.3296874 -0.3296211 [151] -0.3295546 -0.3294879 -0.3294210 -0.3293539 -0.3292866 -0.3292192 [157] -0.3291515 -0.3290837 -0.3290157 -0.3289476 -0.3288792 -0.3288107 [163] -0.3287420 -0.3286731 -0.3286040 -0.3285347 -0.3284653 -0.3283956 [169] -0.3283258 -0.3282559 -0.3281857 -0.3281154 -0.3280448 -0.3279741 [175] -0.3279033 -0.3278322 -0.3277610 -0.3276896 -0.3276180 -0.3275462 [181] -0.3274743 -0.3274022 -0.3273299 -0.3272574 -0.3271848 -0.3271120 [187] -0.3270390 -0.3269658 -0.3268925 -0.3268190 -0.3267453 -0.3266714 [193] -0.3265974 -0.3265232 -0.3264488 -0.3263743 -0.3262996 -0.3262247 [199] -0.3261496 -0.3260744 -0.3259990 -0.3259234 -0.3258477 -0.3257718 [205] -0.3256957 -0.3256195 -0.3255431 -0.3254665 -0.3253897 -0.3253128 [211] -0.3252358 -0.3251585 -0.3250811 -0.3250035 -0.3249258 -0.3248479 [217] -0.3247698 -0.3246915 -0.3246131 -0.3245346 -0.3244558 -0.3243769 [223] -0.3242979 -0.3242187 -0.3241393 -0.3240597 -0.3239800 -0.3239002 [229] -0.3238201 -0.3237399 -0.3236596 -0.3235791 -0.3234984 -0.3234176 [235] -0.3233366 -0.3232554 -0.3231741 -0.3230927 -0.3230111 -0.3229293 [241] -0.3228474 -0.3227653 -0.3226830 -0.3226006 -0.3225181 -0.3224353 [247] -0.3223525 -0.3222695 -0.3221863 -0.3221030 -0.3220195 -0.3219358 [253] -0.3218521 -0.3217681 -0.3216840 -0.3215998 -0.3215154 -0.3214309 [259] -0.3213462 -0.3212613 -0.3211763 -0.3210912 -0.3210059 -0.3209205 [265] -0.3208349 -0.3207491 -0.3206633 -0.3205772 -0.3204910 -0.3204047 [271] -0.3203183 -0.3202316 -0.3201449 -0.3200580 -0.3199709 -0.3198837 [277] -0.3197964 -0.3197089 -0.3196213 -0.3195335 -0.3194456 -0.3193576 [283] -0.3192694 -0.3191811 -0.3190926 -0.3190040 -0.3189152 -0.3188263 [289] -0.3187373 -0.3186481 -0.3185588 -0.3184694 -0.3183798 -0.3182901 [295] -0.3182002 -0.3181102 -0.3180201 -0.3179298 -0.3178394 -0.3177489 [301] -0.3176582 -0.3175674 -0.3174765 -0.3173854 -0.3172942 -0.3172029 [307] -0.3171114 -0.3170198 -0.3169281 -0.3168362 -0.3167442 -0.3166521 [313] -0.3165598 -0.3164675 -0.3163749 -0.3162823 -0.3161895 -0.3160966 [319] -0.3160036 -0.3159105 -0.3158172 -0.3157238 -0.3156303 -0.3155366 [325] -0.3154428 -0.3153489 -0.3152549 -0.3151607 -0.3150664 -0.3149720 [331] -0.3148775 -0.3147829 -0.3146881 -0.3145932 -0.3144982 -0.3144031 [337] -0.3143078 -0.3142125 -0.3141170 -0.3140214 -0.3139256 -0.3138298 [343] -0.3137338 -0.3136377 -0.3135415 -0.3134452 -0.3133488 -0.3132523 [349] -0.3131556 -0.3130588 -0.3129619 -0.3128649 -0.3127678 -0.3126706 [355] -0.3125732 -0.3124757 -0.3123782 -0.3122805 -0.3121827 -0.3120848 [361] -0.3119868 -0.3118886 -0.3117904 -0.3116921 -0.3115936 -0.3114950 [367] -0.3113964 -0.3112976 -0.3111987 -0.3110997 -0.3110006 -0.3109014 [373] -0.3108021 -0.3107027 -0.3106031 -0.3105035 -0.3104038 -0.3103039 [379] -0.3102040 -0.3101040 -0.3100038 -0.3099036 -0.3098032 -0.3097028 [385] -0.3096022 -0.3095016 -0.3094008 -0.3093000 -0.3091990 -0.3090980 [391] -0.3089968 -0.3088956 -0.3087942 -0.3086928 -0.3085912 -0.3084896 [397] -0.3083879 -0.3082860 -0.3081841 -0.3080821 -0.3079800 > mx [1] 0.3373517 > mxli [1] -2 > if (mxli != 0) + { + x1 <- (x^mxli - 1) / mxli + } else { + x1 <- log(x) + } > r<-lm(y~x) > se <- sqrt(var(r$residuals)) > r1 <- lm(y~x1) > se1 <- sqrt(var(r1$residuals)) > postscript(file="/var/www/html/rcomp/tmp/112a71257794471.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(l,c,main='Box-Cox Linearity Plot',xlab='Lambda',ylab='correlation') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2ausy1257794471.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x,y,main='Linear Fit of Original Data',xlab='x',ylab='y') > abline(r) > grid() > mtext(paste('Residual Standard Deviation = ',se)) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/33k9a1257794471.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x1,y,main='Linear Fit of Transformed Data',xlab='x',ylab='y') > abline(r1) > grid() > mtext(paste('Residual Standard Deviation = ',se1)) > 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 Linearity 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(x)',header=TRUE) > a<-table.element(a,mxli) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Residual SD (orginial)',header=TRUE) > a<-table.element(a,se) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Residual SD (transformed)',header=TRUE) > a<-table.element(a,se1) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/4yc7n1257794472.tab") > system("convert tmp/112a71257794471.ps tmp/112a71257794471.png") > system("convert tmp/2ausy1257794471.ps tmp/2ausy1257794471.png") > system("convert tmp/33k9a1257794471.ps tmp/33k9a1257794471.png") > > > proc.time() user system elapsed 0.825 0.540 0.978