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(1.2413,1.2758,1.2729,1.2695,1.2858,1.2741,1.2823,1.2588,1.2856,1.2619,1.2590,1.2865,1.2667,1.2505,1.2205,1.2220,1.1990,1.1583,1.1931,1.2028,1.1802,1.2084,1.1996,1.1870,1.2013,1.2120,1.2133,1.1866,1.2067,1.2240,1.2566,1.2608,1.3005,1.2955,1.2500,1.3158,1.3358,1.2817,1.2707,1.2595,1.3182,1.2665,1.2715,1.3041,1.3106,1.2911,1.2233,1.1438,0.9895,1.9903,0.9967,0.9708,0.9946,1.0441,1.0757,1.1461,1.1749,1.1926,1.2109) > #'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.3378298 -0.3374989 -0.3371666 -0.3368331 -0.3364983 -0.3361622 [7] -0.3358249 -0.3354862 -0.3351462 -0.3348050 -0.3344624 -0.3341186 [13] -0.3337734 -0.3334270 -0.3330792 -0.3327301 -0.3323798 -0.3320281 [19] -0.3316750 -0.3313207 -0.3309650 -0.3306081 -0.3302498 -0.3298901 [25] -0.3295292 -0.3291669 -0.3288033 -0.3284383 -0.3280720 -0.3277044 [31] -0.3273354 -0.3269651 -0.3265934 -0.3262204 -0.3258460 -0.3254703 [37] -0.3250933 -0.3247149 -0.3243351 -0.3239539 -0.3235714 -0.3231876 [43] -0.3228024 -0.3224158 -0.3220278 -0.3216385 -0.3212478 -0.3208558 [49] -0.3204623 -0.3200675 -0.3196713 -0.3192738 -0.3188748 -0.3184745 [55] -0.3180728 -0.3176697 -0.3172652 -0.3168593 -0.3164521 -0.3160435 [61] -0.3156334 -0.3152220 -0.3148092 -0.3143950 -0.3139794 -0.3135624 [67] -0.3131440 -0.3127242 -0.3123030 -0.3118804 -0.3114564 -0.3110311 [73] -0.3106043 -0.3101761 -0.3097465 -0.3093155 -0.3088831 -0.3084492 [79] -0.3080140 -0.3075774 -0.3071393 -0.3066999 -0.3062590 -0.3058168 [85] -0.3053731 -0.3049280 -0.3044815 -0.3040336 -0.3035843 -0.3031336 [91] -0.3026814 -0.3022279 -0.3017729 -0.3013165 -0.3008588 -0.3003996 [97] -0.2999389 -0.2994769 -0.2990135 -0.2985486 -0.2980824 -0.2976147 [103] -0.2971456 -0.2966751 -0.2962032 -0.2957299 -0.2952552 -0.2947791 [109] -0.2943015 -0.2938226 -0.2933422 -0.2928605 -0.2923773 -0.2918927 [115] -0.2914068 -0.2909194 -0.2904306 -0.2899404 -0.2894488 -0.2889559 [121] -0.2884615 -0.2879657 -0.2874685 -0.2869699 -0.2864700 -0.2859686 [127] -0.2854659 -0.2849617 -0.2844562 -0.2839493 -0.2834410 -0.2829313 [133] -0.2824203 -0.2819078 -0.2813940 -0.2808788 -0.2803622 -0.2798443 [139] -0.2793250 -0.2788043 -0.2782823 -0.2777588 -0.2772341 -0.2767079 [145] -0.2761804 -0.2756516 -0.2751214 -0.2745898 -0.2740569 -0.2735227 [151] -0.2729871 -0.2724501 -0.2719118 -0.2713722 -0.2708313 -0.2702890 [157] -0.2697454 -0.2692005 -0.2686543 -0.2681067 -0.2675578 -0.2670076 [163] -0.2664561 -0.2659033 -0.2653492 -0.2647938 -0.2642371 -0.2636791 [169] -0.2631199 -0.2625593 -0.2619974 -0.2614343 -0.2608699 -0.2603043 [175] -0.2597373 -0.2591691 -0.2585997 -0.2580290 -0.2574570 -0.2568838 [181] -0.2563094 -0.2557337 -0.2551568 -0.2545787 -0.2539993 -0.2534187 [187] -0.2528369 -0.2522539 -0.2516697 -0.2510843 -0.2504977 -0.2499099 [193] -0.2493209 -0.2487307 -0.2481394 -0.2475468 -0.2469531 -0.2463583 [199] -0.2457623 -0.2451651 -0.2445668 -0.2439674 -0.2433668 -0.2427651 [205] -0.2421622 -0.2415583 -0.2409532 -0.2403470 -0.2397398 -0.2391314 [211] -0.2385219 -0.2379114 -0.2372998 -0.2366871 -0.2360733 -0.2354585 [217] -0.2348426 -0.2342256 -0.2336077 -0.2329887 -0.2323686 -0.2317476 [223] -0.2311255 -0.2305024 -0.2298783 -0.2292532 -0.2286272 -0.2280001 [229] -0.2273721 -0.2267431 -0.2261131 -0.2254822 -0.2248503 -0.2242175 [235] -0.2235837 -0.2229490 -0.2223134 -0.2216769 -0.2210395 -0.2204012 [241] -0.2197620 -0.2191219 -0.2184809 -0.2178390 -0.2171963 -0.2165528 [247] -0.2159084 -0.2152631 -0.2146170 -0.2139701 -0.2133224 -0.2126739 [253] -0.2120245 -0.2113744 -0.2107235 -0.2100718 -0.2094194 -0.2087661 [259] -0.2081122 -0.2074575 -0.2068020 -0.2061458 -0.2054889 -0.2048313 [265] -0.2041730 -0.2035140 -0.2028543 -0.2021939 -0.2015329 -0.2008712 [271] -0.2002088 -0.1995458 -0.1988821 -0.1982179 -0.1975530 -0.1968875 [277] -0.1962214 -0.1955547 -0.1948874 -0.1942195 -0.1935511 -0.1928821 [283] -0.1922126 -0.1915425 -0.1908719 -0.1902008 -0.1895292 -0.1888571 [289] -0.1881844 -0.1875113 -0.1868377 -0.1861636 -0.1854891 -0.1848142 [295] -0.1841387 -0.1834629 -0.1827866 -0.1821100 -0.1814329 -0.1807554 [301] -0.1800776 -0.1793993 -0.1787207 -0.1780418 -0.1773625 -0.1766828 [307] -0.1760028 -0.1753226 -0.1746420 -0.1739610 -0.1732799 -0.1725984 [313] -0.1719166 -0.1712346 -0.1705524 -0.1698699 -0.1691871 -0.1685041 [319] -0.1678210 -0.1671376 -0.1664540 -0.1657702 -0.1650863 -0.1644022 [325] -0.1637179 -0.1630335 -0.1623489 -0.1616642 -0.1609794 -0.1602945 [331] -0.1596095 -0.1589243 -0.1582391 -0.1575539 -0.1568685 -0.1561832 [337] -0.1554977 -0.1548123 -0.1541268 -0.1534413 -0.1527558 -0.1520703 [343] -0.1513848 -0.1506993 -0.1500139 -0.1493285 -0.1486431 -0.1479578 [349] -0.1472726 -0.1465875 -0.1459024 -0.1452175 -0.1445327 -0.1438479 [355] -0.1431633 -0.1424789 -0.1417946 -0.1411104 -0.1404264 -0.1397426 [361] -0.1390590 -0.1383755 -0.1376923 -0.1370092 -0.1363264 -0.1356438 [367] -0.1349615 -0.1342794 -0.1335975 -0.1329159 -0.1322346 -0.1315536 [373] -0.1308729 -0.1301924 -0.1295123 -0.1288325 -0.1281530 -0.1274739 [379] -0.1267951 -0.1261167 -0.1254386 -0.1247609 -0.1240836 -0.1234066 [385] -0.1227301 -0.1220540 -0.1213783 -0.1207030 -0.1200282 -0.1193537 [391] -0.1186798 -0.1180063 -0.1173333 -0.1166607 -0.1159886 -0.1153170 [397] -0.1146460 -0.1139754 -0.1133053 -0.1126358 -0.1119668 > 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/1kegj1257508664.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/292qh1257508664.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/37x9j1257508664.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/4aiu01257508664.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/5r44h1257508664.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/6gf0d1257508664.tab") > > system("convert tmp/1kegj1257508664.ps tmp/1kegj1257508664.png") > system("convert tmp/292qh1257508664.ps tmp/292qh1257508664.png") > system("convert tmp/37x9j1257508664.ps tmp/37x9j1257508664.png") > system("convert tmp/4aiu01257508664.ps tmp/4aiu01257508664.png") > system("convert tmp/5r44h1257508664.ps tmp/5r44h1257508664.png") > > > proc.time() user system elapsed 1.068 0.781 1.335