R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(01.303763,01.416094,01.052458,01.312283,01.309429,01.492409,01.026556,01.005406,01.334886,01.393873,01.128092,01.122787,01.213104,01.253528,01.094796,00.912944,01.195130,00.927499,00.965333,01.198078,00.966362,00.973685,00.994801,00.826262,00.688888,00.781307,00.604791,01.086240,00.774026,01.026032,00.676435,00.830525,00.791624,00.752391,00.670202,00.880336,00.914297,00.961042,00.930194,00.867966,00.989160,00.997288,00.798744,00.975379,00.934721,00.973234,00.815300,00.940209,00.794493,00.931340,00.922050,00.784517,00.822098,00.891026,00.807306,00.951441,01.147907,01.172609,01.281051,01.165962,00.978911,01.410951,01.197838,01.288368,01.102253,01.197657,01.299984,01.198611,01.299252,01.097604,01.399770,01.398396,01.401880,01.699717,01.397610,01.500135,01.400136,01.400427,01.341477,01.338580,01.482977,01.163253,01.328468,01.234550,01.484741,01.336579,01.339292,01.405225,01.333491,01.149740) > x <- c(09.166456,07.970589,07.104091,06.621064,07.529215,08.170938,08.157450,07.378962,07.921496,08.156740,08.856365,08.817177,08.734347,09.345927,08.992970,10.785120,08.886867,08.818847,08.823744,09.165298,08.652657,08.173054,07.563416,07.595809,08.381467,07.216432,06.540178,06.238914,05.487288,05.759462,05.993215,07.474726,07.348907,07.303379,07.119314,06.993780,06.958153,07.595706,08.088153,07.555753,07.315433,07.893427,08.858794,08.839367,08.014733,07.873465,08.930377,10.500550,12.611440,11.417870,11.872490,11.060820,12.043310,09.776299,09.557194,09.202590,10.224020,09.350807,08.300913,08.365779,08.133595,07.660470,08.074839,07.848597,07.998220,07.396895,07.900419,08.100500,07.899453,07.599783,08.100929,09.002175,10.298900,10.101520,10.699150,09.698140,09.800951,10.900470,10.697850,09.297252,10.397440,10.900720,12.901270,13.099060,11.698280,11.099870,11.301570,10.702110,10.099310,09.591119) > #'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.3568940 0.3568157 0.3567364 0.3566563 0.3565752 0.3564934 0.3564106 [8] 0.3563270 0.3562426 0.3561572 0.3560710 0.3559839 0.3558960 0.3558072 [15] 0.3557175 0.3556270 0.3555356 0.3554433 0.3553502 0.3552562 0.3551614 [22] 0.3550657 0.3549691 0.3548717 0.3547734 0.3546743 0.3545743 0.3544734 [29] 0.3543717 0.3542691 0.3541657 0.3540614 0.3539563 0.3538503 0.3537435 [36] 0.3536358 0.3535273 0.3534179 0.3533076 0.3531965 0.3530846 0.3529718 [43] 0.3528582 0.3527437 0.3526284 0.3525123 0.3523953 0.3522774 0.3521588 [50] 0.3520392 0.3519189 0.3517977 0.3516757 0.3515528 0.3514291 0.3513046 [57] 0.3511792 0.3510530 0.3509260 0.3507981 0.3506694 0.3505399 0.3504096 [64] 0.3502784 0.3501465 0.3500137 0.3498800 0.3497456 0.3496103 0.3494743 [71] 0.3493374 0.3491997 0.3490611 0.3489218 0.3487817 0.3486407 0.3484989 [78] 0.3483564 0.3482130 0.3480688 0.3479238 0.3477781 0.3476315 0.3474841 [85] 0.3473359 0.3471869 0.3470372 0.3468866 0.3467353 0.3465831 0.3464302 [92] 0.3462765 0.3461220 0.3459667 0.3458106 0.3456538 0.3454961 0.3453377 [99] 0.3451785 0.3450186 0.3448578 0.3446963 0.3445340 0.3443710 0.3442072 [106] 0.3440426 0.3438773 0.3437112 0.3435443 0.3433767 0.3432083 0.3430392 [113] 0.3428693 0.3426987 0.3425273 0.3423551 0.3421822 0.3420086 0.3418342 [120] 0.3416591 0.3414833 0.3413067 0.3411294 0.3409513 0.3407725 0.3405930 [127] 0.3404127 0.3402317 0.3400500 0.3398676 0.3396845 0.3395006 0.3393160 [134] 0.3391307 0.3389447 0.3387580 0.3385705 0.3383824 0.3381935 0.3380040 [141] 0.3378137 0.3376227 0.3374311 0.3372387 0.3370457 0.3368519 0.3366575 [148] 0.3364624 0.3362666 0.3360701 0.3358729 0.3356751 0.3354765 0.3352773 [155] 0.3350774 0.3348769 0.3346756 0.3344737 0.3342712 0.3340680 0.3338641 [162] 0.3336595 0.3334543 0.3332485 0.3330419 0.3328348 0.3326270 0.3324185 [169] 0.3322094 0.3319996 0.3317892 0.3315782 0.3313665 0.3311542 0.3309413 [176] 0.3307277 0.3305135 0.3302987 0.3300833 0.3298672 0.3296505 0.3294332 [183] 0.3292153 0.3289968 0.3287776 0.3285579 0.3283375 0.3281166 0.3278950 [190] 0.3276729 0.3274501 0.3272267 0.3270028 0.3267783 0.3265531 0.3263274 [197] 0.3261011 0.3258743 0.3256468 0.3254188 0.3251902 0.3249610 0.3247312 [204] 0.3245009 0.3242701 0.3240386 0.3238066 0.3235740 0.3233409 0.3231072 [211] 0.3228730 0.3226382 0.3224029 0.3221670 0.3219306 0.3216937 0.3214562 [218] 0.3212182 0.3209796 0.3207405 0.3205009 0.3202607 0.3200201 0.3197789 [225] 0.3195372 0.3192949 0.3190522 0.3188089 0.3185652 0.3183209 0.3180761 [232] 0.3178308 0.3175851 0.3173388 0.3170920 0.3168447 0.3165970 0.3163487 [239] 0.3161000 0.3158507 0.3156010 0.3153508 0.3151002 0.3148490 0.3145974 [246] 0.3143454 0.3140928 0.3138398 0.3135863 0.3133324 0.3130780 0.3128231 [253] 0.3125678 0.3123121 0.3120558 0.3117992 0.3115421 0.3112846 0.3110266 [260] 0.3107682 0.3105093 0.3102500 0.3099903 0.3097302 0.3094696 0.3092086 [267] 0.3089472 0.3086853 0.3084231 0.3081604 0.3078974 0.3076339 0.3073700 [274] 0.3071057 0.3068410 0.3065759 0.3063104 0.3060445 0.3057782 0.3055116 [281] 0.3052445 0.3049771 0.3047092 0.3044410 0.3041724 0.3039035 0.3036341 [288] 0.3033644 0.3030943 0.3028239 0.3025531 0.3022819 0.3020104 0.3017385 [295] 0.3014662 0.3011936 0.3009207 0.3006474 0.3003737 0.3000997 0.2998254 [302] 0.2995507 0.2992757 0.2990004 0.2987247 0.2984487 0.2981724 0.2978957 [309] 0.2976187 0.2973414 0.2970638 0.2967859 0.2965076 0.2962291 0.2959502 [316] 0.2956710 0.2953915 0.2951117 0.2948317 0.2945513 0.2942706 0.2939896 [323] 0.2937084 0.2934268 0.2931450 0.2928628 0.2925804 0.2922977 0.2920148 [330] 0.2917315 0.2914480 0.2911642 0.2908802 0.2905958 0.2903113 0.2900264 [337] 0.2897413 0.2894559 0.2891703 0.2888844 0.2885983 0.2883119 0.2880253 [344] 0.2877385 0.2874513 0.2871640 0.2868764 0.2865886 0.2863005 0.2860122 [351] 0.2857237 0.2854350 0.2851460 0.2848568 0.2845674 0.2842778 0.2839879 [358] 0.2836979 0.2834076 0.2831171 0.2828264 0.2825355 0.2822444 0.2819531 [365] 0.2816616 0.2813699 0.2810780 0.2807859 0.2804937 0.2802012 0.2799085 [372] 0.2796157 0.2793227 0.2790295 0.2787361 0.2784425 0.2781488 0.2778549 [379] 0.2775608 0.2772666 0.2769722 0.2766776 0.2763829 0.2760880 0.2757929 [386] 0.2754977 0.2752024 0.2749069 0.2746112 0.2743154 0.2740194 0.2737233 [393] 0.2734271 0.2731307 0.2728342 0.2725376 0.2722408 0.2719439 0.2716468 [400] 0.2713496 0.2710523 > mx [1] 0.3568940 > 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/rcomp/tmp/1pvmh1293624553.ps",horizontal=F,onefile=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/rcomp/tmp/2pvmh1293624553.ps",horizontal=F,onefile=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/rcomp/tmp/30n4k1293624553.ps",horizontal=F,onefile=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/43nk81293624553.tab") > try(system("convert tmp/1pvmh1293624553.ps tmp/1pvmh1293624553.png",intern=TRUE)) character(0) > try(system("convert tmp/2pvmh1293624553.ps tmp/2pvmh1293624553.png",intern=TRUE)) character(0) > try(system("convert tmp/30n4k1293624553.ps tmp/30n4k1293624553.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.000 0.620 1.626