R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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 <- array(list(1418 + ,30 + ,112285 + ,145 + ,0 + ,869 + ,28 + ,84786 + ,101 + ,0 + ,1530 + ,38 + ,83123 + ,98 + ,0 + ,2172 + ,30 + ,101193 + ,132 + ,0 + ,901 + ,22 + ,38361 + ,60 + ,0 + ,463 + ,26 + ,68504 + ,38 + ,0 + ,3201 + ,25 + ,119182 + ,144 + ,0 + ,371 + ,18 + ,22807 + ,5 + ,0 + ,1192 + ,11 + ,17140 + ,28 + ,1 + ,1583 + ,26 + ,116174 + ,84 + ,0 + ,1439 + ,25 + ,57635 + ,79 + ,0 + ,1764 + ,38 + ,66198 + ,127 + ,0 + ,1495 + ,44 + ,71701 + ,78 + ,0 + ,1373 + ,30 + ,57793 + ,60 + ,0 + ,2187 + ,40 + ,80444 + ,131 + ,0 + ,1491 + ,34 + ,53855 + ,84 + ,0 + ,4041 + ,47 + ,97668 + ,133 + ,0 + ,1706 + ,30 + ,133824 + ,150 + ,0 + ,2152 + ,31 + ,101481 + ,91 + ,0 + ,1036 + ,23 + ,99645 + ,132 + ,0 + ,1882 + ,36 + ,114789 + ,136 + ,0 + ,1929 + ,36 + ,99052 + ,124 + ,0 + ,2242 + ,30 + ,67654 + ,118 + ,0 + ,1220 + ,25 + ,65553 + ,70 + ,0 + ,1289 + ,39 + ,97500 + ,107 + ,0 + ,2515 + ,34 + ,69112 + ,119 + ,0 + ,2147 + ,31 + ,82753 + ,89 + ,0 + ,2352 + ,31 + ,85323 + ,112 + ,0 + ,1638 + ,33 + ,72654 + ,108 + ,0 + ,1222 + ,25 + ,30727 + ,52 + ,0 + ,1812 + ,33 + ,77873 + ,112 + ,0 + ,1677 + ,35 + ,117478 + ,116 + ,0 + ,1579 + ,42 + ,74007 + ,123 + ,0 + ,1731 + ,43 + ,90183 + ,125 + ,0 + ,807 + ,30 + ,61542 + ,27 + ,0 + ,2452 + ,33 + ,101494 + ,162 + ,0 + ,829 + ,13 + ,27570 + ,32 + ,1 + ,1940 + ,32 + ,55813 + ,64 + ,0 + ,2662 + ,36 + ,79215 + ,92 + ,0 + ,186 + ,0 + ,1423 + ,0 + ,1 + ,1499 + ,28 + ,55461 + ,83 + ,0 + ,865 + ,14 + ,31081 + ,41 + ,0 + ,1793 + ,17 + ,22996 + ,47 + ,1 + ,2527 + ,32 + ,83122 + ,120 + ,0 + ,2747 + ,30 + ,70106 + ,105 + ,0 + ,1324 + ,35 + ,60578 + ,79 + ,0 + ,2702 + ,20 + ,39992 + ,65 + ,1 + ,1383 + ,28 + ,79892 + ,70 + ,0 + ,1179 + ,28 + ,49810 + ,55 + ,0 + ,2099 + ,39 + ,71570 + ,39 + ,0 + ,4308 + ,34 + ,100708 + ,67 + ,0 + ,918 + ,26 + ,33032 + ,21 + ,0 + ,1831 + ,39 + ,82875 + ,127 + ,0 + ,3373 + ,39 + ,139077 + ,152 + ,0 + ,1713 + ,33 + ,71595 + ,113 + ,0 + ,1438 + ,28 + ,72260 + ,99 + ,0 + ,496 + ,4 + ,5950 + ,7 + ,0 + ,2253 + ,39 + ,115762 + ,141 + ,0 + ,744 + ,18 + ,32551 + ,21 + ,0 + ,1161 + ,14 + ,31701 + ,35 + ,0 + ,2352 + ,29 + ,80670 + ,109 + ,0 + ,2144 + ,44 + ,143558 + ,133 + ,0 + ,4691 + ,21 + ,117105 + ,123 + ,1 + ,1112 + ,16 + ,23789 + ,26 + ,1 + ,2694 + ,28 + ,120733 + ,230 + ,0 + ,1973 + ,35 + ,105195 + ,166 + ,0 + ,1769 + ,28 + ,73107 + ,68 + ,0 + ,3148 + ,38 + ,132068 + ,147 + ,0 + ,2474 + ,23 + ,149193 + ,179 + ,0 + ,2084 + ,36 + ,46821 + ,61 + ,0 + ,1954 + ,32 + ,87011 + ,101 + ,0 + ,1226 + ,29 + ,95260 + ,108 + ,0 + ,1389 + ,25 + ,55183 + ,90 + ,0 + ,1496 + ,27 + ,106671 + ,114 + ,0 + ,2269 + ,36 + ,73511 + ,103 + ,0 + ,1833 + ,28 + ,92945 + ,142 + ,0 + ,1268 + ,23 + ,78664 + ,79 + ,0 + ,1943 + ,40 + ,70054 + ,88 + ,0 + ,893 + ,23 + ,22618 + ,25 + ,0 + ,1762 + ,40 + ,74011 + ,83 + ,0 + ,1403 + ,28 + ,83737 + ,113 + ,0 + ,1425 + ,34 + ,69094 + ,118 + ,0 + ,1857 + ,33 + ,93133 + ,110 + ,0 + ,1840 + ,28 + ,95536 + ,129 + ,0 + ,1502 + ,34 + ,225920 + ,51 + ,0 + ,1441 + ,30 + ,62133 + ,93 + ,0 + ,1420 + ,33 + ,61370 + ,76 + ,0 + ,1416 + ,22 + ,43836 + ,49 + ,0 + ,2970 + ,38 + ,106117 + ,118 + ,0 + ,1317 + ,26 + ,38692 + ,38 + ,0 + ,1644 + ,35 + ,84651 + ,141 + ,0 + ,870 + ,8 + ,56622 + ,58 + ,0 + ,1654 + ,24 + ,15986 + ,27 + ,0 + ,1054 + ,29 + ,95364 + ,91 + ,0 + ,937 + ,20 + ,26706 + ,48 + ,1 + ,3004 + ,29 + ,89691 + ,63 + ,0 + ,2008 + ,45 + ,67267 + ,56 + ,0 + ,2547 + ,37 + ,126846 + ,144 + ,0 + ,1885 + ,33 + ,41140 + ,73 + ,0 + ,1626 + ,33 + ,102860 + ,168 + ,0 + ,1468 + ,25 + ,51715 + ,64 + ,0 + ,2445 + ,32 + ,55801 + ,97 + ,0 + ,1964 + ,29 + ,111813 + ,117 + ,0 + ,1381 + ,28 + ,120293 + ,100 + ,0 + ,1369 + ,28 + ,138599 + ,149 + ,0 + ,1659 + ,31 + ,161647 + ,187 + ,0 + ,2888 + ,52 + ,115929 + ,127 + ,0 + ,1290 + ,21 + ,24266 + ,37 + ,1 + ,2845 + ,24 + ,162901 + ,245 + ,0 + ,1982 + ,41 + ,109825 + ,87 + ,0 + ,1904 + ,33 + ,129838 + ,177 + ,0 + ,1391 + ,32 + ,37510 + ,49 + ,0 + ,602 + ,19 + ,43750 + ,49 + ,0 + ,1743 + ,20 + ,40652 + ,73 + ,0 + ,1559 + ,31 + ,87771 + ,177 + ,0 + ,2014 + ,31 + ,85872 + ,94 + ,0 + ,2143 + ,32 + ,89275 + ,117 + ,0 + ,2146 + ,18 + ,44418 + ,60 + ,1 + ,874 + ,23 + ,192565 + ,55 + ,0 + ,1590 + ,17 + ,35232 + ,39 + ,1 + ,1590 + ,20 + ,40909 + ,64 + ,1 + ,1210 + ,12 + ,13294 + ,26 + ,1 + ,2072 + ,17 + ,32387 + ,64 + ,1 + ,1281 + ,30 + ,140867 + ,58 + ,0 + ,1401 + ,31 + ,120662 + ,95 + ,0 + ,834 + ,10 + ,21233 + ,25 + ,1 + ,1105 + ,13 + ,44332 + ,26 + ,1 + ,1272 + ,22 + ,61056 + ,76 + ,1 + ,1944 + ,42 + ,101338 + ,129 + ,0 + ,391 + ,1 + ,1168 + ,11 + ,0 + ,761 + ,9 + ,13497 + ,2 + ,1 + ,1605 + ,32 + ,65567 + ,101 + ,0 + ,530 + ,11 + ,25162 + ,28 + ,0 + ,1988 + ,25 + ,32334 + ,36 + ,1 + ,1386 + ,36 + ,40735 + ,89 + ,0 + ,2395 + ,31 + ,91413 + ,193 + ,0 + ,387 + ,0 + ,855 + ,4 + ,0 + ,1742 + ,24 + ,97068 + ,84 + ,0 + ,620 + ,13 + ,44339 + ,23 + ,1 + ,449 + ,8 + ,14116 + ,39 + ,0 + ,800 + ,13 + ,10288 + ,14 + ,1 + ,1684 + ,19 + ,65622 + ,78 + ,1 + ,1050 + ,18 + ,16563 + ,14 + ,1 + ,2699 + ,33 + ,76643 + ,101 + ,0 + ,1606 + ,40 + ,110681 + ,82 + ,0 + ,1502 + ,22 + ,29011 + ,24 + ,1 + ,1204 + ,38 + ,92696 + ,36 + ,0 + ,1138 + ,24 + ,94785 + ,75 + ,0 + ,568 + ,8 + ,8773 + ,16 + ,0 + ,1459 + ,35 + ,83209 + ,55 + ,0 + ,2158 + ,43 + ,93815 + ,131 + ,0 + ,1111 + ,43 + ,86687 + ,131 + ,0 + ,1421 + ,14 + ,34553 + ,39 + ,1 + ,2833 + ,41 + ,105547 + ,144 + ,0 + ,1955 + ,38 + ,103487 + ,139 + ,0 + ,2922 + ,45 + ,213688 + ,211 + ,0 + ,1002 + ,31 + ,71220 + ,78 + ,0 + ,1060 + ,13 + ,23517 + ,50 + ,1 + ,956 + ,28 + ,56926 + ,39 + ,0 + ,2186 + ,31 + ,91721 + ,90 + ,0 + ,3604 + ,40 + ,115168 + ,166 + ,0 + ,1035 + ,30 + ,111194 + ,12 + ,0 + ,1417 + ,16 + ,51009 + ,57 + ,1 + ,3261 + ,37 + ,135777 + ,133 + ,0 + ,1587 + ,30 + ,51513 + ,69 + ,0 + ,1424 + ,35 + ,74163 + ,119 + ,0 + ,1701 + ,32 + ,51633 + ,119 + ,0 + ,1249 + ,27 + ,75345 + ,65 + ,0 + ,946 + ,20 + ,33416 + ,61 + ,1 + ,1926 + ,18 + ,83305 + ,49 + ,1 + ,3352 + ,31 + ,98952 + ,101 + ,0 + ,1641 + ,31 + ,102372 + ,196 + ,0 + ,2035 + ,21 + ,37238 + ,15 + ,0 + ,2312 + ,39 + ,103772 + ,136 + ,0 + ,1369 + ,41 + ,123969 + ,89 + ,0 + ,1577 + ,13 + ,27142 + ,40 + ,1 + ,2201 + ,32 + ,135400 + ,123 + ,0 + ,961 + ,18 + ,21399 + ,21 + ,1 + ,1900 + ,39 + ,130115 + ,163 + ,0 + ,1254 + ,14 + ,24874 + ,29 + ,1 + ,1335 + ,7 + ,34988 + ,35 + ,1 + ,1597 + ,17 + ,45549 + ,13 + ,1 + ,207 + ,0 + ,6023 + ,5 + ,0 + ,1645 + ,30 + ,64466 + ,96 + ,0 + ,2429 + ,37 + ,54990 + ,151 + ,0 + ,151 + ,0 + ,1644 + ,6 + ,0 + ,474 + ,5 + ,6179 + ,13 + ,0 + ,141 + ,1 + ,3926 + ,3 + ,0 + ,1639 + ,16 + ,32755 + ,56 + ,1 + ,872 + ,32 + ,34777 + ,23 + ,0 + ,1318 + ,24 + ,73224 + ,57 + ,0 + ,1018 + ,17 + ,27114 + ,14 + ,1 + ,1383 + ,11 + ,20760 + ,43 + ,1 + ,1314 + ,24 + ,37636 + ,20 + ,1 + ,1335 + ,22 + ,65461 + ,72 + ,1 + ,1403 + ,12 + ,30080 + ,87 + ,1 + ,910 + ,19 + ,24094 + ,21 + ,1 + ,616 + ,13 + ,69008 + ,56 + ,1 + ,1407 + ,17 + ,54968 + ,59 + ,1 + ,771 + ,15 + ,46090 + ,82 + ,1 + ,766 + ,16 + ,27507 + ,43 + ,1 + ,473 + ,24 + ,10672 + ,25 + ,1 + ,1376 + ,15 + ,34029 + ,38 + ,1 + ,1232 + ,17 + ,46300 + ,25 + ,1 + ,1521 + ,18 + ,24760 + ,38 + ,1 + ,572 + ,20 + ,18779 + ,12 + ,1 + ,1059 + ,16 + ,21280 + ,29 + ,1 + ,1544 + ,16 + ,40662 + ,47 + ,1 + ,1230 + ,18 + ,28987 + ,45 + ,1 + ,1206 + ,22 + ,22827 + ,40 + ,1 + ,1205 + ,8 + ,18513 + ,30 + ,1 + ,1255 + ,17 + ,30594 + ,41 + ,1 + ,613 + ,18 + ,24006 + ,25 + ,1 + ,721 + ,16 + ,27913 + ,23 + ,1 + ,1109 + ,23 + ,42744 + ,14 + ,1 + ,740 + ,22 + ,12934 + ,16 + ,1 + ,1126 + ,13 + ,22574 + ,26 + ,1 + ,728 + ,13 + ,41385 + ,21 + ,1 + ,689 + ,16 + ,18653 + ,27 + ,1 + ,592 + ,16 + ,18472 + ,9 + ,1 + ,995 + ,20 + ,30976 + ,33 + ,1 + ,1613 + ,22 + ,63339 + ,42 + ,1 + ,2048 + ,17 + ,25568 + ,68 + ,1 + ,705 + ,18 + ,33747 + ,32 + ,1 + ,301 + ,17 + ,4154 + ,6 + ,1 + ,1803 + ,12 + ,19474 + ,67 + ,1 + ,799 + ,7 + ,35130 + ,33 + ,1 + ,861 + ,17 + ,39067 + ,77 + ,1 + ,1186 + ,14 + ,13310 + ,46 + ,1 + ,1451 + ,23 + ,65892 + ,30 + ,1 + ,628 + ,17 + ,4143 + ,0 + ,1 + ,1161 + ,14 + ,28579 + ,36 + ,1 + ,1463 + ,15 + ,51776 + ,46 + ,1 + ,742 + ,17 + ,21152 + ,18 + ,1 + ,979 + ,21 + ,38084 + ,48 + ,1 + ,675 + ,18 + ,27717 + ,29 + ,1 + ,1241 + ,18 + ,32928 + ,28 + ,1 + ,676 + ,17 + ,11342 + ,34 + ,1 + ,1049 + ,17 + ,19499 + ,33 + ,1 + ,620 + ,16 + ,16380 + ,34 + ,1 + ,1081 + ,15 + ,36874 + ,33 + ,1 + ,1688 + ,21 + ,48259 + ,80 + ,1 + ,736 + ,16 + ,16734 + ,32 + ,1 + ,617 + ,14 + ,28207 + ,30 + ,1 + ,812 + ,15 + ,30143 + ,41 + ,1 + ,1051 + ,17 + ,41369 + ,41 + ,1 + ,1656 + ,15 + ,45833 + ,51 + ,1 + ,705 + ,15 + ,29156 + ,18 + ,1 + ,945 + ,10 + ,35944 + ,34 + ,1 + ,554 + ,6 + ,36278 + ,31 + ,1 + ,1597 + ,22 + ,45588 + ,39 + ,1 + ,982 + ,21 + ,45097 + ,54 + ,1 + ,222 + ,1 + ,3895 + ,14 + ,1 + ,1212 + ,18 + ,28394 + ,24 + ,1 + ,1143 + ,17 + ,18632 + ,24 + ,1 + ,435 + ,4 + ,2325 + ,8 + ,1 + ,532 + ,10 + ,25139 + ,26 + ,1 + ,882 + ,16 + ,27975 + ,19 + ,1 + ,608 + ,16 + ,14483 + ,11 + ,1 + ,459 + ,9 + ,13127 + ,14 + ,1 + ,578 + ,16 + ,5839 + ,1 + ,1 + ,826 + ,17 + ,24069 + ,39 + ,1 + ,509 + ,7 + ,3738 + ,5 + ,1 + ,717 + ,15 + ,18625 + ,37 + ,1 + ,637 + ,14 + ,36341 + ,32 + ,1 + ,857 + ,14 + ,24548 + ,38 + ,1 + ,830 + ,18 + ,21792 + ,47 + ,1 + ,652 + ,12 + ,26263 + ,47 + ,1 + ,707 + ,16 + ,23686 + ,37 + ,1 + ,954 + ,21 + ,49303 + ,51 + ,1 + ,1461 + ,19 + ,25659 + ,45 + ,1 + ,672 + ,16 + ,28904 + ,21 + ,1 + ,778 + ,1 + ,2781 + ,1 + ,1 + ,1141 + ,16 + ,29236 + ,42 + ,1 + ,680 + ,10 + ,19546 + ,26 + ,1 + ,1090 + ,19 + ,22818 + ,21 + ,1 + ,616 + ,12 + ,32689 + ,4 + ,1 + ,285 + ,2 + ,5752 + ,10 + ,1 + ,1145 + ,14 + ,22197 + ,43 + ,1 + ,733 + ,17 + ,20055 + ,34 + ,1 + ,888 + ,19 + ,25272 + ,31 + ,1 + ,849 + ,14 + ,82206 + ,19 + ,1 + ,1182 + ,11 + ,32073 + ,34 + ,1 + ,528 + ,4 + ,5444 + ,6 + ,1 + ,642 + ,16 + ,20154 + ,11 + ,1 + ,947 + ,20 + ,36944 + ,24 + ,1 + ,819 + ,12 + ,8019 + ,16 + ,1 + ,757 + ,15 + ,30884 + ,72 + ,1 + ,894 + ,16 + ,19540 + ,21 + ,1) + ,dim=c(5 + ,289) + ,dimnames=list(c('pageviews' + ,'compendiums_reviewed' + ,'totsize' + ,'totblogs' + ,'course_cid') + ,1:289)) > y <- array(NA,dim=c(5,289),dimnames=list(c('pageviews','compendiums_reviewed','totsize','totblogs','course_cid'),1:289)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par4 = 'no' > par3 = '3' > par2 = 'none' > par1 = '3' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #Technical description: > library(party) Loading required package: survival Loading required package: splines Loading required package: grid Loading required package: modeltools Loading required package: stats4 Loading required package: coin Loading required package: mvtnorm Loading required package: zoo Loading required package: sandwich Loading required package: strucchange Loading required package: vcd Loading required package: MASS Loading required package: colorspace > library(Hmisc) Attaching package: 'Hmisc' The following object(s) are masked from 'package:survival': untangle.specials The following object(s) are masked from 'package:base': format.pval, round.POSIXt, trunc.POSIXt, units > par1 <- as.numeric(par1) > par3 <- as.numeric(par3) > x <- data.frame(t(y)) > is.data.frame(x) [1] TRUE > x <- x[!is.na(x[,par1]),] > k <- length(x[1,]) > n <- length(x[,1]) > colnames(x)[par1] [1] "totsize" > x[,par1] [1] 112285 84786 83123 101193 38361 68504 119182 22807 17140 116174 [11] 57635 66198 71701 57793 80444 53855 97668 133824 101481 99645 [21] 114789 99052 67654 65553 97500 69112 82753 85323 72654 30727 [31] 77873 117478 74007 90183 61542 101494 27570 55813 79215 1423 [41] 55461 31081 22996 83122 70106 60578 39992 79892 49810 71570 [51] 100708 33032 82875 139077 71595 72260 5950 115762 32551 31701 [61] 80670 143558 117105 23789 120733 105195 73107 132068 149193 46821 [71] 87011 95260 55183 106671 73511 92945 78664 70054 22618 74011 [81] 83737 69094 93133 95536 225920 62133 61370 43836 106117 38692 [91] 84651 56622 15986 95364 26706 89691 67267 126846 41140 102860 [101] 51715 55801 111813 120293 138599 161647 115929 24266 162901 109825 [111] 129838 37510 43750 40652 87771 85872 89275 44418 192565 35232 [121] 40909 13294 32387 140867 120662 21233 44332 61056 101338 1168 [131] 13497 65567 25162 32334 40735 91413 855 97068 44339 14116 [141] 10288 65622 16563 76643 110681 29011 92696 94785 8773 83209 [151] 93815 86687 34553 105547 103487 213688 71220 23517 56926 91721 [161] 115168 111194 51009 135777 51513 74163 51633 75345 33416 83305 [171] 98952 102372 37238 103772 123969 27142 135400 21399 130115 24874 [181] 34988 45549 6023 64466 54990 1644 6179 3926 32755 34777 [191] 73224 27114 20760 37636 65461 30080 24094 69008 54968 46090 [201] 27507 10672 34029 46300 24760 18779 21280 40662 28987 22827 [211] 18513 30594 24006 27913 42744 12934 22574 41385 18653 18472 [221] 30976 63339 25568 33747 4154 19474 35130 39067 13310 65892 [231] 4143 28579 51776 21152 38084 27717 32928 11342 19499 16380 [241] 36874 48259 16734 28207 30143 41369 45833 29156 35944 36278 [251] 45588 45097 3895 28394 18632 2325 25139 27975 14483 13127 [261] 5839 24069 3738 18625 36341 24548 21792 26263 23686 49303 [271] 25659 28904 2781 29236 19546 22818 32689 5752 22197 20055 [281] 25272 82206 32073 5444 20154 36944 8019 30884 19540 > if (par2 == 'kmeans') { + cl <- kmeans(x[,par1], par3) + print(cl) + clm <- matrix(cbind(cl$centers,1:par3),ncol=2) + clm <- clm[sort.list(clm[,1]),] + for (i in 1:par3) { + cl$cluster[cl$cluster==clm[i,2]] <- paste('C',i,sep='') + } + cl$cluster <- as.factor(cl$cluster) + print(cl$cluster) + x[,par1] <- cl$cluster + } > if (par2 == 'quantiles') { + x[,par1] <- cut2(x[,par1],g=par3) + } > if (par2 == 'hclust') { + hc <- hclust(dist(x[,par1])^2, 'cen') + print(hc) + memb <- cutree(hc, k = par3) + dum <- c(mean(x[memb==1,par1])) + for (i in 2:par3) { + dum <- c(dum, mean(x[memb==i,par1])) + } + hcm <- matrix(cbind(dum,1:par3),ncol=2) + hcm <- hcm[sort.list(hcm[,1]),] + for (i in 1:par3) { + memb[memb==hcm[i,2]] <- paste('C',i,sep='') + } + memb <- as.factor(memb) + print(memb) + x[,par1] <- memb + } > if (par2=='equal') { + ed <- cut(as.numeric(x[,par1]),par3,labels=paste('C',1:par3,sep='')) + x[,par1] <- as.factor(ed) + } > table(x[,par1]) 855 1168 1423 1644 2325 2781 3738 3895 3926 4143 4154 1 1 1 1 1 1 1 1 1 1 1 5444 5752 5839 5950 6023 6179 8019 8773 10288 10672 11342 1 1 1 1 1 1 1 1 1 1 1 12934 13127 13294 13310 13497 14116 14483 15986 16380 16563 16734 1 1 1 1 1 1 1 1 1 1 1 17140 18472 18513 18625 18632 18653 18779 19474 19499 19540 19546 1 1 1 1 1 1 1 1 1 1 1 20055 20154 20760 21152 21233 21280 21399 21792 22197 22574 22618 1 1 1 1 1 1 1 1 1 1 1 22807 22818 22827 22996 23517 23686 23789 24006 24069 24094 24266 1 1 1 1 1 1 1 1 1 1 1 24548 24760 24874 25139 25162 25272 25568 25659 26263 26706 27114 1 1 1 1 1 1 1 1 1 1 1 27142 27507 27570 27717 27913 27975 28207 28394 28579 28904 28987 1 1 1 1 1 1 1 1 1 1 1 29011 29156 29236 30080 30143 30594 30727 30884 30976 31081 31701 1 1 1 1 1 1 1 1 1 1 1 32073 32334 32387 32551 32689 32755 32928 33032 33416 33747 34029 1 1 1 1 1 1 1 1 1 1 1 34553 34777 34988 35130 35232 35944 36278 36341 36874 36944 37238 1 1 1 1 1 1 1 1 1 1 1 37510 37636 38084 38361 38692 39067 39992 40652 40662 40735 40909 1 1 1 1 1 1 1 1 1 1 1 41140 41369 41385 42744 43750 43836 44332 44339 44418 45097 45549 1 1 1 1 1 1 1 1 1 1 1 45588 45833 46090 46300 46821 48259 49303 49810 51009 51513 51633 1 1 1 1 1 1 1 1 1 1 1 51715 51776 53855 54968 54990 55183 55461 55801 55813 56622 56926 1 1 1 1 1 1 1 1 1 1 1 57635 57793 60578 61056 61370 61542 62133 63339 64466 65461 65553 1 1 1 1 1 1 1 1 1 1 1 65567 65622 65892 66198 67267 67654 68504 69008 69094 69112 70054 1 1 1 1 1 1 1 1 1 1 1 70106 71220 71570 71595 71701 72260 72654 73107 73224 73511 74007 1 1 1 1 1 1 1 1 1 1 1 74011 74163 75345 76643 77873 78664 79215 79892 80444 80670 82206 1 1 1 1 1 1 1 1 1 1 1 82753 82875 83122 83123 83209 83305 83737 84651 84786 85323 85872 1 1 1 1 1 1 1 1 1 1 1 86687 87011 87771 89275 89691 90183 91413 91721 92696 92945 93133 1 1 1 1 1 1 1 1 1 1 1 93815 94785 95260 95364 95536 97068 97500 97668 98952 99052 99645 1 1 1 1 1 1 1 1 1 1 1 100708 101193 101338 101481 101494 102372 102860 103487 103772 105195 105547 1 1 1 1 1 1 1 1 1 1 1 106117 106671 109825 110681 111194 111813 112285 114789 115168 115762 115929 1 1 1 1 1 1 1 1 1 1 1 116174 117105 117478 119182 120293 120662 120733 123969 126846 129838 130115 1 1 1 1 1 1 1 1 1 1 1 132068 133824 135400 135777 138599 139077 140867 143558 149193 161647 162901 1 1 1 1 1 1 1 1 1 1 1 192565 213688 225920 1 1 1 > colnames(x) [1] "pageviews" "compendiums_reviewed" "totsize" [4] "totblogs" "course_cid" > colnames(x)[par1] [1] "totsize" > x[,par1] [1] 112285 84786 83123 101193 38361 68504 119182 22807 17140 116174 [11] 57635 66198 71701 57793 80444 53855 97668 133824 101481 99645 [21] 114789 99052 67654 65553 97500 69112 82753 85323 72654 30727 [31] 77873 117478 74007 90183 61542 101494 27570 55813 79215 1423 [41] 55461 31081 22996 83122 70106 60578 39992 79892 49810 71570 [51] 100708 33032 82875 139077 71595 72260 5950 115762 32551 31701 [61] 80670 143558 117105 23789 120733 105195 73107 132068 149193 46821 [71] 87011 95260 55183 106671 73511 92945 78664 70054 22618 74011 [81] 83737 69094 93133 95536 225920 62133 61370 43836 106117 38692 [91] 84651 56622 15986 95364 26706 89691 67267 126846 41140 102860 [101] 51715 55801 111813 120293 138599 161647 115929 24266 162901 109825 [111] 129838 37510 43750 40652 87771 85872 89275 44418 192565 35232 [121] 40909 13294 32387 140867 120662 21233 44332 61056 101338 1168 [131] 13497 65567 25162 32334 40735 91413 855 97068 44339 14116 [141] 10288 65622 16563 76643 110681 29011 92696 94785 8773 83209 [151] 93815 86687 34553 105547 103487 213688 71220 23517 56926 91721 [161] 115168 111194 51009 135777 51513 74163 51633 75345 33416 83305 [171] 98952 102372 37238 103772 123969 27142 135400 21399 130115 24874 [181] 34988 45549 6023 64466 54990 1644 6179 3926 32755 34777 [191] 73224 27114 20760 37636 65461 30080 24094 69008 54968 46090 [201] 27507 10672 34029 46300 24760 18779 21280 40662 28987 22827 [211] 18513 30594 24006 27913 42744 12934 22574 41385 18653 18472 [221] 30976 63339 25568 33747 4154 19474 35130 39067 13310 65892 [231] 4143 28579 51776 21152 38084 27717 32928 11342 19499 16380 [241] 36874 48259 16734 28207 30143 41369 45833 29156 35944 36278 [251] 45588 45097 3895 28394 18632 2325 25139 27975 14483 13127 [261] 5839 24069 3738 18625 36341 24548 21792 26263 23686 49303 [271] 25659 28904 2781 29236 19546 22818 32689 5752 22197 20055 [281] 25272 82206 32073 5444 20154 36944 8019 30884 19540 > if (par2 == 'none') { + m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x) + } > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > if (par2 != 'none') { + m <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data = x) + if (par4=='yes') { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'10-Fold Cross Validation',3+2*par3,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'',1,TRUE) + a<-table.element(a,'Prediction (training)',par3+1,TRUE) + a<-table.element(a,'Prediction (testing)',par3+1,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Actual',1,TRUE) + for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE) + a<-table.element(a,'CV',1,TRUE) + for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE) + a<-table.element(a,'CV',1,TRUE) + a<-table.row.end(a) + for (i in 1:10) { + ind <- sample(2, nrow(x), replace=T, prob=c(0.9,0.1)) + m.ct <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data =x[ind==1,]) + if (i==1) { + m.ct.i.pred <- predict(m.ct, newdata=x[ind==1,]) + m.ct.i.actu <- x[ind==1,par1] + m.ct.x.pred <- predict(m.ct, newdata=x[ind==2,]) + m.ct.x.actu <- x[ind==2,par1] + } else { + m.ct.i.pred <- c(m.ct.i.pred,predict(m.ct, newdata=x[ind==1,])) + m.ct.i.actu <- c(m.ct.i.actu,x[ind==1,par1]) + m.ct.x.pred <- c(m.ct.x.pred,predict(m.ct, newdata=x[ind==2,])) + m.ct.x.actu <- c(m.ct.x.actu,x[ind==2,par1]) + } + } + print(m.ct.i.tab <- table(m.ct.i.actu,m.ct.i.pred)) + numer <- 0 + for (i in 1:par3) { + print(m.ct.i.tab[i,i] / sum(m.ct.i.tab[i,])) + numer <- numer + m.ct.i.tab[i,i] + } + print(m.ct.i.cp <- numer / sum(m.ct.i.tab)) + print(m.ct.x.tab <- table(m.ct.x.actu,m.ct.x.pred)) + numer <- 0 + for (i in 1:par3) { + print(m.ct.x.tab[i,i] / sum(m.ct.x.tab[i,])) + numer <- numer + m.ct.x.tab[i,i] + } + print(m.ct.x.cp <- numer / sum(m.ct.x.tab)) + for (i in 1:par3) { + a<-table.row.start(a) + a<-table.element(a,paste('C',i,sep=''),1,TRUE) + for (jjj in 1:par3) a<-table.element(a,m.ct.i.tab[i,jjj]) + a<-table.element(a,round(m.ct.i.tab[i,i]/sum(m.ct.i.tab[i,]),4)) + for (jjj in 1:par3) a<-table.element(a,m.ct.x.tab[i,jjj]) + a<-table.element(a,round(m.ct.x.tab[i,i]/sum(m.ct.x.tab[i,]),4)) + a<-table.row.end(a) + } + a<-table.row.start(a) + a<-table.element(a,'Overall',1,TRUE) + for (jjj in 1:par3) a<-table.element(a,'-') + a<-table.element(a,round(m.ct.i.cp,4)) + for (jjj in 1:par3) a<-table.element(a,'-') + a<-table.element(a,round(m.ct.x.cp,4)) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/16k9m1324374985.tab") + } + } > m Conditional inference tree with 9 terminal nodes Response: totsize Inputs: pageviews, compendiums_reviewed, totblogs, course_cid Number of observations: 289 1) totblogs <= 50; criterion = 1, statistic = 183.559 2) compendiums_reviewed <= 25; criterion = 1, statistic = 53.172 3) pageviews <= 528; criterion = 1, statistic = 41.628 4)* weights = 18 3) pageviews > 528 5) pageviews <= 1383; criterion = 1, statistic = 16.775 6) totblogs <= 16; criterion = 0.952, statistic = 6.28 7)* weights = 16 6) totblogs > 16 8)* weights = 77 5) pageviews > 1383 9)* weights = 18 2) compendiums_reviewed > 25 10)* weights = 10 1) totblogs > 50 11) totblogs <= 120; criterion = 1, statistic = 48.913 12) course_cid <= 0; criterion = 1, statistic = 23.811 13)* weights = 81 12) course_cid > 0 14)* weights = 22 11) totblogs > 120 15) totblogs <= 177; criterion = 0.996, statistic = 10.926 16)* weights = 40 15) totblogs > 177 17)* weights = 7 > postscript(file="/var/wessaorg/rcomp/tmp/2ie6t1324374985.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(m) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3rjbc1324374985.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,par1] ~ as.factor(where(m)),main='Response by Terminal Node',xlab='Terminal Node',ylab='Response') > dev.off() null device 1 > if (par2 == 'none') { + forec <- predict(m) + result <- as.data.frame(cbind(x[,par1],forec,x[,par1]-forec)) + colnames(result) <- c('Actuals','Forecasts','Residuals') + print(result) + } Actuals Forecasts Residuals 1 112285 106666.875 5618.12500 2 84786 81072.605 3713.39506 3 83123 81072.605 2050.39506 4 101193 106666.875 -5473.87500 5 38361 81072.605 -42711.60494 6 68504 60644.300 7859.70000 7 119182 106666.875 12515.12500 8 22807 6288.778 16518.22222 9 17140 28041.195 -10901.19481 10 116174 81072.605 35101.39506 11 57635 81072.605 -23437.60494 12 66198 106666.875 -40468.87500 13 71701 81072.605 -9371.60494 14 57793 81072.605 -23279.60494 15 80444 106666.875 -26222.87500 16 53855 81072.605 -27217.60494 17 97668 106666.875 -8998.87500 18 133824 106666.875 27157.12500 19 101481 81072.605 20408.39506 20 99645 106666.875 -7021.87500 21 114789 106666.875 8122.12500 22 99052 106666.875 -7614.87500 23 67654 81072.605 -13418.60494 24 65553 81072.605 -15519.60494 25 97500 81072.605 16427.39506 26 69112 81072.605 -11960.60494 27 82753 81072.605 1680.39506 28 85323 81072.605 4250.39506 29 72654 81072.605 -8418.60494 30 30727 81072.605 -50345.60494 31 77873 81072.605 -3199.60494 32 117478 81072.605 36405.39506 33 74007 106666.875 -32659.87500 34 90183 106666.875 -16483.87500 35 61542 60644.300 897.70000 36 101494 106666.875 -5172.87500 37 27570 28041.195 -471.19481 38 55813 81072.605 -25259.60494 39 79215 81072.605 -1857.60494 40 1423 6288.778 -4865.77778 41 55461 81072.605 -25611.60494 42 31081 28041.195 3039.80519 43 22996 40269.889 -17273.88889 44 83122 81072.605 2049.39506 45 70106 81072.605 -10966.60494 46 60578 81072.605 -20494.60494 47 39992 44120.727 -4128.72727 48 79892 81072.605 -1180.60494 49 49810 81072.605 -31262.60494 50 71570 60644.300 10925.70000 51 100708 81072.605 19635.39506 52 33032 60644.300 -27612.30000 53 82875 106666.875 -23791.87500 54 139077 106666.875 32410.12500 55 71595 81072.605 -9477.60494 56 72260 81072.605 -8812.60494 57 5950 6288.778 -338.77778 58 115762 106666.875 9095.12500 59 32551 28041.195 4509.80519 60 31701 28041.195 3659.80519 61 80670 81072.605 -402.60494 62 143558 106666.875 36891.12500 63 117105 106666.875 10438.12500 64 23789 28041.195 -4252.19481 65 120733 143135.286 -22402.28571 66 105195 106666.875 -1471.87500 67 73107 81072.605 -7965.60494 68 132068 106666.875 25401.12500 69 149193 143135.286 6057.71429 70 46821 81072.605 -34251.60494 71 87011 81072.605 5938.39506 72 95260 81072.605 14187.39506 73 55183 81072.605 -25889.60494 74 106671 81072.605 25598.39506 75 73511 81072.605 -7561.60494 76 92945 106666.875 -13721.87500 77 78664 81072.605 -2408.60494 78 70054 81072.605 -11018.60494 79 22618 28041.195 -5423.19481 80 74011 81072.605 -7061.60494 81 83737 81072.605 2664.39506 82 69094 81072.605 -11978.60494 83 93133 81072.605 12060.39506 84 95536 106666.875 -11130.87500 85 225920 81072.605 144847.39506 86 62133 81072.605 -18939.60494 87 61370 81072.605 -19702.60494 88 43836 40269.889 3566.11111 89 106117 81072.605 25044.39506 90 38692 60644.300 -21952.30000 91 84651 106666.875 -22015.87500 92 56622 81072.605 -24450.60494 93 15986 40269.889 -24283.88889 94 95364 81072.605 14291.39506 95 26706 28041.195 -1335.19481 96 89691 81072.605 8618.39506 97 67267 81072.605 -13805.60494 98 126846 106666.875 20179.12500 99 41140 81072.605 -39932.60494 100 102860 106666.875 -3806.87500 101 51715 81072.605 -29357.60494 102 55801 81072.605 -25271.60494 103 111813 81072.605 30740.39506 104 120293 81072.605 39220.39506 105 138599 106666.875 31932.12500 106 161647 143135.286 18511.71429 107 115929 106666.875 9262.12500 108 24266 28041.195 -3775.19481 109 162901 143135.286 19765.71429 110 109825 81072.605 28752.39506 111 129838 106666.875 23171.12500 112 37510 60644.300 -23134.30000 113 43750 28041.195 15708.80519 114 40652 81072.605 -40420.60494 115 87771 106666.875 -18895.87500 116 85872 81072.605 4799.39506 117 89275 81072.605 8202.39506 118 44418 44120.727 297.27273 119 192565 81072.605 111492.39506 120 35232 40269.889 -5037.88889 121 40909 44120.727 -3211.72727 122 13294 28041.195 -14747.19481 123 32387 44120.727 -11733.72727 124 140867 81072.605 59794.39506 125 120662 81072.605 39589.39506 126 21233 28041.195 -6808.19481 127 44332 28041.195 16290.80519 128 61056 44120.727 16935.27273 129 101338 106666.875 -5328.87500 130 1168 6288.778 -5120.77778 131 13497 16079.500 -2582.50000 132 65567 81072.605 -15505.60494 133 25162 28041.195 -2879.19481 134 32334 40269.889 -7935.88889 135 40735 81072.605 -40337.60494 136 91413 143135.286 -51722.28571 137 855 6288.778 -5433.77778 138 97068 81072.605 15995.39506 139 44339 28041.195 16297.80519 140 14116 6288.778 7827.22222 141 10288 16079.500 -5791.50000 142 65622 44120.727 21501.27273 143 16563 16079.500 483.50000 144 76643 81072.605 -4429.60494 145 110681 81072.605 29608.39506 146 29011 40269.889 -11258.88889 147 92696 60644.300 32051.70000 148 94785 81072.605 13712.39506 149 8773 16079.500 -7306.50000 150 83209 81072.605 2136.39506 151 93815 106666.875 -12851.87500 152 86687 106666.875 -19979.87500 153 34553 40269.889 -5716.88889 154 105547 106666.875 -1119.87500 155 103487 106666.875 -3179.87500 156 213688 143135.286 70552.71429 157 71220 81072.605 -9852.60494 158 23517 28041.195 -4524.19481 159 56926 60644.300 -3718.30000 160 91721 81072.605 10648.39506 161 115168 106666.875 8501.12500 162 111194 60644.300 50549.70000 163 51009 44120.727 6888.27273 164 135777 106666.875 29110.12500 165 51513 81072.605 -29559.60494 166 74163 81072.605 -6909.60494 167 51633 81072.605 -29439.60494 168 75345 81072.605 -5727.60494 169 33416 44120.727 -10704.72727 170 83305 40269.889 43035.11111 171 98952 81072.605 17879.39506 172 102372 143135.286 -40763.28571 173 37238 40269.889 -3031.88889 174 103772 106666.875 -2894.87500 175 123969 81072.605 42896.39506 176 27142 40269.889 -13127.88889 177 135400 106666.875 28733.12500 178 21399 28041.195 -6642.19481 179 130115 106666.875 23448.12500 180 24874 28041.195 -3167.19481 181 34988 28041.195 6946.80519 182 45549 40269.889 5279.11111 183 6023 6288.778 -265.77778 184 64466 81072.605 -16606.60494 185 54990 106666.875 -51676.87500 186 1644 6288.778 -4644.77778 187 6179 6288.778 -109.77778 188 3926 6288.778 -2362.77778 189 32755 44120.727 -11365.72727 190 34777 60644.300 -25867.30000 191 73224 81072.605 -7848.60494 192 27114 16079.500 11034.50000 193 20760 28041.195 -7281.19481 194 37636 28041.195 9594.80519 195 65461 44120.727 21340.27273 196 30080 44120.727 -14040.72727 197 24094 28041.195 -3947.19481 198 69008 44120.727 24887.27273 199 54968 44120.727 10847.27273 200 46090 44120.727 1969.27273 201 27507 28041.195 -534.19481 202 10672 6288.778 4383.22222 203 34029 28041.195 5987.80519 204 46300 28041.195 18258.80519 205 24760 40269.889 -15509.88889 206 18779 16079.500 2699.50000 207 21280 28041.195 -6761.19481 208 40662 40269.889 392.11111 209 28987 28041.195 945.80519 210 22827 28041.195 -5214.19481 211 18513 28041.195 -9528.19481 212 30594 28041.195 2552.80519 213 24006 28041.195 -4035.19481 214 27913 28041.195 -128.19481 215 42744 16079.500 26664.50000 216 12934 16079.500 -3145.50000 217 22574 28041.195 -5467.19481 218 41385 28041.195 13343.80519 219 18653 28041.195 -9388.19481 220 18472 16079.500 2392.50000 221 30976 28041.195 2934.80519 222 63339 40269.889 23069.11111 223 25568 44120.727 -18552.72727 224 33747 28041.195 5705.80519 225 4154 6288.778 -2134.77778 226 19474 44120.727 -24646.72727 227 35130 28041.195 7088.80519 228 39067 44120.727 -5053.72727 229 13310 28041.195 -14731.19481 230 65892 40269.889 25622.11111 231 4143 16079.500 -11936.50000 232 28579 28041.195 537.80519 233 51776 40269.889 11506.11111 234 21152 28041.195 -6889.19481 235 38084 28041.195 10042.80519 236 27717 28041.195 -324.19481 237 32928 28041.195 4886.80519 238 11342 28041.195 -16699.19481 239 19499 28041.195 -8542.19481 240 16380 28041.195 -11661.19481 241 36874 28041.195 8832.80519 242 48259 44120.727 4138.27273 243 16734 28041.195 -11307.19481 244 28207 28041.195 165.80519 245 30143 28041.195 2101.80519 246 41369 28041.195 13327.80519 247 45833 44120.727 1712.27273 248 29156 28041.195 1114.80519 249 35944 28041.195 7902.80519 250 36278 28041.195 8236.80519 251 45588 40269.889 5318.11111 252 45097 44120.727 976.27273 253 3895 6288.778 -2393.77778 254 28394 28041.195 352.80519 255 18632 28041.195 -9409.19481 256 2325 6288.778 -3963.77778 257 25139 28041.195 -2902.19481 258 27975 28041.195 -66.19481 259 14483 16079.500 -1596.50000 260 13127 6288.778 6838.22222 261 5839 16079.500 -10240.50000 262 24069 28041.195 -3972.19481 263 3738 6288.778 -2550.77778 264 18625 28041.195 -9416.19481 265 36341 28041.195 8299.80519 266 24548 28041.195 -3493.19481 267 21792 28041.195 -6249.19481 268 26263 28041.195 -1778.19481 269 23686 28041.195 -4355.19481 270 49303 44120.727 5182.27273 271 25659 40269.889 -14610.88889 272 28904 28041.195 862.80519 273 2781 16079.500 -13298.50000 274 29236 28041.195 1194.80519 275 19546 28041.195 -8495.19481 276 22818 28041.195 -5223.19481 277 32689 16079.500 16609.50000 278 5752 6288.778 -536.77778 279 22197 28041.195 -5844.19481 280 20055 28041.195 -7986.19481 281 25272 28041.195 -2769.19481 282 82206 28041.195 54164.80519 283 32073 28041.195 4031.80519 284 5444 6288.778 -844.77778 285 20154 16079.500 4074.50000 286 36944 28041.195 8902.80519 287 8019 16079.500 -8060.50000 288 30884 44120.727 -13236.72727 289 19540 28041.195 -8501.19481 > if (par2 != 'none') { + print(cbind(as.factor(x[,par1]),predict(m))) + myt <- table(as.factor(x[,par1]),predict(m)) + print(myt) + } > postscript(file="/var/wessaorg/rcomp/tmp/42sey1324374985.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > if(par2=='none') { + op <- par(mfrow=c(2,2)) + plot(density(result$Actuals),main='Kernel Density Plot of Actuals') + plot(density(result$Residuals),main='Kernel Density Plot of Residuals') + plot(result$Forecasts,result$Actuals,main='Actuals versus Predictions',xlab='Predictions',ylab='Actuals') + plot(density(result$Forecasts),main='Kernel Density Plot of Predictions') + par(op) + } > if(par2!='none') { + plot(myt,main='Confusion Matrix',xlab='Actual',ylab='Predicted') + } > dev.off() null device 1 > if (par2 == 'none') { + detcoef <- cor(result$Forecasts,result$Actuals) + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goodness of Fit',2,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Correlation',1,TRUE) + a<-table.element(a,round(detcoef,4)) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'R-squared',1,TRUE) + a<-table.element(a,round(detcoef*detcoef,4)) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'RMSE',1,TRUE) + a<-table.element(a,round(sqrt(mean((result$Residuals)^2)),4)) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/58xau1324374985.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Actuals, Predictions, and Residuals',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'#',header=TRUE) + a<-table.element(a,'Actuals',header=TRUE) + a<-table.element(a,'Forecasts',header=TRUE) + a<-table.element(a,'Residuals',header=TRUE) + a<-table.row.end(a) + for (i in 1:length(result$Actuals)) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,result$Actuals[i]) + a<-table.element(a,result$Forecasts[i]) + a<-table.element(a,result$Residuals[i]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/6yq5i1324374985.tab") + } > if (par2 != 'none') { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Confusion Matrix (predicted in columns / actuals in rows)',par3+1,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'',1,TRUE) + for (i in 1:par3) { + a<-table.element(a,paste('C',i,sep=''),1,TRUE) + } + a<-table.row.end(a) + for (i in 1:par3) { + a<-table.row.start(a) + a<-table.element(a,paste('C',i,sep=''),1,TRUE) + for (j in 1:par3) { + a<-table.element(a,myt[i,j]) + } + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/7ahre1324374985.tab") + } > > try(system("convert tmp/2ie6t1324374985.ps tmp/2ie6t1324374985.png",intern=TRUE)) character(0) > try(system("convert tmp/3rjbc1324374985.ps tmp/3rjbc1324374985.png",intern=TRUE)) character(0) > try(system("convert tmp/42sey1324374985.ps tmp/42sey1324374985.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.309 0.320 5.629