R version 2.7.2 (2008-08-25) 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. > x <- c(54.281,63.654,68.918,58.686,67.074,60.183,54.326,54.085,53.564,60.873,53.398,45.164,59.672,56.298,62.361,56.930,62.954,62.431,52.528,54.060,53.093,52.695,52.333,41.747,58.576,57.851,63.721,63.384,61.141,59.231,63.472,49.214,55.816,61.713,48.664,45.351,57.888,54.091,59.098,58.962,55.433,60.403,60.721,48.440,57.981,60.258,47.312,46.980,54.846,56.824,67.744,62.849,54.691,65.461,53.724,54.560,57.722,55.458,48.490,46.362) > #'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(qnorm(ppoints(x), mean=0, sd=1),x1) + if (mx < c[i]) + { + mx <- c[i] + mxli <- l[i] + } + } > c [1] -0.2055097 -0.2055734 -0.2056371 -0.2057005 -0.2057638 -0.2058270 [7] -0.2058900 -0.2059529 -0.2060156 -0.2060782 -0.2061406 -0.2062029 [13] -0.2062651 -0.2063271 -0.2063889 -0.2064506 -0.2065122 -0.2065736 [19] -0.2066349 -0.2066960 -0.2067570 -0.2068178 -0.2068785 -0.2069390 [25] -0.2069994 -0.2070597 -0.2071198 -0.2071797 -0.2072395 -0.2072992 [31] -0.2073587 -0.2074181 -0.2074773 -0.2075364 -0.2075953 -0.2076541 [37] -0.2077127 -0.2077712 -0.2078296 -0.2078878 -0.2079458 -0.2080037 [43] -0.2080615 -0.2081191 -0.2081766 -0.2082339 -0.2082911 -0.2083481 [49] -0.2084050 -0.2084618 -0.2085184 -0.2085748 -0.2086311 -0.2086873 [55] -0.2087433 -0.2087992 -0.2088549 -0.2089105 -0.2089659 -0.2090212 [61] -0.2090763 -0.2091313 -0.2091862 -0.2092409 -0.2092954 -0.2093498 [67] -0.2094041 -0.2094582 -0.2095122 -0.2095660 -0.2096197 -0.2096733 [73] -0.2097267 -0.2097799 -0.2098330 -0.2098860 -0.2099388 -0.2099915 [79] -0.2100440 -0.2100964 -0.2101486 -0.2102007 -0.2102527 -0.2103045 [85] -0.2103561 -0.2104077 -0.2104590 -0.2105102 -0.2105613 -0.2106123 [91] -0.2106631 -0.2107137 -0.2107642 -0.2108146 -0.2108648 -0.2109149 [97] -0.2109648 -0.2110146 -0.2110642 -0.2111137 -0.2111631 -0.2112123 [103] -0.2112613 -0.2113103 -0.2113590 -0.2114077 -0.2114562 -0.2115045 [109] -0.2115527 -0.2116008 -0.2116487 -0.2116965 -0.2117441 -0.2117916 [115] -0.2118389 -0.2118861 -0.2119332 -0.2119801 -0.2120269 -0.2120735 [121] -0.2121200 -0.2121664 -0.2122126 -0.2122586 -0.2123045 -0.2123503 [127] -0.2123960 -0.2124415 -0.2124868 -0.2125320 -0.2125771 -0.2126220 [133] -0.2126668 -0.2127114 -0.2127559 -0.2128003 -0.2128445 -0.2128886 [139] -0.2129325 -0.2129763 -0.2130200 -0.2130635 -0.2131069 -0.2131501 [145] -0.2131932 -0.2132361 -0.2132790 -0.2133216 -0.2133642 -0.2134065 [151] -0.2134488 -0.2134909 -0.2135329 -0.2135747 -0.2136164 -0.2136579 [157] -0.2136993 -0.2137406 -0.2137817 -0.2138227 -0.2138636 -0.2139043 [163] -0.2139449 -0.2139853 -0.2140256 -0.2140658 -0.2141058 -0.2141457 [169] -0.2141854 -0.2142250 -0.2142645 -0.2143038 -0.2143430 -0.2143820 [175] -0.2144210 -0.2144597 -0.2144984 -0.2145369 -0.2145752 -0.2146134 [181] -0.2146515 -0.2146895 -0.2147273 -0.2147650 -0.2148025 -0.2148399 [187] -0.2148772 -0.2149143 -0.2149513 -0.2149882 -0.2150249 -0.2150615 [193] -0.2150979 -0.2151342 -0.2151704 -0.2152064 -0.2152423 -0.2152781 [199] -0.2153137 -0.2153492 -0.2153846 -0.2154198 -0.2154549 -0.2154899 [205] -0.2155247 -0.2155594 -0.2155940 -0.2156284 -0.2156627 -0.2156968 [211] -0.2157308 -0.2157647 -0.2157985 -0.2158321 -0.2158656 -0.2158989 [217] -0.2159321 -0.2159652 -0.2159982 -0.2160310 -0.2160637 -0.2160962 [223] -0.2161287 -0.2161609 -0.2161931 -0.2162251 -0.2162570 -0.2162888 [229] -0.2163204 -0.2163519 -0.2163833 -0.2164145 -0.2164456 -0.2164766 [235] -0.2165074 -0.2165381 -0.2165687 -0.2165992 -0.2166295 -0.2166597 [241] -0.2166897 -0.2167197 -0.2167495 -0.2167791 -0.2168087 -0.2168381 [247] -0.2168674 -0.2168965 -0.2169255 -0.2169544 -0.2169832 -0.2170118 [253] -0.2170403 -0.2170687 -0.2170970 -0.2171251 -0.2171531 -0.2171809 [259] -0.2172087 -0.2172363 -0.2172638 -0.2172911 -0.2173184 -0.2173455 [265] -0.2173725 -0.2173993 -0.2174260 -0.2174526 -0.2174791 -0.2175054 [271] -0.2175317 -0.2175578 -0.2175837 -0.2176096 -0.2176353 -0.2176609 [277] -0.2176863 -0.2177117 -0.2177369 -0.2177620 -0.2177870 -0.2178118 [283] -0.2178365 -0.2178611 -0.2178856 -0.2179099 -0.2179342 -0.2179583 [289] -0.2179822 -0.2180061 -0.2180298 -0.2180534 -0.2180769 -0.2181003 [295] -0.2181235 -0.2181466 -0.2181696 -0.2181925 -0.2182153 -0.2182379 [301] -0.2182604 -0.2182828 -0.2183051 -0.2183272 -0.2183493 -0.2183712 [307] -0.2183930 -0.2184146 -0.2184362 -0.2184576 -0.2184789 -0.2185001 [313] -0.2185212 -0.2185421 -0.2185629 -0.2185836 -0.2186042 -0.2186247 [319] -0.2186451 -0.2186653 -0.2186854 -0.2187054 -0.2187253 -0.2187451 [325] -0.2187647 -0.2187842 -0.2188037 -0.2188230 -0.2188421 -0.2188612 [331] -0.2188801 -0.2188990 -0.2189177 -0.2189363 -0.2189548 -0.2189731 [337] -0.2189914 -0.2190095 -0.2190275 -0.2190454 -0.2190632 -0.2190809 [343] -0.2190985 -0.2191159 -0.2191332 -0.2191505 -0.2191676 -0.2191846 [349] -0.2192014 -0.2192182 -0.2192349 -0.2192514 -0.2192678 -0.2192841 [355] -0.2193003 -0.2193164 -0.2193324 -0.2193483 -0.2193640 -0.2193797 [361] -0.2193952 -0.2194106 -0.2194259 -0.2194411 -0.2194562 -0.2194712 [367] -0.2194861 -0.2195008 -0.2195155 -0.2195300 -0.2195444 -0.2195587 [373] -0.2195729 -0.2195870 -0.2196010 -0.2196149 -0.2196287 -0.2196424 [379] -0.2196559 -0.2196694 -0.2196827 -0.2196959 -0.2197091 -0.2197221 [385] -0.2197350 -0.2197478 -0.2197605 -0.2197731 -0.2197856 -0.2197979 [391] -0.2198102 -0.2198224 -0.2198344 -0.2198464 -0.2198582 -0.2198700 [397] -0.2198816 -0.2198932 -0.2199046 -0.2199159 -0.2199271 > mx [1] 0 > mxli [1] -999 > if (mxli != 0) + { + x1 <- (x^mxli - 1) / mxli + } else { + x1 <- log(x) + } > postscript(file="/var/www/html/rcomp/tmp/1pf4n1226416319.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(l,c,main='Box-Cox Normality Plot',xlab='Lambda',ylab='correlation') > mtext(paste('Optimal Lambda =',mxli)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/24wav1226416319.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(x,main='Histogram of Original Data',xlab='X',ylab='frequency') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3iqfg1226416319.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(x1,main='Histogram of Transformed Data',xlab='X',ylab='frequency') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4dx9o1226416319.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(x) > qqline(x) > grid() > mtext('Original Data') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5qoxl1226416319.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(x1) > qqline(x1) > grid() > mtext('Transformed Data') > 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 Normality 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',header=TRUE) > a<-table.element(a,mxli) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/64wkv1226416319.tab") > > system("convert tmp/1pf4n1226416319.ps tmp/1pf4n1226416319.png") > system("convert tmp/24wav1226416319.ps tmp/24wav1226416319.png") > system("convert tmp/3iqfg1226416319.ps tmp/3iqfg1226416319.png") > system("convert tmp/4dx9o1226416319.ps tmp/4dx9o1226416319.png") > system("convert tmp/5qoxl1226416319.ps tmp/5qoxl1226416319.png") > > > proc.time() user system elapsed 1.342 0.825 2.453