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(100.00 + ,100.78 + ,101.24 + ,102.35 + ,102.41 + ,102.67 + ,102.54 + ,102.74 + ,103.07 + ,103.39 + ,103.72 + ,103.91 + ,104.37 + ,104.89 + ,105.61 + ,106.00 + ,106.13 + ,106.20 + ,106.26 + ,106.33 + ,106.98 + ,107.44 + ,107.50 + ,107.57 + ,107.63 + ,108.15 + ,108.35 + ,109.07 + ,109.39 + ,109.78 + ,109.98 + ,110.18 + ,110.31 + ,110.57 + ,110.63 + ,110.70 + ,110.76 + ,111.15 + ,111.48 + ,112.13 + ,112.13 + ,112.20 + ,112.20 + ,112.46 + ,112.85 + ,113.31 + ,113.37 + ,113.37 + ,113.44 + ,113.89 + ,114.16 + ,114.74 + ,114.81 + ,114.22 + ,114.55 + ,114.74 + ,115.26 + ,114.87 + ,114.87 + ,114.94 + ,115.00 + ,115.98 + ,116.44 + ,117.03 + ,117.09 + ,117.16 + ,117.22 + ,117.22 + ,117.29 + ,117.35 + ,117.55 + ,117.68 + ,117.68 + ,118.26 + ,118.66 + ,119.05 + ,119.18 + ,119.44 + ,119.77 + ,119.83 + ,119.90 + ,119.96 + ,120.09 + ,120.29 + ,120.35 + ,121.27 + ,121.72 + ,122.37 + ,122.50 + ,122.57 + ,122.64 + ,122.83 + ,122.90 + ,122.96 + ,122.96 + ,123.03 + ,123.03 + ,123.55 + ,123.94 + ,125.18 + ,125.57 + ,125.90 + ,126.22 + ,126.48 + ,126.68 + ,127.14 + ,127.14 + ,127.14 + ,127.14 + ,127.53 + ,127.85 + ,127.98 + ,127.98 + ,127.98 + ,127.98 + ,128.51 + ,128.96 + ,129.16 + ,129.29 + ,129.48 + ,129.55 + ,130.14 + ,130.46 + ,131.31 + ,131.90 + ,132.35 + ,132.75 + ,132.75 + ,133.07 + ,133.14 + ,133.27 + ,133.40 + ,133.59 + ,133.79 + ,134.18 + ,134.70 + ,134.96 + ,135.09 + ,135.55 + ,135.68 + ,136.01 + ,136.07 + ,136.33 + ,136.40 + ,136.79 + ,136.86 + ,136.92 + ,136.99 + ,137.51 + ,137.90 + ,138.10 + ,138.29 + ,138.42 + ,138.55 + ,138.88 + ,139.20 + ,139.40 + ,139.60 + ,139.79 + ,140.12 + ,140.25 + ,140.83 + ,141.16 + ,141.49 + ,141.68 + ,141.88 + ,142.14 + ,142.27 + ,142.60 + ,142.79 + ,143.05 + ,143.77 + ,144.10 + ,144.16 + ,144.68 + ,144.81 + ,144.94 + ,145.14 + ,145.40 + ,145.53 + ,145.73 + ,146.12 + ,146.84 + ,147.10 + ,147.36 + ,147.62 + ,147.75 + ,148.08 + ,148.27 + ,148.60 + ,148.79 + ,148.99 + ,149.05 + ,149.25 + ,149.38 + ,149.45 + ,149.58 + ,149.77 + ,149.97 + ,150.03 + ,150.16 + ,150.55 + ,150.68 + ,151.14 + ,151.27 + ,151.99 + ,153.36 + ,153.95 + ,154.53 + ,154.66 + ,154.92 + ,155.38 + ,155.84 + ,155.97 + ,156.56 + ,156.69 + ,156.88 + ,157.01 + ,157.27 + ,157.47 + ,157.99 + ,158.45 + ,158.64 + ,159.10) > x <- c(100.00 + ,100.00 + ,97.56 + ,95.12 + ,92.68 + ,92.68 + ,97.56 + ,107.32 + ,112.20 + ,112.20 + ,112.20 + ,114.63 + ,117.07 + ,117.07 + ,114.63 + ,114.63 + ,114.63 + ,112.20 + ,121.95 + ,131.71 + ,134.15 + ,136.59 + ,136.59 + ,141.46 + ,146.34 + ,148.78 + ,148.78 + ,146.34 + ,146.34 + ,148.78 + ,158.54 + ,173.17 + ,180.49 + ,180.49 + ,182.93 + ,185.37 + ,190.24 + ,190.24 + ,187.80 + ,185.37 + ,182.93 + ,178.05 + ,185.37 + ,195.12 + ,195.12 + ,192.68 + ,190.24 + ,187.80 + ,190.24 + ,187.80 + ,182.93 + ,178.05 + ,173.17 + ,170.73 + ,178.05 + ,190.24 + ,192.68 + ,192.68 + ,190.24 + ,190.24 + ,192.68 + ,190.24 + ,185.37 + ,180.49 + ,175.61 + ,168.29 + ,173.17 + ,182.93 + ,185.37 + ,180.49 + ,178.05 + ,175.61 + ,178.05 + ,175.61 + ,173.17 + ,170.73 + ,168.29 + ,165.85 + ,175.61 + ,185.37 + ,187.80 + ,185.37 + ,182.93 + ,182.93 + ,185.37 + ,185.37 + ,185.37 + ,182.93 + ,178.05 + ,175.61 + ,180.49 + ,195.12 + ,200.00 + ,195.12 + ,187.80 + ,187.80 + ,190.24 + ,190.24 + ,187.80 + ,182.93 + ,178.05 + ,173.17 + ,173.17 + ,175.61 + ,165.85 + ,160.98 + ,156.10 + ,156.10 + ,158.54 + ,153.66 + ,143.90 + ,134.15 + ,126.83 + ,119.51 + ,131.71 + ,141.46 + ,139.02 + ,136.59 + ,134.15 + ,131.71 + ,131.71 + ,131.71 + ,134.15 + ,141.46 + ,139.02 + ,131.71 + ,136.59 + ,141.46 + ,151.22 + ,165.85 + ,163.41 + ,163.41 + ,156.10 + ,153.66 + ,153.66 + ,156.10 + ,153.66 + ,146.34 + ,153.66 + ,153.66 + ,160.98 + ,182.93 + ,190.24 + ,192.68 + ,190.24 + ,185.37 + ,182.93 + ,185.37 + ,182.93 + ,178.05 + ,185.37 + ,182.93 + ,185.37 + ,192.68 + ,192.68 + ,197.56 + ,200.00 + ,195.12 + ,182.93 + ,165.85 + ,158.54 + ,160.98 + ,185.37 + ,195.12 + ,197.56 + ,187.80 + ,182.93 + ,185.37 + ,190.24 + ,190.24 + ,190.24 + ,182.93 + ,182.93 + ,173.17 + ,182.93 + ,182.93 + ,185.37 + ,187.80 + ,187.80 + ,192.68 + ,197.56 + ,200.00 + ,200.00 + ,200.00 + ,192.68 + ,178.05 + ,168.29 + ,160.98 + ,163.41 + ,168.29 + ,170.73 + ,173.17 + ,175.61 + ,173.17 + ,168.29 + ,170.73 + ,165.85 + ,156.10 + ,163.41 + ,160.98 + ,156.10 + ,153.66 + ,151.22 + ,158.54 + ,165.85 + ,165.85 + ,156.10 + ,148.78 + ,141.46 + ,148.78 + ,175.61 + ,178.05 + ,168.29 + ,148.78 + ,141.46 + ,151.22 + ,173.17 + ,187.80 + ,192.68 + ,187.80 + ,180.49 + ,182.93 + ,195.12 + ,197.56) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = '' > par2 = '' > par1 = '' > ylab = '' > xlab = '' > main = '' > #'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.4142761 0.4141124 0.4139479 0.4137826 0.4136165 0.4134496 0.4132819 [8] 0.4131134 0.4129442 0.4127741 0.4126032 0.4124315 0.4122590 0.4120858 [15] 0.4119118 0.4117369 0.4115613 0.4113849 0.4112078 0.4110298 0.4108511 [22] 0.4106716 0.4104913 0.4103102 0.4101284 0.4099458 0.4097624 0.4095783 [29] 0.4093934 0.4092077 0.4090213 0.4088341 0.4086462 0.4084575 0.4082680 [36] 0.4080778 0.4078868 0.4076951 0.4075027 0.4073094 0.4071155 0.4069208 [43] 0.4067254 0.4065292 0.4063323 0.4061346 0.4059363 0.4057372 0.4055373 [50] 0.4053368 0.4051355 0.4049335 0.4047307 0.4045273 0.4043231 0.4041182 [57] 0.4039126 0.4037063 0.4034993 0.4032916 0.4030831 0.4028740 0.4026642 [64] 0.4024536 0.4022424 0.4020305 0.4018179 0.4016046 0.4013906 0.4011759 [71] 0.4009605 0.4007445 0.4005278 0.4003104 0.4000923 0.3998736 0.3996542 [78] 0.3994341 0.3992134 0.3989920 0.3987699 0.3985472 0.3983238 0.3980998 [85] 0.3978751 0.3976498 0.3974238 0.3971972 0.3969699 0.3967420 0.3965135 [92] 0.3962843 0.3960545 0.3958241 0.3955930 0.3953613 0.3951290 0.3948961 [99] 0.3946626 0.3944284 0.3941937 0.3939583 0.3937224 0.3934858 0.3932486 [106] 0.3930108 0.3927724 0.3925335 0.3922939 0.3920538 0.3918131 0.3915717 [113] 0.3913298 0.3910874 0.3908443 0.3906007 0.3903565 0.3901118 0.3898665 [120] 0.3896206 0.3893741 0.3891272 0.3888796 0.3886315 0.3883829 0.3881337 [127] 0.3878840 0.3876337 0.3873829 0.3871315 0.3868797 0.3866273 0.3863743 [134] 0.3861209 0.3858669 0.3856124 0.3853574 0.3851019 0.3848459 0.3845893 [141] 0.3843323 0.3840748 0.3838167 0.3835582 0.3832992 0.3830397 0.3827797 [148] 0.3825192 0.3822583 0.3819968 0.3817349 0.3814725 0.3812097 0.3809464 [155] 0.3806826 0.3804183 0.3801536 0.3798885 0.3796229 0.3793568 0.3790903 [162] 0.3788234 0.3785560 0.3782882 0.3780199 0.3777512 0.3774821 0.3772126 [169] 0.3769426 0.3766722 0.3764014 0.3761302 0.3758586 0.3755866 0.3753141 [176] 0.3750413 0.3747680 0.3744944 0.3742204 0.3739459 0.3736711 0.3733959 [183] 0.3731204 0.3728444 0.3725681 0.3722914 0.3720143 0.3717369 0.3714591 [190] 0.3711809 0.3709024 0.3706235 0.3703443 0.3700647 0.3697848 0.3695045 [197] 0.3692239 0.3689430 0.3686617 0.3683801 0.3680982 0.3678159 0.3675333 [204] 0.3672504 0.3669672 0.3666837 0.3663998 0.3661157 0.3658312 0.3655464 [211] 0.3652614 0.3649760 0.3646904 0.3644044 0.3641182 0.3638317 0.3635449 [218] 0.3632578 0.3629705 0.3626829 0.3623950 0.3621068 0.3618184 0.3615297 [225] 0.3612408 0.3609516 0.3606621 0.3603725 0.3600825 0.3597923 0.3595019 [232] 0.3592112 0.3589203 0.3586292 0.3583379 0.3580463 0.3577545 0.3574624 [239] 0.3571702 0.3568777 0.3565850 0.3562922 0.3559991 0.3557058 0.3554123 [246] 0.3551186 0.3548247 0.3545306 0.3542364 0.3539419 0.3536473 0.3533525 [253] 0.3530575 0.3527623 0.3524670 0.3521714 0.3518758 0.3515799 0.3512839 [260] 0.3509878 0.3506914 0.3503950 0.3500983 0.3498016 0.3495047 0.3492076 [267] 0.3489104 0.3486131 0.3483156 0.3480180 0.3477203 0.3474224 0.3471245 [274] 0.3468264 0.3465282 0.3462298 0.3459314 0.3456329 0.3453342 0.3450354 [281] 0.3447366 0.3444376 0.3441386 0.3438394 0.3435402 0.3432409 0.3429414 [288] 0.3426419 0.3423424 0.3420427 0.3417430 0.3414432 0.3411433 0.3408434 [295] 0.3405434 0.3402433 0.3399432 0.3396430 0.3393427 0.3390424 0.3387421 [302] 0.3384417 0.3381413 0.3378408 0.3375403 0.3372397 0.3369391 0.3366385 [309] 0.3363379 0.3360372 0.3357365 0.3354357 0.3351350 0.3348342 0.3345334 [316] 0.3342326 0.3339318 0.3336310 0.3333302 0.3330294 0.3327286 0.3324277 [323] 0.3321269 0.3318261 0.3315253 0.3312245 0.3309237 0.3306230 0.3303222 [330] 0.3300215 0.3297208 0.3294201 0.3291194 0.3288188 0.3285182 0.3282176 [337] 0.3279171 0.3276166 0.3273162 0.3270158 0.3267154 0.3264151 0.3261148 [344] 0.3258146 0.3255145 0.3252144 0.3249143 0.3246143 0.3243144 0.3240145 [351] 0.3237147 0.3234150 0.3231153 0.3228158 0.3225162 0.3222168 0.3219175 [358] 0.3216182 0.3213190 0.3210199 0.3207209 0.3204219 0.3201231 0.3198243 [365] 0.3195257 0.3192271 0.3189287 0.3186303 0.3183321 0.3180339 0.3177359 [372] 0.3174379 0.3171401 0.3168424 0.3165448 0.3162473 0.3159499 0.3156527 [379] 0.3153556 0.3150586 0.3147617 0.3144650 0.3141684 0.3138719 0.3135755 [386] 0.3132793 0.3129832 0.3126873 0.3123915 0.3120958 0.3118003 0.3115050 [393] 0.3112097 0.3109147 0.3106197 0.3103250 0.3100304 0.3097359 0.3094416 [400] 0.3091475 0.3088535 > mx [1] 0.4142761 > 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/1727b1257934971.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/2z7rg1257934971.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/3791q1257934971.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/49dch1257934971.tab") > > system("convert tmp/1727b1257934971.ps tmp/1727b1257934971.png") > system("convert tmp/2z7rg1257934971.ps tmp/2z7rg1257934971.png") > system("convert tmp/3791q1257934971.ps tmp/3791q1257934971.png") > > > proc.time() user system elapsed 0.823 0.512 1.064