R version 2.8.0 (2008-10-20) 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(267413,267366,264777,258863,254844,254868,277267,285351,286602,283042,276687,277915,277128,277103,275037,270150,267140,264993,287259,291186,292300,288186,281477,282656,280190,280408,276836,275216,274352,271311,289802,290726,292300,278506,269826,265861,269034,264176,255198,253353,246057,235372,258556,260993,254663,250643,243422,247105,248541,245039,237080,237085,225554,226839,247934,248333,246969,245098,246263,255765,264319,268347,273046,273963,267430,271993,292710,295881,293299) > #'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.2331023 -0.2330288 -0.2329494 -0.2328698 -0.2327940 -0.2327196 [7] -0.2326434 -0.2325646 -0.2324876 -0.2324079 -0.2323305 -0.2322558 [13] -0.2321756 -0.2320976 -0.2320201 -0.2319415 -0.2318634 -0.2317845 [19] -0.2317059 -0.2316273 -0.2315491 -0.2314703 -0.2313921 -0.2313128 [25] -0.2312336 -0.2311550 -0.2310758 -0.2309971 -0.2309176 -0.2308381 [31] -0.2307588 -0.2306793 -0.2305997 -0.2305201 -0.2304404 -0.2303607 [37] -0.2302807 -0.2302008 -0.2301207 -0.2300407 -0.2299604 -0.2298801 [43] -0.2297998 -0.2297194 -0.2296388 -0.2295582 -0.2294776 -0.2293968 [49] -0.2293159 -0.2292350 -0.2291540 -0.2290730 -0.2289918 -0.2289106 [55] -0.2288293 -0.2287479 -0.2286664 -0.2285848 -0.2285032 -0.2284215 [61] -0.2283397 -0.2282578 -0.2281759 -0.2280938 -0.2280117 -0.2279295 [67] -0.2278473 -0.2277649 -0.2276825 -0.2276000 -0.2275174 -0.2274348 [73] -0.2273520 -0.2272692 -0.2271863 -0.2271034 -0.2270203 -0.2269372 [79] -0.2268540 -0.2267707 -0.2266873 -0.2266039 -0.2265204 -0.2264368 [85] -0.2263531 -0.2262694 -0.2261855 -0.2261016 -0.2260177 -0.2259336 [91] -0.2258495 -0.2257653 -0.2256810 -0.2255966 -0.2255122 -0.2254276 [97] -0.2253430 -0.2252584 -0.2251736 -0.2250888 -0.2250039 -0.2249189 [103] -0.2248339 -0.2247487 -0.2246635 -0.2245782 -0.2244929 -0.2244074 [109] -0.2243219 -0.2242363 -0.2241507 -0.2240649 -0.2239791 -0.2238932 [115] -0.2238073 -0.2237212 -0.2236351 -0.2235489 -0.2234626 -0.2233763 [121] -0.2232899 -0.2232034 -0.2231168 -0.2230302 -0.2229435 -0.2228567 [127] -0.2227698 -0.2226829 -0.2225958 -0.2225088 -0.2224216 -0.2223344 [133] -0.2222470 -0.2221597 -0.2220722 -0.2219847 -0.2218970 -0.2218094 [139] -0.2217216 -0.2216338 -0.2215459 -0.2214579 -0.2213698 -0.2212817 [145] -0.2211935 -0.2211052 -0.2210169 -0.2209285 -0.2208400 -0.2207514 [151] -0.2206628 -0.2205741 -0.2204853 -0.2203964 -0.2203075 -0.2202185 [157] -0.2201294 -0.2200403 -0.2199511 -0.2198618 -0.2197724 -0.2196830 [163] -0.2195934 -0.2195039 -0.2194142 -0.2193245 -0.2192347 -0.2191448 [169] -0.2190549 -0.2189649 -0.2188748 -0.2187846 -0.2186944 -0.2186041 [175] -0.2185137 -0.2184233 -0.2183328 -0.2182422 -0.2181516 -0.2180608 [181] -0.2179700 -0.2178792 -0.2177882 -0.2176972 -0.2176062 -0.2175150 [187] -0.2174238 -0.2173325 -0.2172411 -0.2171497 -0.2170582 -0.2169666 [193] -0.2168750 -0.2167833 -0.2166915 -0.2165997 -0.2165077 -0.2164158 [199] -0.2163237 -0.2162316 -0.2161394 -0.2160471 -0.2159548 -0.2158624 [205] -0.2157699 -0.2156774 -0.2155848 -0.2154921 -0.2153993 -0.2153065 [211] -0.2152136 -0.2151207 -0.2150276 -0.2149346 -0.2148414 -0.2147482 [217] -0.2146549 -0.2145615 -0.2144681 -0.2143746 -0.2142810 -0.2141874 [223] -0.2140937 -0.2139999 -0.2139061 -0.2138122 -0.2137182 -0.2136241 [229] -0.2135300 -0.2134359 -0.2133416 -0.2132473 -0.2131529 -0.2130585 [235] -0.2129640 -0.2128694 -0.2127748 -0.2126801 -0.2125853 -0.2124904 [241] -0.2123955 -0.2123006 -0.2122055 -0.2121104 -0.2120152 -0.2119200 [247] -0.2118247 -0.2117293 -0.2116339 -0.2115384 -0.2114428 -0.2113472 [253] -0.2112515 -0.2111557 -0.2110599 -0.2109640 -0.2108680 -0.2107720 [259] -0.2106759 -0.2105798 -0.2104835 -0.2103873 -0.2102909 -0.2101945 [265] -0.2100980 -0.2100015 -0.2099049 -0.2098082 -0.2097115 -0.2096147 [271] -0.2095178 -0.2094209 -0.2093239 -0.2092268 -0.2091297 -0.2090325 [277] -0.2089353 -0.2088380 -0.2087406 -0.2086432 -0.2085457 -0.2084481 [283] -0.2083505 -0.2082528 -0.2081550 -0.2080572 -0.2079593 -0.2078614 [289] -0.2077634 -0.2076653 -0.2075672 -0.2074690 -0.2073708 -0.2072724 [295] -0.2071741 -0.2070756 -0.2069771 -0.2068786 -0.2067799 -0.2066813 [301] -0.2065825 -0.2064837 -0.2063848 -0.2062859 -0.2061869 -0.2060878 [307] -0.2059887 -0.2058895 -0.2057903 -0.2056910 -0.2055916 -0.2054922 [313] -0.2053927 -0.2052932 -0.2051936 -0.2050939 -0.2049942 -0.2048944 [319] -0.2047946 -0.2046947 -0.2045947 -0.2044947 -0.2043946 -0.2042945 [325] -0.2041943 -0.2040940 -0.2039937 -0.2038933 -0.2037928 -0.2036923 [331] -0.2035918 -0.2034911 -0.2033905 -0.2032897 -0.2031889 -0.2030881 [337] -0.2029872 -0.2028862 -0.2027852 -0.2026841 -0.2025829 -0.2024817 [343] -0.2023804 -0.2022791 -0.2021777 -0.2020763 -0.2019748 -0.2018732 [349] -0.2017716 -0.2016699 -0.2015682 -0.2014664 -0.2013646 -0.2012627 [355] -0.2011607 -0.2010587 -0.2009566 -0.2008545 -0.2007523 -0.2006500 [361] -0.2005477 -0.2004454 -0.2003430 -0.2002405 -0.2001380 -0.2000354 [367] -0.1999327 -0.1998300 -0.1997273 -0.1996245 -0.1995216 -0.1994187 [373] -0.1993157 -0.1992126 -0.1991096 -0.1990064 -0.1989032 -0.1987999 [379] -0.1986966 -0.1985933 -0.1984898 -0.1983864 -0.1982828 -0.1981792 [385] -0.1980756 -0.1979719 -0.1978681 -0.1977643 -0.1976605 -0.1975565 [391] -0.1974526 -0.1973485 -0.1972445 -0.1971403 -0.1970361 -0.1969319 [397] -0.1968276 -0.1967232 -0.1966188 -0.1965144 -0.1964098 > mx [1] 0 > mxli [1] -999 > if (mxli != 0) + { + x1 <- (x^mxli - 1) / mxli + } else { + x1 <- log(x) + } > postscript(file="/var/www/html/freestat/rcomp/tmp/16hwk1258048760.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/freestat/rcomp/tmp/2p3i31258048760.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/freestat/rcomp/tmp/3xedd1258048760.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/freestat/rcomp/tmp/49gb41258048760.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/freestat/rcomp/tmp/554081258048760.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/6h0jv1258048760.tab") > > system("convert tmp/16hwk1258048760.ps tmp/16hwk1258048760.png") > system("convert tmp/2p3i31258048760.ps tmp/2p3i31258048760.png") > system("convert tmp/3xedd1258048760.ps tmp/3xedd1258048760.png") > system("convert tmp/49gb41258048760.ps tmp/49gb41258048760.png") > system("convert tmp/554081258048760.ps tmp/554081258048760.png") > > > proc.time() user system elapsed 1.751 1.324 2.046