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(112285 + ,210907 + ,24188 + ,145 + ,1418 + ,84786 + ,120982 + ,18273 + ,101 + ,869 + ,83123 + ,176508 + ,14130 + ,98 + ,1530 + ,101193 + ,179321 + ,32287 + ,132 + ,2172 + ,38361 + ,123185 + ,8654 + ,60 + ,901 + ,68504 + ,52746 + ,9245 + ,38 + ,463 + ,119182 + ,385534 + ,33251 + ,144 + ,3201 + ,22807 + ,33170 + ,1271 + ,5 + ,371 + ,17140 + ,101645 + ,5279 + ,28 + ,1192 + ,116174 + ,149061 + ,27101 + ,84 + ,1583 + ,57635 + ,165446 + ,16373 + ,79 + ,1439 + ,66198 + ,237213 + ,19716 + ,127 + ,1764 + ,71701 + ,173326 + ,17753 + ,78 + ,1495 + ,57793 + ,133131 + ,9028 + ,60 + ,1373 + ,80444 + ,258873 + ,18653 + ,131 + ,2187 + ,53855 + ,180083 + ,8828 + ,84 + ,1491 + ,97668 + ,324799 + ,29498 + ,133 + ,4041 + ,133824 + ,230964 + ,27563 + ,150 + ,1706 + ,101481 + ,236785 + ,18293 + ,91 + ,2152 + ,99645 + ,135473 + ,22530 + ,132 + ,1036 + ,114789 + ,202925 + ,15977 + ,136 + ,1882 + ,99052 + ,215147 + ,35082 + ,124 + ,1929 + ,67654 + ,344297 + ,16116 + ,118 + ,2242 + ,65553 + ,153935 + ,15849 + ,70 + ,1220 + ,97500 + ,132943 + ,16026 + ,107 + ,1289 + ,69112 + ,174724 + ,26569 + ,119 + ,2515 + ,82753 + ,174415 + ,24785 + ,89 + ,2147 + ,85323 + ,225548 + ,17569 + ,112 + ,2352 + ,72654 + ,223632 + ,23825 + ,108 + ,1638 + ,30727 + ,124817 + ,7869 + ,52 + ,1222 + ,77873 + ,221698 + ,14975 + ,112 + ,1812 + ,117478 + ,210767 + ,37791 + ,116 + ,1677 + ,74007 + ,170266 + ,9605 + ,123 + ,1579 + ,90183 + ,260561 + ,27295 + ,125 + ,1731 + ,61542 + ,84853 + ,2746 + ,27 + ,807 + ,101494 + ,294424 + ,34461 + ,162 + ,2452 + ,27570 + ,101011 + ,8098 + ,32 + ,829 + ,55813 + ,215641 + ,4787 + ,64 + ,1940 + ,79215 + ,325107 + ,24919 + ,92 + ,2662 + ,1423 + ,7176 + ,603 + ,0 + ,186 + ,55461 + ,167542 + ,16329 + ,83 + ,1499 + ,31081 + ,106408 + ,12558 + ,41 + ,865 + ,22996 + ,96560 + ,7784 + ,47 + ,1793 + ,83122 + ,265769 + ,28522 + ,120 + ,2527 + ,70106 + ,269651 + ,22265 + ,105 + ,2747 + ,60578 + ,149112 + ,14459 + ,79 + ,1324 + ,39992 + ,175824 + ,14526 + ,65 + ,2702 + ,79892 + ,152871 + ,22240 + ,70 + ,1383 + ,49810 + ,111665 + ,11802 + ,55 + ,1179 + ,71570 + ,116408 + ,7623 + ,39 + ,2099 + ,100708 + ,362301 + ,11912 + ,67 + ,4308 + ,33032 + ,78800 + ,7935 + ,21 + ,918 + ,82875 + ,183167 + ,18220 + ,127 + ,1831 + ,139077 + ,277965 + ,19199 + ,152 + ,3373 + ,71595 + ,150629 + ,19918 + ,113 + ,1713 + ,72260 + ,168809 + ,21884 + ,99 + ,1438 + ,5950 + ,24188 + ,2694 + ,7 + ,496 + ,115762 + ,329267 + ,15808 + ,141 + ,2253 + ,32551 + ,65029 + ,3597 + ,21 + ,744 + ,31701 + ,101097 + ,5296 + ,35 + ,1161 + ,80670 + ,218946 + ,25239 + ,109 + ,2352 + ,143558 + ,244052 + ,29801 + ,133 + ,2144 + ,117105 + ,341570 + ,18450 + ,123 + ,4691 + ,23789 + ,103597 + ,7132 + ,26 + ,1112 + ,120733 + ,233328 + ,34861 + ,230 + ,2694 + ,105195 + ,256462 + ,35940 + ,166 + ,1973 + ,73107 + ,206161 + ,16688 + ,68 + ,1769 + ,132068 + ,311473 + ,24683 + ,147 + ,3148 + ,149193 + ,235800 + ,46230 + ,179 + ,2474 + ,46821 + ,177939 + ,10387 + ,61 + ,2084 + ,87011 + ,207176 + ,21436 + ,101 + ,1954 + ,95260 + ,196553 + ,30546 + ,108 + ,1226 + ,55183 + ,174184 + ,19746 + ,90 + ,1389 + ,106671 + ,143246 + ,15977 + ,114 + ,1496 + ,73511 + ,187559 + ,22583 + ,103 + ,2269 + ,92945 + ,187681 + ,17274 + ,142 + ,1833 + ,78664 + ,119016 + ,16469 + ,79 + ,1268 + ,70054 + ,182192 + ,14251 + ,88 + ,1943 + ,22618 + ,73566 + ,3007 + ,25 + ,893 + ,74011 + ,194979 + ,16851 + ,83 + ,1762 + ,83737 + ,167488 + ,21113 + ,113 + ,1403 + ,69094 + ,143756 + ,17401 + ,118 + ,1425 + ,93133 + ,275541 + ,23958 + ,110 + ,1857 + ,95536 + ,243199 + ,23567 + ,129 + ,1840 + ,225920 + ,182999 + ,13065 + ,51 + ,1502 + ,62133 + ,135649 + ,15358 + ,93 + ,1441 + ,61370 + ,152299 + ,14587 + ,76 + ,1420 + ,43836 + ,120221 + ,12770 + ,49 + ,1416 + ,106117 + ,346485 + ,24021 + ,118 + ,2970 + ,38692 + ,145790 + ,9648 + ,38 + ,1317 + ,84651 + ,193339 + ,20537 + ,141 + ,1644 + ,56622 + ,80953 + ,7905 + ,58 + ,870 + ,15986 + ,122774 + ,4527 + ,27 + ,1654 + ,95364 + ,130585 + ,30495 + ,91 + ,1054 + ,26706 + ,112611 + ,7117 + ,48 + ,937 + ,89691 + ,286468 + ,17719 + ,63 + ,3004 + ,67267 + ,241066 + ,27056 + ,56 + ,2008 + ,126846 + ,148446 + ,33473 + ,144 + ,2547 + ,41140 + ,204713 + ,9758 + ,73 + ,1885 + ,102860 + ,182079 + ,21115 + ,168 + ,1626 + ,51715 + ,140344 + ,7236 + ,64 + ,1468 + ,55801 + ,220516 + ,13790 + ,97 + ,2445 + ,111813 + ,243060 + ,32902 + ,117 + ,1964 + ,120293 + ,162765 + ,25131 + ,100 + ,1381 + ,138599 + ,182613 + ,30910 + ,149 + ,1369 + ,161647 + ,232138 + ,35947 + ,187 + ,1659 + ,115929 + ,265318 + ,29848 + ,127 + ,2888 + ,24266 + ,85574 + ,6943 + ,37 + ,1290 + ,162901 + ,310839 + ,42705 + ,245 + ,2845 + ,109825 + ,225060 + ,31808 + ,87 + ,1982 + ,129838 + ,232317 + ,26675 + ,177 + ,1904 + ,37510 + ,144966 + ,8435 + ,49 + ,1391 + ,43750 + ,43287 + ,7409 + ,49 + ,602 + ,40652 + ,155754 + ,14993 + ,73 + ,1743 + ,87771 + ,164709 + ,36867 + ,177 + ,1559 + ,85872 + ,201940 + ,33835 + ,94 + ,2014 + ,89275 + ,235454 + ,24164 + ,117 + ,2143 + ,44418 + ,220801 + ,12607 + ,60 + ,2146 + ,192565 + ,99466 + ,22609 + ,55 + ,874 + ,35232 + ,92661 + ,5892 + ,39 + ,1590 + ,40909 + ,133328 + ,17014 + ,64 + ,1590 + ,13294 + ,61361 + ,5394 + ,26 + ,1210 + ,32387 + ,125930 + ,9178 + ,64 + ,2072 + ,140867 + ,100750 + ,6440 + ,58 + ,1281 + ,120662 + ,224549 + ,21916 + ,95 + ,1401 + ,21233 + ,82316 + ,4011 + ,25 + ,834 + ,44332 + ,102010 + ,5818 + ,26 + ,1105 + ,61056 + ,101523 + ,18647 + ,76 + ,1272 + ,101338 + ,243511 + ,20556 + ,129 + ,1944 + ,1168 + ,22938 + ,238 + ,11 + ,391 + ,13497 + ,41566 + ,70 + ,2 + ,761 + ,65567 + ,152474 + ,22392 + ,101 + ,1605 + ,25162 + ,61857 + ,3913 + ,28 + ,530 + ,32334 + ,99923 + ,12237 + ,36 + ,1988 + ,40735 + ,132487 + ,8388 + ,89 + ,1386 + ,91413 + ,317394 + ,22120 + ,193 + ,2395 + ,855 + ,21054 + ,338 + ,4 + ,387 + ,97068 + ,209641 + ,11727 + ,84 + ,1742 + ,44339 + ,22648 + ,3704 + ,23 + ,620 + ,14116 + ,31414 + ,3988 + ,39 + ,449 + ,10288 + ,46698 + ,3030 + ,14 + ,800 + ,65622 + ,131698 + ,13520 + ,78 + ,1684 + ,16563 + ,91735 + ,1421 + ,14 + ,1050 + ,76643 + ,244749 + ,20923 + ,101 + ,2699 + ,110681 + ,184510 + ,20237 + ,82 + ,1606 + ,29011 + ,79863 + ,3219 + ,24 + ,1502 + ,92696 + ,128423 + ,3769 + ,36 + ,1204 + ,94785 + ,97839 + ,12252 + ,75 + ,1138 + ,8773 + ,38214 + ,1888 + ,16 + ,568 + ,83209 + ,151101 + ,14497 + ,55 + ,1459 + ,93815 + ,272458 + ,28864 + ,131 + ,2158 + ,86687 + ,172494 + ,21721 + ,131 + ,1111 + ,34553 + ,108043 + ,4821 + ,39 + ,1421 + ,105547 + ,328107 + ,33644 + ,144 + ,2833 + ,103487 + ,250579 + ,15923 + ,139 + ,1955 + ,213688 + ,351067 + ,42935 + ,211 + ,2922 + ,71220 + ,158015 + ,18864 + ,78 + ,1002 + ,23517 + ,98866 + ,4977 + ,50 + ,1060 + ,56926 + ,85439 + ,7785 + ,39 + ,956 + ,91721 + ,229242 + ,17939 + ,90 + ,2186 + ,115168 + ,351619 + ,23436 + ,166 + ,3604 + ,111194 + ,84207 + ,325 + ,12 + ,1035 + ,51009 + ,120445 + ,13539 + ,57 + ,1417 + ,135777 + ,324598 + ,34538 + ,133 + ,3261 + ,51513 + ,131069 + ,12198 + ,69 + ,1587 + ,74163 + ,204271 + ,26924 + ,119 + ,1424 + ,51633 + ,165543 + ,12716 + ,119 + ,1701 + ,75345 + ,141722 + ,8172 + ,65 + ,1249 + ,33416 + ,116048 + ,10855 + ,61 + ,946 + ,83305 + ,250047 + ,11932 + ,49 + ,1926 + ,98952 + ,299775 + ,14300 + ,101 + ,3352 + ,102372 + ,195838 + ,25515 + ,196 + ,1641 + ,37238 + ,173260 + ,2805 + ,15 + ,2035 + ,103772 + ,254488 + ,29402 + ,136 + ,2312 + ,123969 + ,104389 + ,16440 + ,89 + ,1369 + ,27142 + ,136084 + ,11221 + ,40 + ,1577 + ,135400 + ,199476 + ,28732 + ,123 + ,2201 + ,21399 + ,92499 + ,5250 + ,21 + ,961 + ,130115 + ,224330 + ,28608 + ,163 + ,1900 + ,24874 + ,135781 + ,8092 + ,29 + ,1254 + ,34988 + ,74408 + ,4473 + ,35 + ,1335 + ,45549 + ,81240 + ,1572 + ,13 + ,1597 + ,6023 + ,14688 + ,2065 + ,5 + ,207 + ,64466 + ,181633 + ,14817 + ,96 + ,1645 + ,54990 + ,271856 + ,16714 + ,151 + ,2429 + ,1644 + ,7199 + ,556 + ,6 + ,151 + ,6179 + ,46660 + ,2089 + ,13 + ,474 + ,3926 + ,17547 + ,2658 + ,3 + ,141 + ,32755 + ,133368 + ,10695 + ,56 + ,1639 + ,34777 + ,95227 + ,1669 + ,23 + ,872 + ,73224 + ,152601 + ,16267 + ,57 + ,1318 + ,27114 + ,98146 + ,7768 + ,14 + ,1018 + ,20760 + ,79619 + ,7252 + ,43 + ,1383 + ,37636 + ,59194 + ,6387 + ,20 + ,1314 + ,65461 + ,139942 + ,18715 + ,72 + ,1335 + ,30080 + ,118612 + ,7936 + ,87 + ,1403 + ,24094 + ,72880 + ,8643 + ,21 + ,910 + ,69008 + ,65475 + ,7294 + ,56 + ,616 + ,54968 + ,99643 + ,4570 + ,59 + ,1407 + ,46090 + ,71965 + ,7185 + ,82 + ,771 + ,27507 + ,77272 + ,10058 + ,43 + ,766 + ,10672 + ,49289 + ,2342 + ,25 + ,473 + ,34029 + ,135131 + ,8509 + ,38 + ,1376 + ,46300 + ,108446 + ,13275 + ,25 + ,1232 + ,24760 + ,89746 + ,6816 + ,38 + ,1521 + ,18779 + ,44296 + ,1930 + ,12 + ,572 + ,21280 + ,77648 + ,8086 + ,29 + ,1059 + ,40662 + ,181528 + ,10737 + ,47 + ,1544 + ,28987 + ,134019 + ,8033 + ,45 + ,1230 + ,22827 + ,124064 + ,7058 + ,40 + ,1206 + ,18513 + ,92630 + ,6782 + ,30 + ,1205 + ,30594 + ,121848 + ,5401 + ,41 + ,1255 + ,24006 + ,52915 + ,6521 + ,25 + ,613 + ,27913 + ,81872 + ,10856 + ,23 + ,721 + ,42744 + ,58981 + ,2154 + ,14 + ,1109 + ,12934 + ,53515 + ,6117 + ,16 + ,740 + ,22574 + ,60812 + ,5238 + ,26 + ,1126 + ,41385 + ,56375 + ,4820 + ,21 + ,728 + ,18653 + ,65490 + ,5615 + ,27 + ,689 + ,18472 + ,80949 + ,4272 + ,9 + ,592 + ,30976 + ,76302 + ,8702 + ,33 + ,995 + ,63339 + ,104011 + ,15340 + ,42 + ,1613 + ,25568 + ,98104 + ,8030 + ,68 + ,2048 + ,33747 + ,67989 + ,9526 + ,32 + ,705 + ,4154 + ,30989 + ,1278 + ,6 + ,301 + ,19474 + ,135458 + ,4236 + ,67 + ,1803 + ,35130 + ,73504 + ,3023 + ,33 + ,799 + ,39067 + ,63123 + ,7196 + ,77 + ,861 + ,13310 + ,61254 + ,3394 + ,46 + ,1186 + ,65892 + ,74914 + ,6371 + ,30 + ,1451 + ,4143 + ,31774 + ,1574 + ,0 + ,628 + ,28579 + ,81437 + ,9620 + ,36 + ,1161 + ,51776 + ,87186 + ,6978 + ,46 + ,1463 + ,21152 + ,50090 + ,4911 + ,18 + ,742 + ,38084 + ,65745 + ,8645 + ,48 + ,979 + ,27717 + ,56653 + ,8987 + ,29 + ,675 + ,32928 + ,158399 + ,5544 + ,28 + ,1241 + ,11342 + ,46455 + ,3083 + ,34 + ,676 + ,19499 + ,73624 + ,6909 + ,33 + ,1049 + ,16380 + ,38395 + ,3189 + ,34 + ,620 + ,36874 + ,91899 + ,6745 + ,33 + ,1081 + ,48259 + ,139526 + ,16724 + ,80 + ,1688 + ,16734 + ,52164 + ,4850 + ,32 + ,736 + ,28207 + ,51567 + ,7025 + ,30 + ,617 + ,30143 + ,70551 + ,6047 + ,41 + ,812 + ,41369 + ,84856 + ,7377 + ,41 + ,1051 + ,45833 + ,102538 + ,9078 + ,51 + ,1656 + ,29156 + ,86678 + ,4605 + ,18 + ,705 + ,35944 + ,85709 + ,3238 + ,34 + ,945 + ,36278 + ,34662 + ,8100 + ,31 + ,554 + ,45588 + ,150580 + ,9653 + ,39 + ,1597 + ,45097 + ,99611 + ,8914 + ,54 + ,982 + ,3895 + ,19349 + ,786 + ,14 + ,222 + ,28394 + ,99373 + ,6700 + ,24 + ,1212 + ,18632 + ,86230 + ,5788 + ,24 + ,1143 + ,2325 + ,30837 + ,593 + ,8 + ,435 + ,25139 + ,31706 + ,4506 + ,26 + ,532 + ,27975 + ,89806 + ,6382 + ,19 + ,882 + ,14483 + ,62088 + ,5621 + ,11 + ,608 + ,13127 + ,40151 + ,3997 + ,14 + ,459 + ,5839 + ,27634 + ,520 + ,1 + ,578 + ,24069 + ,76990 + ,8891 + ,39 + ,826 + ,3738 + ,37460 + ,999 + ,5 + ,509 + ,18625 + ,54157 + ,7067 + ,37 + ,717 + ,36341 + ,49862 + ,4639 + ,32 + ,637 + ,24548 + ,84337 + ,5654 + ,38 + ,857 + ,21792 + ,64175 + ,6928 + ,47 + ,830 + ,26263 + ,59382 + ,1514 + ,47 + ,652 + ,23686 + ,119308 + ,9238 + ,37 + ,707 + ,49303 + ,76702 + ,8204 + ,51 + ,954 + ,25659 + ,103425 + ,5926 + ,45 + ,1461 + ,28904 + ,70344 + ,5785 + ,21 + ,672 + ,2781 + ,43410 + ,4 + ,1 + ,778 + ,29236 + ,104838 + ,5930 + ,42 + ,1141 + ,19546 + ,62215 + ,3710 + ,26 + ,680 + ,22818 + ,69304 + ,705 + ,21 + ,1090 + ,32689 + ,53117 + ,443 + ,4 + ,616 + ,5752 + ,19764 + ,2416 + ,10 + ,285 + ,22197 + ,86680 + ,7747 + ,43 + ,1145 + ,20055 + ,84105 + ,5432 + ,34 + ,733 + ,25272 + ,77945 + ,4913 + ,31 + ,888 + ,82206 + ,89113 + ,2650 + ,19 + ,849 + ,32073 + ,91005 + ,2370 + ,34 + ,1182 + ,5444 + ,40248 + ,775 + ,6 + ,528 + ,20154 + ,64187 + ,5576 + ,11 + ,642 + ,36944 + ,50857 + ,1352 + ,24 + ,947 + ,8019 + ,56613 + ,3080 + ,16 + ,819 + ,30884 + ,62792 + ,10205 + ,72 + ,757 + ,19540 + ,72535 + ,6095 + ,21 + ,894) + ,dim=c(5 + ,289) + ,dimnames=list(c('totsize' + ,'time_in_rfc' + ,'totrevisions' + ,'totblogs' + ,'pageviews') + ,1:289)) > y <- array(NA,dim=c(5,289),dimnames=list(c('totsize','time_in_rfc','totrevisions','totblogs','pageviews'),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 = '' > par2 = 'none' > par1 = '1' > 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] "totsize" "time_in_rfc" "totrevisions" "totblogs" "pageviews" > 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/11gxp1324297442.tab") + } + } > m Conditional inference tree with 9 terminal nodes Response: totsize Inputs: time_in_rfc, totrevisions, totblogs, pageviews Number of observations: 289 1) totrevisions <= 12770; criterion = 1, statistic = 187.948 2) time_in_rfc <= 49289; criterion = 1, statistic = 53.151 3) totrevisions <= 3083; criterion = 1, statistic = 18.276 4) time_in_rfc <= 31774; criterion = 0.95, statistic = 6.207 5)* weights = 13 4) time_in_rfc > 31774 6)* weights = 11 3) totrevisions > 3083 7)* weights = 7 2) time_in_rfc > 49289 8) time_in_rfc <= 136084; criterion = 1, statistic = 25.292 9) totblogs <= 50; criterion = 0.979, statistic = 7.785 10)* weights = 99 9) totblogs > 50 11)* weights = 23 8) time_in_rfc > 136084 12)* weights = 18 1) totrevisions > 12770 13) totrevisions <= 22583; criterion = 1, statistic = 33.402 14)* weights = 68 13) totrevisions > 22583 15) totblogs <= 132; criterion = 0.992, statistic = 9.498 16)* weights = 27 15) totblogs > 132 17)* weights = 23 > postscript(file="/var/wessaorg/rcomp/tmp/22mkk1324297442.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/3efkk1324297442.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 127358.304 -15073.30435 2 84786 80965.559 3820.44118 3 83123 80965.559 2157.44118 4 101193 99008.630 2184.37037 5 38361 48484.478 -10123.47826 6 68504 31119.747 37384.25253 7 119182 127358.304 -8176.30435 8 22807 10390.909 12416.09091 9 17140 31119.747 -13979.74747 10 116174 99008.630 17165.37037 11 57635 80965.559 -23330.55882 12 66198 80965.559 -14767.55882 13 71701 80965.559 -9264.55882 14 57793 48484.478 9308.52174 15 80444 80965.559 -521.55882 16 53855 56024.778 -2169.77778 17 97668 127358.304 -29690.30435 18 133824 127358.304 6465.69565 19 101481 80965.559 20515.44118 20 99645 80965.559 18679.44118 21 114789 80965.559 33823.44118 22 99052 99008.630 43.37037 23 67654 80965.559 -13311.55882 24 65553 80965.559 -15412.55882 25 97500 80965.559 16534.44118 26 69112 99008.630 -29896.62963 27 82753 99008.630 -16255.62963 28 85323 80965.559 4357.44118 29 72654 99008.630 -26354.62963 30 30727 48484.478 -17757.47826 31 77873 80965.559 -3092.55882 32 117478 99008.630 18469.37037 33 74007 56024.778 17982.22222 34 90183 99008.630 -8825.62963 35 61542 31119.747 30422.25253 36 101494 127358.304 -25864.30435 37 27570 31119.747 -3549.74747 38 55813 56024.778 -211.77778 39 79215 99008.630 -19793.62963 40 1423 3622.846 -2199.84615 41 55461 80965.559 -25504.55882 42 31081 31119.747 -38.74747 43 22996 31119.747 -8123.74747 44 83122 99008.630 -15886.62963 45 70106 80965.559 -10859.55882 46 60578 80965.559 -20387.55882 47 39992 80965.559 -40973.55882 48 79892 80965.559 -1073.55882 49 49810 48484.478 1325.52174 50 71570 31119.747 40450.25253 51 100708 56024.778 44683.22222 52 33032 31119.747 1912.25253 53 82875 80965.559 1909.44118 54 139077 80965.559 58111.44118 55 71595 80965.559 -9370.55882 56 72260 80965.559 -8705.55882 57 5950 3622.846 2327.15385 58 115762 80965.559 34796.44118 59 32551 31119.747 1431.25253 60 31701 31119.747 581.25253 61 80670 99008.630 -18338.62963 62 143558 127358.304 16199.69565 63 117105 80965.559 36139.44118 64 23789 31119.747 -7330.74747 65 120733 127358.304 -6625.30435 66 105195 127358.304 -22163.30435 67 73107 80965.559 -7858.55882 68 132068 127358.304 4709.69565 69 149193 127358.304 21834.69565 70 46821 56024.778 -9203.77778 71 87011 80965.559 6045.44118 72 95260 99008.630 -3748.62963 73 55183 80965.559 -25782.55882 74 106671 80965.559 25705.44118 75 73511 80965.559 -7454.55882 76 92945 80965.559 11979.44118 77 78664 80965.559 -2301.55882 78 70054 80965.559 -10911.55882 79 22618 31119.747 -8501.74747 80 74011 80965.559 -6954.55882 81 83737 80965.559 2771.44118 82 69094 80965.559 -11871.55882 83 93133 99008.630 -5875.62963 84 95536 99008.630 -3472.62963 85 225920 80965.559 144954.44118 86 62133 80965.559 -18832.55882 87 61370 80965.559 -19595.55882 88 43836 31119.747 12716.25253 89 106117 99008.630 7108.37037 90 38692 56024.778 -17332.77778 91 84651 80965.559 3685.44118 92 56622 48484.478 8137.52174 93 15986 31119.747 -15133.74747 94 95364 99008.630 -3644.62963 95 26706 31119.747 -4413.74747 96 89691 80965.559 8725.44118 97 67267 99008.630 -31741.62963 98 126846 127358.304 -512.30435 99 41140 56024.778 -14884.77778 100 102860 80965.559 21894.44118 101 51715 56024.778 -4309.77778 102 55801 80965.559 -25164.55882 103 111813 99008.630 12804.37037 104 120293 99008.630 21284.37037 105 138599 127358.304 11240.69565 106 161647 127358.304 34288.69565 107 115929 99008.630 16920.37037 108 24266 31119.747 -6853.74747 109 162901 127358.304 35542.69565 110 109825 99008.630 10816.37037 111 129838 127358.304 2479.69565 112 37510 56024.778 -18514.77778 113 43750 27589.857 16160.14286 114 40652 80965.559 -40313.55882 115 87771 127358.304 -39587.30435 116 85872 99008.630 -13136.62963 117 89275 99008.630 -9733.62963 118 44418 56024.778 -11606.77778 119 192565 99008.630 93556.37037 120 35232 31119.747 4112.25253 121 40909 80965.559 -40056.55882 122 13294 31119.747 -17825.74747 123 32387 48484.478 -16097.47826 124 140867 48484.478 92382.52174 125 120662 80965.559 39696.44118 126 21233 31119.747 -9886.74747 127 44332 31119.747 13212.25253 128 61056 80965.559 -19909.55882 129 101338 80965.559 20372.44118 130 1168 3622.846 -2454.84615 131 13497 10390.909 3106.09091 132 65567 80965.559 -15398.55882 133 25162 31119.747 -5957.74747 134 32334 31119.747 1214.25253 135 40735 48484.478 -7749.47826 136 91413 80965.559 10447.44118 137 855 3622.846 -2767.84615 138 97068 56024.778 41043.22222 139 44339 27589.857 16749.14286 140 14116 27589.857 -13473.85714 141 10288 10390.909 -102.90909 142 65622 80965.559 -15343.55882 143 16563 31119.747 -14556.74747 144 76643 80965.559 -4322.55882 145 110681 80965.559 29715.44118 146 29011 31119.747 -2108.74747 147 92696 31119.747 61576.25253 148 94785 48484.478 46300.52174 149 8773 10390.909 -1617.90909 150 83209 80965.559 2243.44118 151 93815 99008.630 -5193.62963 152 86687 80965.559 5721.44118 153 34553 31119.747 3433.25253 154 105547 127358.304 -21811.30435 155 103487 80965.559 22521.44118 156 213688 127358.304 86329.69565 157 71220 80965.559 -9745.55882 158 23517 31119.747 -7602.74747 159 56926 31119.747 25806.25253 160 91721 80965.559 10755.44118 161 115168 127358.304 -12190.30435 162 111194 31119.747 80074.25253 163 51009 80965.559 -29956.55882 164 135777 127358.304 8418.69565 165 51513 48484.478 3028.52174 166 74163 99008.630 -24845.62963 167 51633 56024.778 -4391.77778 168 75345 56024.778 19320.22222 169 33416 48484.478 -15068.47826 170 83305 56024.778 27280.22222 171 98952 80965.559 17986.44118 172 102372 127358.304 -24986.30435 173 37238 56024.778 -18786.77778 174 103772 127358.304 -23586.30435 175 123969 80965.559 43003.44118 176 27142 31119.747 -3977.74747 177 135400 99008.630 36391.37037 178 21399 31119.747 -9720.74747 179 130115 127358.304 2756.69565 180 24874 31119.747 -6245.74747 181 34988 31119.747 3868.25253 182 45549 31119.747 14429.25253 183 6023 3622.846 2400.15385 184 64466 80965.559 -16499.55882 185 54990 80965.559 -25975.55882 186 1644 3622.846 -1978.84615 187 6179 10390.909 -4211.90909 188 3926 3622.846 303.15385 189 32755 48484.478 -15729.47826 190 34777 31119.747 3657.25253 191 73224 80965.559 -7741.55882 192 27114 31119.747 -4005.74747 193 20760 31119.747 -10359.74747 194 37636 31119.747 6516.25253 195 65461 80965.559 -15504.55882 196 30080 48484.478 -18404.47826 197 24094 31119.747 -7025.74747 198 69008 48484.478 20523.52174 199 54968 48484.478 6483.52174 200 46090 48484.478 -2394.47826 201 27507 31119.747 -3612.74747 202 10672 10390.909 281.09091 203 34029 31119.747 2909.25253 204 46300 80965.559 -34665.55882 205 24760 31119.747 -6359.74747 206 18779 10390.909 8388.09091 207 21280 31119.747 -9839.74747 208 40662 56024.778 -15362.77778 209 28987 31119.747 -2132.74747 210 22827 31119.747 -8292.74747 211 18513 31119.747 -12606.74747 212 30594 31119.747 -525.74747 213 24006 31119.747 -7113.74747 214 27913 31119.747 -3206.74747 215 42744 31119.747 11624.25253 216 12934 31119.747 -18185.74747 217 22574 31119.747 -8545.74747 218 41385 31119.747 10265.25253 219 18653 31119.747 -12466.74747 220 18472 31119.747 -12647.74747 221 30976 31119.747 -143.74747 222 63339 80965.559 -17626.55882 223 25568 48484.478 -22916.47826 224 33747 31119.747 2627.25253 225 4154 3622.846 531.15385 226 19474 48484.478 -29010.47826 227 35130 31119.747 4010.25253 228 39067 48484.478 -9417.47826 229 13310 31119.747 -17809.74747 230 65892 31119.747 34772.25253 231 4143 3622.846 520.15385 232 28579 31119.747 -2540.74747 233 51776 31119.747 20656.25253 234 21152 31119.747 -9967.74747 235 38084 31119.747 6964.25253 236 27717 31119.747 -3402.74747 237 32928 56024.778 -23096.77778 238 11342 10390.909 951.09091 239 19499 31119.747 -11620.74747 240 16380 27589.857 -11209.85714 241 36874 31119.747 5754.25253 242 48259 80965.559 -32706.55882 243 16734 31119.747 -14385.74747 244 28207 31119.747 -2912.74747 245 30143 31119.747 -976.74747 246 41369 31119.747 10249.25253 247 45833 48484.478 -2651.47826 248 29156 31119.747 -1963.74747 249 35944 31119.747 4824.25253 250 36278 27589.857 8688.14286 251 45588 56024.778 -10436.77778 252 45097 48484.478 -3387.47826 253 3895 3622.846 272.15385 254 28394 31119.747 -2725.74747 255 18632 31119.747 -12487.74747 256 2325 3622.846 -1297.84615 257 25139 27589.857 -2450.85714 258 27975 31119.747 -3144.74747 259 14483 31119.747 -16636.74747 260 13127 27589.857 -14462.85714 261 5839 3622.846 2216.15385 262 24069 31119.747 -7050.74747 263 3738 10390.909 -6652.90909 264 18625 31119.747 -12494.74747 265 36341 31119.747 5221.25253 266 24548 31119.747 -6571.74747 267 21792 31119.747 -9327.74747 268 26263 31119.747 -4856.74747 269 23686 31119.747 -7433.74747 270 49303 48484.478 818.52174 271 25659 31119.747 -5460.74747 272 28904 31119.747 -2215.74747 273 2781 10390.909 -7609.90909 274 29236 31119.747 -1883.74747 275 19546 31119.747 -11573.74747 276 22818 31119.747 -8301.74747 277 32689 31119.747 1569.25253 278 5752 3622.846 2129.15385 279 22197 31119.747 -8922.74747 280 20055 31119.747 -11064.74747 281 25272 31119.747 -5847.74747 282 82206 31119.747 51086.25253 283 32073 31119.747 953.25253 284 5444 10390.909 -4946.90909 285 20154 31119.747 -10965.74747 286 36944 31119.747 5824.25253 287 8019 31119.747 -23100.74747 288 30884 48484.478 -17600.47826 289 19540 31119.747 -11579.74747 > 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/4zsbb1324297442.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/5lnfe1324297442.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/68c0j1324297442.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/7ggq31324297442.tab") + } > > try(system("convert tmp/22mkk1324297442.ps tmp/22mkk1324297442.png",intern=TRUE)) character(0) > try(system("convert tmp/3efkk1324297442.ps tmp/3efkk1324297442.png",intern=TRUE)) character(0) > try(system("convert tmp/4zsbb1324297442.ps tmp/4zsbb1324297442.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.883 0.299 5.207