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. > x <- c(112.39,97.59,142.30,120.79,121.24,104.61,119.86,117.81,91.86,117.37,112.84,101.95,120.52,102.84,137.41,118.97,125.01,118.57,130.61,116.30,99.15,110.26,107.59,107.01,113.77,93.33,147.32,124.48,106.79,134.39,111.41,132.43,98.26,109.81,115.28,108.97,99.19,105.46,138.97,124.52,117.37,123.86,116.39,124.70,97.46,103.24,112.39,107.19,100.53,95.73,143.54,101.99,120.66,121.46,102.97,121.32,85.02,106.21,110.39,87.10) > #'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.2390190 -0.2388962 -0.2387733 -0.2386504 -0.2385273 -0.2384042 [7] -0.2382811 -0.2381578 -0.2380345 -0.2379111 -0.2377876 -0.2376641 [13] -0.2375404 -0.2374167 -0.2372930 -0.2371691 -0.2370452 -0.2369212 [19] -0.2367971 -0.2366730 -0.2365488 -0.2364245 -0.2363001 -0.2361757 [25] -0.2360512 -0.2359266 -0.2358020 -0.2356773 -0.2355525 -0.2354276 [31] -0.2353027 -0.2351777 -0.2350527 -0.2349275 -0.2348023 -0.2346770 [37] -0.2345517 -0.2344263 -0.2343008 -0.2341752 -0.2340496 -0.2339239 [43] -0.2337982 -0.2336724 -0.2335465 -0.2334205 -0.2332945 -0.2331684 [49] -0.2330423 -0.2329160 -0.2327897 -0.2326634 -0.2325370 -0.2324105 [55] -0.2322839 -0.2321573 -0.2320306 -0.2319039 -0.2317771 -0.2316502 [61] -0.2315233 -0.2313963 -0.2312692 -0.2311421 -0.2310149 -0.2308877 [67] -0.2307603 -0.2306330 -0.2305055 -0.2303780 -0.2302505 -0.2301228 [73] -0.2299952 -0.2298674 -0.2297396 -0.2296117 -0.2294838 -0.2293558 [79] -0.2292278 -0.2290997 -0.2289715 -0.2288433 -0.2287150 -0.2285867 [85] -0.2284583 -0.2283298 -0.2282013 -0.2280727 -0.2279441 -0.2278154 [91] -0.2276867 -0.2275579 -0.2274290 -0.2273001 -0.2271711 -0.2270421 [97] -0.2269130 -0.2267839 -0.2266547 -0.2265255 -0.2263962 -0.2262668 [103] -0.2261374 -0.2260080 -0.2258785 -0.2257489 -0.2256193 -0.2254896 [109] -0.2253599 -0.2252301 -0.2251003 -0.2249704 -0.2248405 -0.2247105 [115] -0.2245804 -0.2244503 -0.2243202 -0.2241900 -0.2240598 -0.2239295 [121] -0.2237992 -0.2236688 -0.2235383 -0.2234079 -0.2232773 -0.2231468 [127] -0.2230161 -0.2228854 -0.2227547 -0.2226240 -0.2224931 -0.2223623 [133] -0.2222314 -0.2221004 -0.2219694 -0.2218383 -0.2217072 -0.2215761 [139] -0.2214449 -0.2213137 -0.2211824 -0.2210511 -0.2209197 -0.2207883 [145] -0.2206569 -0.2205254 -0.2203938 -0.2202623 -0.2201306 -0.2199990 [151] -0.2198673 -0.2197355 -0.2196037 -0.2194719 -0.2193400 -0.2192081 [157] -0.2190761 -0.2189441 -0.2188121 -0.2186800 -0.2185479 -0.2184157 [163] -0.2182836 -0.2181513 -0.2180190 -0.2178867 -0.2177544 -0.2176220 [169] -0.2174896 -0.2173571 -0.2172246 -0.2170921 -0.2169595 -0.2168269 [175] -0.2166943 -0.2165616 -0.2164289 -0.2162961 -0.2161633 -0.2160305 [181] -0.2158977 -0.2157648 -0.2156318 -0.2154989 -0.2153659 -0.2152329 [187] -0.2150998 -0.2149667 -0.2148336 -0.2147005 -0.2145673 -0.2144341 [193] -0.2143008 -0.2141675 -0.2140342 -0.2139009 -0.2137675 -0.2136341 [199] -0.2135007 -0.2133672 -0.2132337 -0.2131002 -0.2129667 -0.2128331 [205] -0.2126995 -0.2125659 -0.2124322 -0.2122985 -0.2121648 -0.2120311 [211] -0.2118973 -0.2117635 -0.2116297 -0.2114958 -0.2113620 -0.2112281 [217] -0.2110941 -0.2109602 -0.2108262 -0.2106922 -0.2105582 -0.2104242 [223] -0.2102901 -0.2101560 -0.2100219 -0.2098877 -0.2097536 -0.2096194 [229] -0.2094852 -0.2093510 -0.2092167 -0.2090825 -0.2089482 -0.2088139 [235] -0.2086795 -0.2085452 -0.2084108 -0.2082764 -0.2081420 -0.2080076 [241] -0.2078731 -0.2077387 -0.2076042 -0.2074697 -0.2073352 -0.2072006 [247] -0.2070661 -0.2069315 -0.2067969 -0.2066623 -0.2065277 -0.2063931 [253] -0.2062584 -0.2061238 -0.2059891 -0.2058544 -0.2057197 -0.2055849 [259] -0.2054502 -0.2053154 -0.2051807 -0.2050459 -0.2049111 -0.2047763 [265] -0.2046415 -0.2045067 -0.2043718 -0.2042370 -0.2041021 -0.2039672 [271] -0.2038323 -0.2036974 -0.2035625 -0.2034276 -0.2032927 -0.2031577 [277] -0.2030228 -0.2028878 -0.2027529 -0.2026179 -0.2024829 -0.2023479 [283] -0.2022129 -0.2020779 -0.2019429 -0.2018079 -0.2016729 -0.2015378 [289] -0.2014028 -0.2012678 -0.2011327 -0.2009977 -0.2008626 -0.2007275 [295] -0.2005925 -0.2004574 -0.2003223 -0.2001872 -0.2000522 -0.1999171 [301] -0.1997820 -0.1996469 -0.1995118 -0.1993767 -0.1992416 -0.1991065 [307] -0.1989714 -0.1988363 -0.1987012 -0.1985661 -0.1984310 -0.1982959 [313] -0.1981608 -0.1980257 -0.1978906 -0.1977555 -0.1976204 -0.1974853 [319] -0.1973502 -0.1972151 -0.1970800 -0.1969449 -0.1968098 -0.1966747 [325] -0.1965396 -0.1964045 -0.1962695 -0.1961344 -0.1959993 -0.1958643 [331] -0.1957292 -0.1955942 -0.1954591 -0.1953241 -0.1951890 -0.1950540 [337] -0.1949190 -0.1947840 -0.1946490 -0.1945140 -0.1943790 -0.1942440 [343] -0.1941090 -0.1939740 -0.1938391 -0.1937041 -0.1935692 -0.1934343 [349] -0.1932993 -0.1931644 -0.1930295 -0.1928946 -0.1927597 -0.1926249 [355] -0.1924900 -0.1923552 -0.1922203 -0.1920855 -0.1919507 -0.1918159 [361] -0.1916811 -0.1915463 -0.1914115 -0.1912768 -0.1911421 -0.1910073 [367] -0.1908726 -0.1907379 -0.1906033 -0.1904686 -0.1903340 -0.1901993 [373] -0.1900647 -0.1899301 -0.1897955 -0.1896609 -0.1895264 -0.1893919 [379] -0.1892573 -0.1891228 -0.1889884 -0.1888539 -0.1887194 -0.1885850 [385] -0.1884506 -0.1883162 -0.1881818 -0.1880475 -0.1879132 -0.1877789 [391] -0.1876446 -0.1875103 -0.1873760 -0.1872418 -0.1871076 -0.1869734 [397] -0.1868392 -0.1867051 -0.1865710 -0.1864369 -0.1863028 > 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/1i31l1258122114.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/2ltvh1258122114.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/3ulcq1258122114.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/45yz01258122114.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/5ao9x1258122114.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/6y9411258122114.tab") > system("convert tmp/1i31l1258122114.ps tmp/1i31l1258122114.png") > system("convert tmp/2ltvh1258122114.ps tmp/2ltvh1258122114.png") > system("convert tmp/3ulcq1258122114.ps tmp/3ulcq1258122114.png") > system("convert tmp/45yz01258122114.ps tmp/45yz01258122114.png") > system("convert tmp/5ao9x1258122114.ps tmp/5ao9x1258122114.png") > > > proc.time() user system elapsed 1.093 0.788 1.293