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(20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,31956,29506,34506,27165,26736,23691,18157,17328,18205,20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835,20205,17789,20520,22518,15572,11509,25447,24090,27786,26195,20516,22759,19028,16971) > x <- c(612613,611324,594167,595454,590865,589379,584428,573100,567456,569028,620735,628884,628232,612117,595404,597141,593408,590072,579799,574205,572775,572942,619567,625809,619916,587625,565742,557274,560576,548854,531673,525919,511038,498662,555362,564591,541657,527070,509846,514258,516922,507561,492622,490243,469357,477580,528379,533590,517945,506174,501866,516141,528222,532638,536322,536535,523597,536214,586570,596594) > #'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.2393585 -0.2393817 -0.2394137 -0.2394407 -0.2394753 -0.2394743 [7] -0.2395110 -0.2395414 -0.2395751 -0.2395901 -0.2396284 -0.2396445 [13] -0.2396641 -0.2396952 -0.2397192 -0.2397430 -0.2397751 -0.2397984 [19] -0.2398260 -0.2398524 -0.2398752 -0.2399032 -0.2399292 -0.2399552 [25] -0.2399813 -0.2400060 -0.2400327 -0.2400589 -0.2400835 -0.2401105 [31] -0.2401364 -0.2401622 -0.2401885 -0.2402144 -0.2402403 -0.2402667 [37] -0.2402925 -0.2403188 -0.2403451 -0.2403710 -0.2403973 -0.2404236 [43] -0.2404496 -0.2404756 -0.2405019 -0.2405282 -0.2405544 -0.2405806 [49] -0.2406069 -0.2406331 -0.2406593 -0.2406856 -0.2407119 -0.2407381 [55] -0.2407644 -0.2407907 -0.2408170 -0.2408433 -0.2408696 -0.2408960 [61] -0.2409223 -0.2409487 -0.2409750 -0.2410014 -0.2410278 -0.2410542 [67] -0.2410806 -0.2411070 -0.2411334 -0.2411598 -0.2411863 -0.2412127 [73] -0.2412392 -0.2412657 -0.2412922 -0.2413187 -0.2413452 -0.2413717 [79] -0.2413982 -0.2414247 -0.2414513 -0.2414778 -0.2415044 -0.2415309 [85] -0.2415575 -0.2415841 -0.2416107 -0.2416373 -0.2416639 -0.2416906 [91] -0.2417172 -0.2417438 -0.2417705 -0.2417972 -0.2418238 -0.2418505 [97] -0.2418772 -0.2419039 -0.2419306 -0.2419574 -0.2419841 -0.2420109 [103] -0.2420376 -0.2420644 -0.2420911 -0.2421179 -0.2421447 -0.2421715 [109] -0.2421983 -0.2422251 -0.2422520 -0.2422788 -0.2423057 -0.2423325 [115] -0.2423594 -0.2423863 -0.2424132 -0.2424401 -0.2424670 -0.2424939 [121] -0.2425208 -0.2425477 -0.2425747 -0.2426016 -0.2426286 -0.2426556 [127] -0.2426826 -0.2427095 -0.2427365 -0.2427636 -0.2427906 -0.2428176 [133] -0.2428446 -0.2428717 -0.2428987 -0.2429258 -0.2429529 -0.2429800 [139] -0.2430071 -0.2430342 -0.2430613 -0.2430884 -0.2431155 -0.2431427 [145] -0.2431698 -0.2431970 -0.2432241 -0.2432513 -0.2432785 -0.2433057 [151] -0.2433329 -0.2433601 -0.2433873 -0.2434146 -0.2434418 -0.2434691 [157] -0.2434963 -0.2435236 -0.2435509 -0.2435782 -0.2436055 -0.2436328 [163] -0.2436601 -0.2436874 -0.2437147 -0.2437421 -0.2437694 -0.2437968 [169] -0.2438242 -0.2438515 -0.2438789 -0.2439063 -0.2439337 -0.2439611 [175] -0.2439885 -0.2440160 -0.2440434 -0.2440709 -0.2440983 -0.2441258 [181] -0.2441533 -0.2441808 -0.2442082 -0.2442357 -0.2442633 -0.2442908 [187] -0.2443183 -0.2443458 -0.2443734 -0.2444009 -0.2444285 -0.2444561 [193] -0.2444837 -0.2445112 -0.2445388 -0.2445665 -0.2445941 -0.2446217 [199] -0.2446493 -0.2446770 -0.2447046 -0.2447323 -0.2447599 -0.2447876 [205] -0.2448153 -0.2448430 -0.2448707 -0.2448984 -0.2449261 -0.2449539 [211] -0.2449816 -0.2450093 -0.2450371 -0.2450648 -0.2450926 -0.2451204 [217] -0.2451482 -0.2451760 -0.2452038 -0.2452316 -0.2452594 -0.2452872 [223] -0.2453151 -0.2453429 -0.2453708 -0.2453986 -0.2454265 -0.2454544 [229] -0.2454823 -0.2455102 -0.2455381 -0.2455660 -0.2455939 -0.2456218 [235] -0.2456498 -0.2456777 -0.2457057 -0.2457336 -0.2457616 -0.2457896 [241] -0.2458175 -0.2458455 -0.2458735 -0.2459015 -0.2459296 -0.2459576 [247] -0.2459856 -0.2460137 -0.2460417 -0.2460698 -0.2460978 -0.2461259 [253] -0.2461540 -0.2461821 -0.2462102 -0.2462383 -0.2462664 -0.2462945 [259] -0.2463226 -0.2463508 -0.2463789 -0.2464071 -0.2464352 -0.2464634 [265] -0.2464916 -0.2465198 -0.2465479 -0.2465761 -0.2466043 -0.2466326 [271] -0.2466608 -0.2466890 -0.2467172 -0.2467455 -0.2467737 -0.2468020 [277] -0.2468303 -0.2468585 -0.2468868 -0.2469151 -0.2469434 -0.2469717 [283] -0.2470000 -0.2470283 -0.2470567 -0.2470850 -0.2471133 -0.2471417 [289] -0.2471701 -0.2471984 -0.2472268 -0.2472552 -0.2472836 -0.2473119 [295] -0.2473403 -0.2473688 -0.2473972 -0.2474256 -0.2474540 -0.2474825 [301] -0.2475109 -0.2475393 -0.2475678 -0.2475963 -0.2476247 -0.2476532 [307] -0.2476817 -0.2477102 -0.2477387 -0.2477672 -0.2477957 -0.2478242 [313] -0.2478528 -0.2478813 -0.2479098 -0.2479384 -0.2479670 -0.2479955 [319] -0.2480241 -0.2480527 -0.2480812 -0.2481098 -0.2481384 -0.2481670 [325] -0.2481957 -0.2482243 -0.2482529 -0.2482815 -0.2483102 -0.2483388 [331] -0.2483675 -0.2483961 -0.2484248 -0.2484534 -0.2484821 -0.2485108 [337] -0.2485395 -0.2485682 -0.2485969 -0.2486256 -0.2486543 -0.2486831 [343] -0.2487118 -0.2487405 -0.2487693 -0.2487980 -0.2488268 -0.2488555 [349] -0.2488843 -0.2489131 -0.2489419 -0.2489706 -0.2489994 -0.2490282 [355] -0.2490570 -0.2490858 -0.2491147 -0.2491435 -0.2491723 -0.2492012 [361] -0.2492300 -0.2492588 -0.2492877 -0.2493166 -0.2493454 -0.2493743 [367] -0.2494032 -0.2494321 -0.2494610 -0.2494899 -0.2495188 -0.2495477 [373] -0.2495766 -0.2496055 -0.2496344 -0.2496634 -0.2496923 -0.2497212 [379] -0.2497502 -0.2497791 -0.2498081 -0.2498371 -0.2498660 -0.2498950 [385] -0.2499240 -0.2499530 -0.2499820 -0.2500110 -0.2500400 -0.2500690 [391] -0.2500980 -0.2501271 -0.2501561 -0.2501851 -0.2502142 -0.2502432 [397] -0.2502723 -0.2503013 -0.2503304 -0.2503594 -0.2503885 > mx [1] 0.2503885 > 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/1hka41261649954.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/2109i1261649954.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/3scip1261649954.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/43r8o1261649954.tab") > > try(system("convert tmp/1hka41261649954.ps tmp/1hka41261649954.png",intern=TRUE)) character(0) > try(system("convert tmp/2109i1261649954.ps tmp/2109i1261649954.png",intern=TRUE)) character(0) > try(system("convert tmp/3scip1261649954.ps tmp/3scip1261649954.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.770 0.492 0.945