R version 2.8.1 (2008-12-22) Copyright (C) 2008 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(1.6891,1.7236,1.8072,1.7847,1.6813,1.6469,1.689,1.7169,1.8036,1.7955,1.7172,1.7348,1.7094,1.6963,1.6695,1.6537,1.6662,1.6793,1.7922,1.8045,1.7927,1.7831,1.7847,1.8076,1.8218,1.8112,1.795,1.7813,1.7866,1.7552,1.7184,1.7114,1.6967,1.6867,1.6337,1.6626,1.6374,1.626,1.637,1.6142,1.7033,1.7483,1.7135,1.7147,1.7396,1.7049,1.6867,1.7462,1.7147,1.667,1.6806,1.6738,1.6571,1.5875,1.6002,1.6144,1.6009,1.5937,1.603,1.5979) > x <- c(1.5291,1.5358,1.5355,1.5287,1.5334,1.5225,1.5135,1.5144,1.4913,1.4793,1.4663,1.4749,1.4745,1.4775,1.4678,1.4658,1.4572,1.4721,1.4624,1.4636,1.4649,1.465,1.4673,1.4679,1.4621,1.4674,1.4695,1.4964,1.5155,1.5411,1.5476,1.54,1.5474,1.5485,1.559,1.5544,1.5657,1.5734,1.567,1.5547,1.54,1.5192,1.527,1.5387,1.5431,1.5426,1.5216,1.5364,1.5469,1.5501,1.5494,1.5475,1.5448,1.5391,1.5578,1.5528,1.5496,1.549,1.5449,1.5479) > #'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.6002035 -0.6002234 -0.6002433 -0.6002631 -0.6002830 -0.6003029 [7] -0.6003227 -0.6003426 -0.6003624 -0.6003823 -0.6004021 -0.6004220 [13] -0.6004418 -0.6004617 -0.6004815 -0.6005013 -0.6005212 -0.6005410 [19] -0.6005608 -0.6005807 -0.6006005 -0.6006203 -0.6006402 -0.6006600 [25] -0.6006798 -0.6006996 -0.6007195 -0.6007393 -0.6007591 -0.6007789 [31] -0.6007987 -0.6008185 -0.6008383 -0.6008581 -0.6008779 -0.6008978 [37] -0.6009176 -0.6009374 -0.6009572 -0.6009769 -0.6009967 -0.6010165 [43] -0.6010363 -0.6010561 -0.6010759 -0.6010957 -0.6011155 -0.6011352 [49] -0.6011550 -0.6011748 -0.6011946 -0.6012144 -0.6012341 -0.6012539 [55] -0.6012737 -0.6012934 -0.6013132 -0.6013330 -0.6013527 -0.6013725 [61] -0.6013922 -0.6014120 -0.6014317 -0.6014515 -0.6014712 -0.6014910 [67] -0.6015107 -0.6015305 -0.6015502 -0.6015700 -0.6015897 -0.6016094 [73] -0.6016292 -0.6016489 -0.6016686 -0.6016884 -0.6017081 -0.6017278 [79] -0.6017475 -0.6017672 -0.6017870 -0.6018067 -0.6018264 -0.6018461 [85] -0.6018658 -0.6018855 -0.6019052 -0.6019249 -0.6019446 -0.6019643 [91] -0.6019840 -0.6020037 -0.6020234 -0.6020431 -0.6020628 -0.6020825 [97] -0.6021022 -0.6021219 -0.6021416 -0.6021612 -0.6021809 -0.6022006 [103] -0.6022203 -0.6022400 -0.6022596 -0.6022793 -0.6022990 -0.6023186 [109] -0.6023383 -0.6023580 -0.6023776 -0.6023973 -0.6024169 -0.6024366 [115] -0.6024562 -0.6024759 -0.6024955 -0.6025152 -0.6025348 -0.6025545 [121] -0.6025741 -0.6025937 -0.6026134 -0.6026330 -0.6026527 -0.6026723 [127] -0.6026919 -0.6027115 -0.6027312 -0.6027508 -0.6027704 -0.6027900 [133] -0.6028096 -0.6028293 -0.6028489 -0.6028685 -0.6028881 -0.6029077 [139] -0.6029273 -0.6029469 -0.6029665 -0.6029861 -0.6030057 -0.6030253 [145] -0.6030449 -0.6030645 -0.6030841 -0.6031036 -0.6031232 -0.6031428 [151] -0.6031624 -0.6031820 -0.6032015 -0.6032211 -0.6032407 -0.6032603 [157] -0.6032798 -0.6032994 -0.6033189 -0.6033385 -0.6033581 -0.6033776 [163] -0.6033972 -0.6034167 -0.6034363 -0.6034558 -0.6034754 -0.6034949 [169] -0.6035145 -0.6035340 -0.6035536 -0.6035731 -0.6035926 -0.6036122 [175] -0.6036317 -0.6036512 -0.6036707 -0.6036903 -0.6037098 -0.6037293 [181] -0.6037488 -0.6037683 -0.6037879 -0.6038074 -0.6038269 -0.6038464 [187] -0.6038659 -0.6038854 -0.6039049 -0.6039244 -0.6039439 -0.6039634 [193] -0.6039829 -0.6040024 -0.6040219 -0.6040413 -0.6040608 -0.6040803 [199] -0.6040998 -0.6041193 -0.6041387 -0.6041582 -0.6041777 -0.6041972 [205] -0.6042166 -0.6042361 -0.6042555 -0.6042750 -0.6042945 -0.6043139 [211] -0.6043334 -0.6043528 -0.6043723 -0.6043917 -0.6044112 -0.6044306 [217] -0.6044501 -0.6044695 -0.6044889 -0.6045084 -0.6045278 -0.6045472 [223] -0.6045667 -0.6045861 -0.6046055 -0.6046249 -0.6046444 -0.6046638 [229] -0.6046832 -0.6047026 -0.6047220 -0.6047414 -0.6047608 -0.6047802 [235] -0.6047996 -0.6048190 -0.6048384 -0.6048578 -0.6048772 -0.6048966 [241] -0.6049160 -0.6049354 -0.6049548 -0.6049742 -0.6049935 -0.6050129 [247] -0.6050323 -0.6050517 -0.6050710 -0.6050904 -0.6051098 -0.6051291 [253] -0.6051485 -0.6051679 -0.6051872 -0.6052066 -0.6052259 -0.6052453 [259] -0.6052646 -0.6052840 -0.6053033 -0.6053227 -0.6053420 -0.6053614 [265] -0.6053807 -0.6054000 -0.6054194 -0.6054387 -0.6054580 -0.6054773 [271] -0.6054967 -0.6055160 -0.6055353 -0.6055546 -0.6055739 -0.6055932 [277] -0.6056126 -0.6056319 -0.6056512 -0.6056705 -0.6056898 -0.6057091 [283] -0.6057284 -0.6057477 -0.6057669 -0.6057862 -0.6058055 -0.6058248 [289] -0.6058441 -0.6058634 -0.6058826 -0.6059019 -0.6059212 -0.6059405 [295] -0.6059597 -0.6059790 -0.6059983 -0.6060175 -0.6060368 -0.6060560 [301] -0.6060753 -0.6060946 -0.6061138 -0.6061330 -0.6061523 -0.6061715 [307] -0.6061908 -0.6062100 -0.6062293 -0.6062485 -0.6062677 -0.6062869 [313] -0.6063062 -0.6063254 -0.6063446 -0.6063638 -0.6063831 -0.6064023 [319] -0.6064215 -0.6064407 -0.6064599 -0.6064791 -0.6064983 -0.6065175 [325] -0.6065367 -0.6065559 -0.6065751 -0.6065943 -0.6066135 -0.6066327 [331] -0.6066519 -0.6066711 -0.6066902 -0.6067094 -0.6067286 -0.6067478 [337] -0.6067669 -0.6067861 -0.6068053 -0.6068244 -0.6068436 -0.6068628 [343] -0.6068819 -0.6069011 -0.6069202 -0.6069394 -0.6069585 -0.6069777 [349] -0.6069968 -0.6070159 -0.6070351 -0.6070542 -0.6070733 -0.6070925 [355] -0.6071116 -0.6071307 -0.6071499 -0.6071690 -0.6071881 -0.6072072 [361] -0.6072263 -0.6072454 -0.6072645 -0.6072837 -0.6073028 -0.6073219 [367] -0.6073410 -0.6073601 -0.6073792 -0.6073982 -0.6074173 -0.6074364 [373] -0.6074555 -0.6074746 -0.6074937 -0.6075128 -0.6075318 -0.6075509 [379] -0.6075700 -0.6075890 -0.6076081 -0.6076272 -0.6076462 -0.6076653 [385] -0.6076843 -0.6077034 -0.6077224 -0.6077415 -0.6077605 -0.6077796 [391] -0.6077986 -0.6078177 -0.6078367 -0.6078557 -0.6078748 -0.6078938 [397] -0.6079128 -0.6079319 -0.6079509 -0.6079699 -0.6079889 > mx [1] 0.6079889 > 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/1e9av1257798049.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/rcomp/tmp/2z6fq1257798049.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x,y,main='Linear Fit of Original Data',xlab='Zwitserse Frank',ylab='Australische Dollar') > abline(r) > grid() > mtext(paste('Residual Standard Deviation = ',se)) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/37ard1257798049.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x1,y,main='Linear Fit of Transformed Data',xlab='Zwitserse Frank',ylab='Australische Dollar') > 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/4d6qw1257798049.tab") > > system("convert tmp/1e9av1257798049.ps tmp/1e9av1257798049.png") > system("convert tmp/2z6fq1257798049.ps tmp/2z6fq1257798049.png") > system("convert tmp/37ard1257798049.ps tmp/37ard1257798049.png") > > > proc.time() user system elapsed 0.890 0.690 1.543