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(60804,57907,54355,52536,49081,48877,64599,75314,71209,65210,59829,57656,57428,55315,52790,51050,48519,48354,65333,73990,72755,67424,59214,57427,56681,55437,53600,51641,49478,50124,71313,76208,74387,69520,64735,63413,62553,60109,57764,55667,53103,55301,76795,80928,79213,72759,67802,66940,66396,67539,67776,68014,68251,68488,68725,68962,69200,69437,68212,65444,63181,61198,59010,56388,53723,55340,75352,79817,78289,71892,66448,64167,61250,59580,56417,54662,53349,55385,73546,77683,74995,67282,60742,57283,57314,54704,51578,49962,46252,47234,64708,68753,62970,57474,52494,51831,51663,49637,46679,45557,41630,44417,60070,63157) > #'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.1713808 -0.1711953 -0.1710099 -0.1708246 -0.1706392 -0.1704539 [7] -0.1702687 -0.1700835 -0.1698984 -0.1697133 -0.1695283 -0.1693433 [13] -0.1691583 -0.1689734 -0.1687886 -0.1686038 -0.1684191 -0.1682344 [19] -0.1680498 -0.1678652 -0.1676807 -0.1674963 -0.1673119 -0.1671276 [25] -0.1669433 -0.1667591 -0.1665749 -0.1663908 -0.1662068 -0.1660228 [31] -0.1658389 -0.1656550 -0.1654712 -0.1652875 -0.1651038 -0.1649202 [37] -0.1647367 -0.1645532 -0.1643698 -0.1641864 -0.1640032 -0.1638200 [43] -0.1636368 -0.1634537 -0.1632707 -0.1630878 -0.1629050 -0.1627222 [49] -0.1625394 -0.1623568 -0.1621742 -0.1619917 -0.1618093 -0.1616269 [55] -0.1614447 -0.1612625 -0.1610803 -0.1608983 -0.1607163 -0.1605344 [61] -0.1603526 -0.1601708 -0.1599892 -0.1598076 -0.1596261 -0.1594447 [67] -0.1592633 -0.1590821 -0.1589009 -0.1587198 -0.1585388 -0.1583578 [73] -0.1581770 -0.1579962 -0.1578156 -0.1576350 -0.1574545 -0.1572741 [79] -0.1570937 -0.1569135 -0.1567333 -0.1565533 -0.1563733 -0.1561934 [85] -0.1560136 -0.1558339 -0.1556543 -0.1554748 -0.1552953 -0.1551160 [91] -0.1549367 -0.1547576 -0.1545785 -0.1543996 -0.1542207 -0.1540419 [97] -0.1538633 -0.1536847 -0.1535062 -0.1533278 -0.1531495 -0.1529713 [103] -0.1527932 -0.1526152 -0.1524373 -0.1522596 -0.1520819 -0.1519043 [109] -0.1517268 -0.1515494 -0.1513721 -0.1511949 -0.1510178 -0.1508409 [115] -0.1506640 -0.1504872 -0.1503106 -0.1501340 -0.1499576 -0.1497812 [121] -0.1496050 -0.1494289 -0.1492528 -0.1490769 -0.1489011 -0.1487254 [127] -0.1485498 -0.1483744 -0.1481990 -0.1480237 -0.1478486 -0.1476736 [133] -0.1474987 -0.1473238 -0.1471492 -0.1469746 -0.1468001 -0.1466257 [139] -0.1464515 -0.1462774 -0.1461034 -0.1459295 -0.1457557 -0.1455820 [145] -0.1454085 -0.1452351 -0.1450618 -0.1448886 -0.1447155 -0.1445426 [151] -0.1443697 -0.1441970 -0.1440244 -0.1438519 -0.1436796 -0.1435074 [157] -0.1433352 -0.1431633 -0.1429914 -0.1428196 -0.1426480 -0.1424765 [163] -0.1423052 -0.1421339 -0.1419628 -0.1417918 -0.1416209 -0.1414502 [169] -0.1412795 -0.1411090 -0.1409387 -0.1407684 -0.1405983 -0.1404283 [175] -0.1402585 -0.1400887 -0.1399191 -0.1397497 -0.1395803 -0.1394111 [181] -0.1392420 -0.1390731 -0.1389043 -0.1387356 -0.1385670 -0.1383986 [187] -0.1382303 -0.1380621 -0.1378941 -0.1377262 -0.1375584 -0.1373908 [193] -0.1372233 -0.1370559 -0.1368887 -0.1367216 -0.1365547 -0.1363878 [199] -0.1362212 -0.1360546 -0.1358882 -0.1357219 -0.1355558 -0.1353898 [205] -0.1352239 -0.1350582 -0.1348926 -0.1347272 -0.1345619 -0.1343967 [211] -0.1342317 -0.1340668 -0.1339020 -0.1337374 -0.1335730 -0.1334086 [217] -0.1332444 -0.1330804 -0.1329165 -0.1327527 -0.1325891 -0.1324256 [223] -0.1322623 -0.1320991 -0.1319361 -0.1317732 -0.1316104 -0.1314478 [229] -0.1312853 -0.1311230 -0.1309608 -0.1307988 -0.1306369 -0.1304751 [235] -0.1303135 -0.1301521 -0.1299908 -0.1298296 -0.1296686 -0.1295078 [241] -0.1293470 -0.1291865 -0.1290260 -0.1288658 -0.1287056 -0.1285457 [247] -0.1283858 -0.1282262 -0.1280666 -0.1279073 -0.1277480 -0.1275889 [253] -0.1274300 -0.1272712 -0.1271126 -0.1269541 -0.1267958 -0.1266376 [259] -0.1264796 -0.1263217 -0.1261640 -0.1260064 -0.1258490 -0.1256917 [265] -0.1255346 -0.1253777 -0.1252209 -0.1250642 -0.1249077 -0.1247514 [271] -0.1245952 -0.1244391 -0.1242832 -0.1241275 -0.1239719 -0.1238165 [277] -0.1236612 -0.1235061 -0.1233512 -0.1231964 -0.1230417 -0.1228872 [283] -0.1227329 -0.1225787 -0.1224247 -0.1222708 -0.1221171 -0.1219636 [289] -0.1218102 -0.1216570 -0.1215039 -0.1213510 -0.1211982 -0.1210456 [295] -0.1208931 -0.1207408 -0.1205887 -0.1204367 -0.1202849 -0.1201332 [301] -0.1199817 -0.1198304 -0.1196792 -0.1195282 -0.1193773 -0.1192266 [307] -0.1190761 -0.1189257 -0.1187755 -0.1186254 -0.1184755 -0.1183258 [313] -0.1181762 -0.1180268 -0.1178775 -0.1177284 -0.1175794 -0.1174307 [319] -0.1172820 -0.1171336 -0.1169853 -0.1168371 -0.1166892 -0.1165414 [325] -0.1163937 -0.1162462 -0.1160989 -0.1159517 -0.1158047 -0.1156579 [331] -0.1155112 -0.1153647 -0.1152183 -0.1150721 -0.1149261 -0.1147802 [337] -0.1146345 -0.1144890 -0.1143436 -0.1141984 -0.1140533 -0.1139084 [343] -0.1137637 -0.1136191 -0.1134747 -0.1133305 -0.1131864 -0.1130425 [349] -0.1128988 -0.1127552 -0.1126118 -0.1124685 -0.1123254 -0.1121825 [355] -0.1120398 -0.1118972 -0.1117547 -0.1116125 -0.1114703 -0.1113284 [361] -0.1111866 -0.1110450 -0.1109036 -0.1107623 -0.1106212 -0.1104802 [367] -0.1103394 -0.1101988 -0.1100584 -0.1099181 -0.1097779 -0.1096380 [373] -0.1094982 -0.1093586 -0.1092191 -0.1090798 -0.1089406 -0.1088017 [379] -0.1086629 -0.1085242 -0.1083858 -0.1082474 -0.1081093 -0.1079713 [385] -0.1078335 -0.1076959 -0.1075584 -0.1074211 -0.1072839 -0.1071469 [391] -0.1070101 -0.1068734 -0.1067369 -0.1066006 -0.1064645 -0.1063285 [397] -0.1061926 -0.1060570 -0.1059215 -0.1057862 -0.1056510 > 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/1v5j41229088540.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/2344k1229088540.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/37tom1229088540.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/4vm4g1229088540.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/5a7w91229088540.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/6ck831229088540.tab") > > system("convert tmp/1v5j41229088540.ps tmp/1v5j41229088540.png") > system("convert tmp/2344k1229088540.ps tmp/2344k1229088540.png") > system("convert tmp/37tom1229088540.ps tmp/37tom1229088540.png") > system("convert tmp/4vm4g1229088540.ps tmp/4vm4g1229088540.png") > system("convert tmp/5a7w91229088540.ps tmp/5a7w91229088540.png") > > > proc.time() user system elapsed 1.102 0.803 1.305