R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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 + ,210907 + ,56 + ,112285 + ,3 + ,145 + ,869 + ,120982 + ,56 + ,84786 + ,4 + ,101 + ,1530 + ,176508 + ,54 + ,83123 + ,12 + ,98 + ,2172 + ,179321 + ,89 + ,101193 + ,2 + ,132 + ,901 + ,123185 + ,40 + ,38361 + ,1 + ,60 + ,463 + ,52746 + ,25 + ,68504 + ,3 + ,38 + ,3201 + ,385534 + ,92 + ,119182 + ,0 + ,144 + ,371 + ,33170 + ,18 + ,22807 + ,0 + ,5 + ,1192 + ,101645 + ,63 + ,17140 + ,0 + ,28 + ,1583 + ,149061 + ,44 + ,116174 + ,5 + ,84 + ,1439 + ,165446 + ,33 + ,57635 + ,0 + ,79 + ,1764 + ,237213 + ,84 + ,66198 + ,0 + ,127 + ,1495 + ,173326 + ,88 + ,71701 + ,7 + ,78 + ,1373 + ,133131 + ,55 + ,57793 + ,7 + ,60 + ,2187 + ,258873 + ,60 + ,80444 + ,3 + ,131 + ,1491 + ,180083 + ,66 + ,53855 + ,9 + ,84 + ,4041 + ,324799 + ,154 + ,97668 + ,0 + ,133 + ,1706 + ,230964 + ,53 + ,133824 + ,4 + ,150 + ,2152 + ,236785 + ,119 + ,101481 + ,3 + ,91 + ,1036 + ,135473 + ,41 + ,99645 + ,0 + ,132 + ,1882 + ,202925 + ,61 + ,114789 + ,7 + ,136 + ,1929 + ,215147 + ,58 + ,99052 + ,0 + ,124 + ,2242 + ,344297 + ,75 + ,67654 + ,1 + ,118 + ,1220 + ,153935 + ,33 + ,65553 + ,5 + ,70 + ,1289 + ,132943 + ,40 + ,97500 + ,7 + ,107 + ,2515 + ,174724 + ,92 + ,69112 + ,0 + ,119 + ,2147 + ,174415 + ,100 + ,82753 + ,0 + ,89 + ,2352 + ,225548 + ,112 + ,85323 + ,5 + ,112 + ,1638 + ,223632 + ,73 + ,72654 + ,0 + ,108 + ,1222 + ,124817 + ,40 + ,30727 + ,0 + ,52 + ,1812 + ,221698 + ,45 + ,77873 + ,0 + ,112 + ,1677 + ,210767 + ,60 + ,117478 + ,3 + ,116 + ,1579 + ,170266 + ,62 + ,74007 + ,4 + ,123 + ,1731 + ,260561 + ,75 + ,90183 + ,1 + ,125 + ,807 + ,84853 + ,31 + ,61542 + ,4 + ,27 + ,2452 + ,294424 + ,77 + ,101494 + ,2 + ,162 + ,829 + ,101011 + ,34 + ,27570 + ,0 + ,32 + ,1940 + ,215641 + ,46 + ,55813 + ,0 + ,64 + ,2662 + ,325107 + ,99 + ,79215 + ,0 + ,92 + ,186 + ,7176 + ,17 + ,1423 + ,0 + ,0 + ,1499 + ,167542 + ,66 + ,55461 + ,2 + ,83 + ,865 + ,106408 + ,30 + ,31081 + ,1 + ,41 + ,1793 + ,96560 + ,76 + ,22996 + ,0 + ,47 + ,2527 + ,265769 + ,146 + ,83122 + ,2 + ,120 + ,2747 + ,269651 + ,67 + ,70106 + ,10 + ,105 + ,1324 + ,149112 + ,56 + ,60578 + ,6 + ,79 + ,2702 + ,175824 + ,107 + ,39992 + ,0 + ,65 + ,1383 + ,152871 + ,58 + ,79892 + ,5 + ,70 + ,1179 + ,111665 + ,34 + ,49810 + ,4 + ,55 + ,2099 + ,116408 + ,61 + ,71570 + ,1 + ,39 + ,4308 + ,362301 + ,119 + ,100708 + ,2 + ,67 + ,918 + ,78800 + ,42 + ,33032 + ,2 + ,21 + ,1831 + ,183167 + ,66 + ,82875 + ,0 + ,127 + ,3373 + ,277965 + ,89 + ,139077 + ,8 + ,152 + ,1713 + ,150629 + ,44 + ,71595 + ,3 + ,113 + ,1438 + ,168809 + ,66 + ,72260 + ,0 + ,99 + ,496 + ,24188 + ,24 + ,5950 + ,0 + ,7 + ,2253 + ,329267 + ,259 + ,115762 + ,8 + ,141 + ,744 + ,65029 + ,17 + ,32551 + ,5 + ,21 + ,1161 + ,101097 + ,64 + ,31701 + ,3 + ,35 + ,2352 + ,218946 + ,41 + ,80670 + ,1 + ,109 + ,2144 + ,244052 + ,68 + ,143558 + ,5 + ,133 + ,4691 + ,341570 + ,168 + ,117105 + ,1 + ,123 + ,1112 + ,103597 + ,43 + ,23789 + ,1 + ,26 + ,2694 + ,233328 + ,132 + ,120733 + ,5 + ,230 + ,1973 + ,256462 + ,105 + ,105195 + ,0 + ,166 + ,1769 + ,206161 + ,71 + ,73107 + ,12 + ,68 + ,3148 + ,311473 + ,112 + ,132068 + ,8 + ,147 + ,2474 + ,235800 + ,94 + ,149193 + ,8 + ,179 + ,2084 + ,177939 + ,82 + ,46821 + ,8 + ,61 + ,1954 + ,207176 + ,70 + ,87011 + ,8 + ,101 + ,1226 + ,196553 + ,57 + ,95260 + ,2 + ,108 + ,1389 + ,174184 + ,53 + ,55183 + ,0 + ,90 + ,1496 + ,143246 + ,103 + ,106671 + ,5 + ,114 + ,2269 + ,187559 + ,121 + ,73511 + ,8 + ,103 + ,1833 + ,187681 + ,62 + ,92945 + ,2 + ,142 + ,1268 + ,119016 + ,52 + ,78664 + ,5 + ,79 + ,1943 + ,182192 + ,52 + ,70054 + ,12 + ,88 + ,893 + ,73566 + ,32 + ,22618 + ,6 + ,25 + ,1762 + ,194979 + ,62 + ,74011 + ,7 + ,83 + ,1403 + ,167488 + ,45 + ,83737 + ,2 + ,113 + ,1425 + ,143756 + ,46 + ,69094 + ,0 + ,118 + ,1857 + ,275541 + ,63 + ,93133 + ,4 + ,110 + ,1840 + ,243199 + ,75 + ,95536 + ,3 + ,129 + ,1502 + ,182999 + ,88 + ,225920 + ,6 + ,51 + ,1441 + ,135649 + ,46 + ,62133 + ,2 + ,93 + ,1420 + ,152299 + ,53 + ,61370 + ,0 + ,76 + ,1416 + ,120221 + ,37 + ,43836 + ,1 + ,49 + ,2970 + ,346485 + ,90 + ,106117 + ,0 + ,118 + ,1317 + ,145790 + ,63 + ,38692 + ,5 + ,38 + ,1644 + ,193339 + ,78 + ,84651 + ,2 + ,141 + ,870 + ,80953 + ,25 + ,56622 + ,0 + ,58 + ,1654 + ,122774 + ,45 + ,15986 + ,0 + ,27 + ,1054 + ,130585 + ,46 + ,95364 + ,5 + ,91 + ,937 + ,112611 + ,41 + ,26706 + ,0 + ,48 + ,3004 + ,286468 + ,144 + ,89691 + ,1 + ,63 + ,2008 + ,241066 + ,82 + ,67267 + ,0 + ,56 + ,2547 + ,148446 + ,91 + ,126846 + ,1 + ,144 + ,1885 + ,204713 + ,71 + ,41140 + ,1 + ,73 + ,1626 + ,182079 + ,63 + ,102860 + ,2 + ,168 + ,1468 + ,140344 + ,53 + ,51715 + ,6 + ,64 + ,2445 + ,220516 + ,62 + ,55801 + ,1 + ,97 + ,1964 + ,243060 + ,63 + ,111813 + ,4 + ,117 + ,1381 + ,162765 + ,32 + ,120293 + ,2 + ,100 + ,1369 + ,182613 + ,39 + ,138599 + ,3 + ,149 + ,1659 + ,232138 + ,62 + ,161647 + ,0 + ,187 + ,2888 + ,265318 + ,117 + ,115929 + ,10 + ,127 + ,1290 + ,85574 + ,34 + ,24266 + ,0 + ,37 + ,2845 + ,310839 + ,92 + ,162901 + ,9 + ,245 + ,1982 + ,225060 + ,93 + ,109825 + ,7 + ,87 + ,1904 + ,232317 + ,54 + ,129838 + ,0 + ,177 + ,1391 + ,144966 + ,144 + ,37510 + ,0 + ,49 + ,602 + ,43287 + ,14 + ,43750 + ,4 + ,49 + ,1743 + ,155754 + ,61 + ,40652 + ,4 + ,73 + ,1559 + ,164709 + ,109 + ,87771 + ,0 + ,177 + ,2014 + ,201940 + ,38 + ,85872 + ,0 + ,94 + ,2143 + ,235454 + ,73 + ,89275 + ,0 + ,117 + ,2146 + ,220801 + ,75 + ,44418 + ,1 + ,60 + ,874 + ,99466 + ,50 + ,192565 + ,0 + ,55 + ,1590 + ,92661 + ,61 + ,35232 + ,1 + ,39 + ,1590 + ,133328 + ,55 + ,40909 + ,0 + ,64 + ,1210 + ,61361 + ,77 + ,13294 + ,0 + ,26 + ,2072 + ,125930 + ,75 + ,32387 + ,4 + ,64 + ,1281 + ,100750 + ,72 + ,140867 + ,0 + ,58 + ,1401 + ,224549 + ,50 + ,120662 + ,4 + ,95 + ,834 + ,82316 + ,32 + ,21233 + ,4 + ,25 + ,1105 + ,102010 + ,53 + ,44332 + ,3 + ,26 + ,1272 + ,101523 + ,42 + ,61056 + ,0 + ,76 + ,1944 + ,243511 + ,71 + ,101338 + ,0 + ,129 + ,391 + ,22938 + ,10 + ,1168 + ,0 + ,11 + ,761 + ,41566 + ,35 + ,13497 + ,5 + ,2 + ,1605 + ,152474 + ,65 + ,65567 + ,0 + ,101 + ,530 + ,61857 + ,25 + ,25162 + ,4 + ,28 + ,1988 + ,99923 + ,66 + ,32334 + ,0 + ,36 + ,1386 + ,132487 + ,41 + ,40735 + ,0 + ,89 + ,2395 + ,317394 + ,86 + ,91413 + ,1 + ,193 + ,387 + ,21054 + ,16 + ,855 + ,0 + ,4 + ,1742 + ,209641 + ,42 + ,97068 + ,5 + ,84 + ,620 + ,22648 + ,19 + ,44339 + ,0 + ,23 + ,449 + ,31414 + ,19 + ,14116 + ,0 + ,39 + ,800 + ,46698 + ,45 + ,10288 + ,0 + ,14 + ,1684 + ,131698 + ,65 + ,65622 + ,0 + ,78 + ,1050 + ,91735 + ,35 + ,16563 + ,0 + ,14 + ,2699 + ,244749 + ,95 + ,76643 + ,2 + ,101 + ,1606 + ,184510 + ,49 + ,110681 + ,7 + ,82 + ,1502 + ,79863 + ,37 + ,29011 + ,1 + ,24 + ,1204 + ,128423 + ,64 + ,92696 + ,8 + ,36 + ,1138 + ,97839 + ,38 + ,94785 + ,2 + ,75 + ,568 + ,38214 + ,34 + ,8773 + ,0 + ,16 + ,1459 + ,151101 + ,32 + ,83209 + ,2 + ,55 + ,2158 + ,272458 + ,65 + ,93815 + ,0 + ,131 + ,1111 + ,172494 + ,52 + ,86687 + ,0 + ,131 + ,1421 + ,108043 + ,62 + ,34553 + ,1 + ,39 + ,2833 + ,328107 + ,65 + ,105547 + ,3 + ,144 + ,1955 + ,250579 + ,83 + ,103487 + ,0 + ,139 + ,2922 + ,351067 + ,95 + ,213688 + ,3 + ,211 + ,1002 + ,158015 + ,29 + ,71220 + ,0 + ,78 + ,1060 + ,98866 + ,18 + ,23517 + ,0 + ,50 + ,956 + ,85439 + ,33 + ,56926 + ,0 + ,39 + ,2186 + ,229242 + ,247 + ,91721 + ,4 + ,90 + ,3604 + ,351619 + ,139 + ,115168 + ,4 + ,166 + ,1035 + ,84207 + ,29 + ,111194 + ,11 + ,12 + ,1417 + ,120445 + ,118 + ,51009 + ,0 + ,57 + ,3261 + ,324598 + ,110 + ,135777 + ,0 + ,133 + ,1587 + ,131069 + ,67 + ,51513 + ,4 + ,69 + ,1424 + ,204271 + ,42 + ,74163 + ,0 + ,119 + ,1701 + ,165543 + ,65 + ,51633 + ,1 + ,119 + ,1249 + ,141722 + ,94 + ,75345 + ,0 + ,65 + ,946 + ,116048 + ,64 + ,33416 + ,0 + ,61 + ,1926 + ,250047 + ,81 + ,83305 + ,0 + ,49 + ,3352 + ,299775 + ,95 + ,98952 + ,9 + ,101 + ,1641 + ,195838 + ,67 + ,102372 + ,1 + ,196 + ,2035 + ,173260 + ,63 + ,37238 + ,3 + ,15 + ,2312 + ,254488 + ,83 + ,103772 + ,10 + ,136 + ,1369 + ,104389 + ,45 + ,123969 + ,5 + ,89 + ,1577 + ,136084 + ,30 + ,27142 + ,0 + ,40 + ,2201 + ,199476 + ,70 + ,135400 + ,2 + ,123 + ,961 + ,92499 + ,32 + ,21399 + ,0 + ,21 + ,1900 + ,224330 + ,83 + ,130115 + ,1 + ,163 + ,1254 + ,135781 + ,31 + ,24874 + ,2 + ,29 + ,1335 + ,74408 + ,67 + ,34988 + ,4 + ,35 + ,1597 + ,81240 + ,66 + ,45549 + ,0 + ,13 + ,207 + ,14688 + ,10 + ,6023 + ,0 + ,5 + ,1645 + ,181633 + ,70 + ,64466 + ,2 + ,96 + ,2429 + ,271856 + ,103 + ,54990 + ,1 + ,151 + ,151 + ,7199 + ,5 + ,1644 + ,0 + ,6 + ,474 + ,46660 + ,20 + ,6179 + ,0 + ,13 + ,141 + ,17547 + ,5 + ,3926 + ,0 + ,3 + ,1639 + ,133368 + ,36 + ,32755 + ,1 + ,56 + ,872 + ,95227 + ,34 + ,34777 + ,0 + ,23 + ,1318 + ,152601 + ,48 + ,73224 + ,2 + ,57 + ,1018 + ,98146 + ,40 + ,27114 + ,0 + ,14 + ,1383 + ,79619 + ,43 + ,20760 + ,3 + ,43 + ,1314 + ,59194 + ,31 + ,37636 + ,6 + ,20 + ,1335 + ,139942 + ,42 + ,65461 + ,0 + ,72 + ,1403 + ,118612 + ,46 + ,30080 + ,2 + ,87 + ,910 + ,72880 + ,33 + ,24094 + ,0 + ,21 + ,616 + ,65475 + ,18 + ,69008 + ,2 + ,56 + ,1407 + ,99643 + ,55 + ,54968 + ,1 + ,59 + ,771 + ,71965 + ,35 + ,46090 + ,1 + ,82 + ,766 + ,77272 + ,59 + ,27507 + ,2 + ,43 + ,473 + ,49289 + ,19 + ,10672 + ,1 + ,25 + ,1376 + ,135131 + ,66 + ,34029 + ,0 + ,38 + ,1232 + ,108446 + ,60 + ,46300 + ,1 + ,25 + ,1521 + ,89746 + ,36 + ,24760 + ,3 + ,38 + ,572 + ,44296 + ,25 + ,18779 + ,0 + ,12 + ,1059 + ,77648 + ,47 + ,21280 + ,0 + ,29 + ,1544 + ,181528 + ,54 + ,40662 + ,0 + ,47 + ,1230 + ,134019 + ,53 + ,28987 + ,0 + ,45 + ,1206 + ,124064 + ,40 + ,22827 + ,1 + ,40 + ,1205 + ,92630 + ,40 + ,18513 + ,4 + ,30 + ,1255 + ,121848 + ,39 + ,30594 + ,0 + ,41 + ,613 + ,52915 + ,14 + ,24006 + ,0 + ,25 + ,721 + ,81872 + ,45 + ,27913 + ,0 + ,23 + ,1109 + ,58981 + ,36 + ,42744 + ,7 + ,14 + ,740 + ,53515 + ,28 + ,12934 + ,2 + ,16 + ,1126 + ,60812 + ,44 + ,22574 + ,0 + ,26 + ,728 + ,56375 + ,30 + ,41385 + ,7 + ,21 + ,689 + ,65490 + ,22 + ,18653 + ,3 + ,27 + ,592 + ,80949 + ,17 + ,18472 + ,0 + ,9 + ,995 + ,76302 + ,31 + ,30976 + ,0 + ,33 + ,1613 + ,104011 + ,55 + ,63339 + ,6 + ,42 + ,2048 + ,98104 + ,54 + ,25568 + ,2 + ,68 + ,705 + ,67989 + ,21 + ,33747 + ,0 + ,32 + ,301 + ,30989 + ,14 + ,4154 + ,0 + ,6 + ,1803 + ,135458 + ,81 + ,19474 + ,3 + ,67 + ,799 + ,73504 + ,35 + ,35130 + ,0 + ,33 + ,861 + ,63123 + ,43 + ,39067 + ,1 + ,77 + ,1186 + ,61254 + ,46 + ,13310 + ,1 + ,46 + ,1451 + ,74914 + ,30 + ,65892 + ,0 + ,30 + ,628 + ,31774 + ,23 + ,4143 + ,1 + ,0 + ,1161 + ,81437 + ,38 + ,28579 + ,0 + ,36 + ,1463 + ,87186 + ,54 + ,51776 + ,0 + ,46 + ,742 + ,50090 + ,20 + ,21152 + ,0 + ,18 + ,979 + ,65745 + ,53 + ,38084 + ,0 + ,48 + ,675 + ,56653 + ,45 + ,27717 + ,0 + ,29 + ,1241 + ,158399 + ,39 + ,32928 + ,0 + ,28 + ,676 + ,46455 + ,20 + ,11342 + ,0 + ,34 + ,1049 + ,73624 + ,24 + ,19499 + ,0 + ,33 + ,620 + ,38395 + ,31 + ,16380 + ,0 + ,34 + ,1081 + ,91899 + ,35 + ,36874 + ,0 + ,33 + ,1688 + ,139526 + ,151 + ,48259 + ,0 + ,80 + ,736 + ,52164 + ,52 + ,16734 + ,0 + ,32 + ,617 + ,51567 + ,30 + ,28207 + ,2 + ,30 + ,812 + ,70551 + ,31 + ,30143 + ,0 + ,41 + ,1051 + ,84856 + ,29 + ,41369 + ,1 + ,41 + ,1656 + ,102538 + ,57 + ,45833 + ,1 + ,51 + ,705 + ,86678 + ,40 + ,29156 + ,0 + ,18 + ,945 + ,85709 + ,44 + ,35944 + ,0 + ,34 + ,554 + ,34662 + ,25 + ,36278 + ,0 + ,31 + ,1597 + ,150580 + ,77 + ,45588 + ,0 + ,39 + ,982 + ,99611 + ,35 + ,45097 + ,0 + ,54 + ,222 + ,19349 + ,11 + ,3895 + ,0 + ,14 + ,1212 + ,99373 + ,63 + ,28394 + ,1 + ,24 + ,1143 + ,86230 + ,44 + ,18632 + ,0 + ,24 + ,435 + ,30837 + ,19 + ,2325 + ,0 + ,8 + ,532 + ,31706 + ,13 + ,25139 + ,0 + ,26 + ,882 + ,89806 + ,42 + ,27975 + ,0 + ,19 + ,608 + ,62088 + ,38 + ,14483 + ,1 + ,11 + ,459 + ,40151 + ,29 + ,13127 + ,0 + ,14 + ,578 + ,27634 + ,20 + ,5839 + ,0 + ,1 + ,826 + ,76990 + ,27 + ,24069 + ,0 + ,39 + ,509 + ,37460 + ,20 + ,3738 + ,0 + ,5 + ,717 + ,54157 + ,19 + ,18625 + ,0 + ,37 + ,637 + ,49862 + ,37 + ,36341 + ,0 + ,32 + ,857 + ,84337 + ,26 + ,24548 + ,0 + ,38 + ,830 + ,64175 + ,42 + ,21792 + ,0 + ,47 + ,652 + ,59382 + ,49 + ,26263 + ,0 + ,47 + ,707 + ,119308 + ,30 + ,23686 + ,0 + ,37 + ,954 + ,76702 + ,49 + ,49303 + ,0 + ,51 + ,1461 + ,103425 + ,67 + ,25659 + ,1 + ,45 + ,672 + ,70344 + ,28 + ,28904 + ,0 + ,21 + ,778 + ,43410 + ,19 + ,2781 + ,0 + ,1 + ,1141 + ,104838 + ,49 + ,29236 + ,1 + ,42 + ,680 + ,62215 + ,27 + ,19546 + ,0 + ,26 + ,1090 + ,69304 + ,30 + ,22818 + ,6 + ,21 + ,616 + ,53117 + ,22 + ,32689 + ,3 + ,4 + ,285 + ,19764 + ,12 + ,5752 + ,1 + ,10 + ,1145 + ,86680 + ,31 + ,22197 + ,2 + ,43 + ,733 + ,84105 + ,20 + ,20055 + ,0 + ,34 + ,888 + ,77945 + ,20 + ,25272 + ,0 + ,31 + ,849 + ,89113 + ,39 + ,82206 + ,0 + ,19 + ,1182 + ,91005 + ,29 + ,32073 + ,3 + ,34 + ,528 + ,40248 + ,16 + ,5444 + ,1 + ,6 + ,642 + ,64187 + ,27 + ,20154 + ,0 + ,11 + ,947 + ,50857 + ,21 + ,36944 + ,0 + ,24 + ,819 + ,56613 + ,19 + ,8019 + ,1 + ,16 + ,757 + ,62792 + ,35 + ,30884 + ,0 + ,72 + ,894 + ,72535 + ,14 + ,19540 + ,0 + ,21) + ,dim=c(6 + ,289) + ,dimnames=list(c('views' + ,'time' + ,'logins' + ,'totsize' + ,'shared' + ,'blogs') + ,1:289)) > y <- array(NA,dim=c(6,289),dimnames=list(c('views','time','logins','totsize','shared','blogs'),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 = '4' > 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 Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, as.Date.numeric Loading required package: sandwich Loading required package: strucchange Loading required package: vcd Loading required package: MASS Loading required package: colorspace > library(Hmisc) Hmisc library by Frank E Harrell Jr Type library(help='Hmisc'), ?Overview, or ?Hmisc.Overview') to see overall documentation. NOTE:Hmisc no longer redefines [.factor to drop unused levels when subsetting. To get the old behavior of Hmisc type dropUnusedLevels(). 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] "views" "time" "logins" "totsize" "shared" "blogs" > 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/12pet1354823166.tab") + } + } > m Conditional inference tree with 9 terminal nodes Response: totsize Inputs: views, time, logins, shared, blogs Number of observations: 289 1) blogs <= 50; criterion = 1, statistic = 183.559 2) time <= 49289; criterion = 1, statistic = 36.79 3) blogs <= 16; criterion = 0.999, statistic = 13.858 4)* weights = 23 3) blogs > 16 5)* weights = 8 2) time > 49289 6) shared <= 5; criterion = 1, statistic = 17.296 7) time <= 136084; criterion = 0.998, statistic = 13.032 8)* weights = 93 7) time > 136084 9)* weights = 7 6) shared > 5 10)* weights = 8 1) blogs > 50 11) blogs <= 120; criterion = 1, statistic = 48.913 12) time <= 182192; criterion = 0.983, statistic = 8.531 13)* weights = 67 12) time > 182192 14)* weights = 36 11) blogs > 120 15) blogs <= 177; criterion = 0.995, statistic = 10.926 16)* weights = 40 15) blogs > 177 17)* weights = 7 > postscript(file="/var/wessaorg/rcomp/tmp/2bv741354823166.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/390sy1354823166.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.88 5618.1250 2 84786 64960.87 19825.1343 3 83123 64960.87 18162.1343 4 101193 106666.88 -5473.8750 5 38361 64960.87 -26599.8657 6 68504 29635.10 38868.9032 7 119182 106666.88 12515.1250 8 22807 6630.87 16176.1304 9 17140 29635.10 -12495.0968 10 116174 64960.87 51213.1343 11 57635 64960.87 -7325.8657 12 66198 106666.88 -40468.8750 13 71701 64960.87 6740.1343 14 57793 64960.87 -7167.8657 15 80444 106666.88 -26222.8750 16 53855 64960.87 -11105.8657 17 97668 106666.88 -8998.8750 18 133824 106666.88 27157.1250 19 101481 88476.64 13004.3611 20 99645 106666.88 -7021.8750 21 114789 106666.88 8122.1250 22 99052 106666.88 -7614.8750 23 67654 88476.64 -20822.6389 24 65553 64960.87 592.1343 25 97500 64960.87 32539.1343 26 69112 64960.87 4151.1343 27 82753 64960.87 17792.1343 28 85323 88476.64 -3153.6389 29 72654 88476.64 -15822.6389 30 30727 64960.87 -34233.8657 31 77873 88476.64 -10603.6389 32 117478 88476.64 29001.3611 33 74007 106666.88 -32659.8750 34 90183 106666.88 -16483.8750 35 61542 29635.10 31906.9032 36 101494 106666.88 -5172.8750 37 27570 29635.10 -2065.0968 38 55813 88476.64 -32663.6389 39 79215 88476.64 -9261.6389 40 1423 6630.87 -5207.8696 41 55461 64960.87 -9499.8657 42 31081 29635.10 1445.9032 43 22996 29635.10 -6639.0968 44 83122 88476.64 -5354.6389 45 70106 88476.64 -18370.6389 46 60578 64960.87 -4382.8657 47 39992 64960.87 -24968.8657 48 79892 64960.87 14931.1343 49 49810 64960.87 -15150.8657 50 71570 29635.10 41934.9032 51 100708 88476.64 12231.3611 52 33032 29635.10 3396.9032 53 82875 106666.88 -23791.8750 54 139077 106666.88 32410.1250 55 71595 64960.87 6634.1343 56 72260 64960.87 7299.1343 57 5950 6630.87 -680.8696 58 115762 106666.88 9095.1250 59 32551 29635.10 2915.9032 60 31701 29635.10 2065.9032 61 80670 88476.64 -7806.6389 62 143558 106666.88 36891.1250 63 117105 106666.88 10438.1250 64 23789 29635.10 -5846.0968 65 120733 143135.29 -22402.2857 66 105195 106666.88 -1471.8750 67 73107 88476.64 -15369.6389 68 132068 106666.88 25401.1250 69 149193 143135.29 6057.7143 70 46821 64960.87 -18139.8657 71 87011 88476.64 -1465.6389 72 95260 88476.64 6783.3611 73 55183 64960.87 -9777.8657 74 106671 64960.87 41710.1343 75 73511 88476.64 -14965.6389 76 92945 106666.88 -13721.8750 77 78664 64960.87 13703.1343 78 70054 64960.87 5093.1343 79 22618 54303.75 -31685.7500 80 74011 88476.64 -14465.6389 81 83737 64960.87 18776.1343 82 69094 64960.87 4133.1343 83 93133 88476.64 4656.3611 84 95536 106666.88 -11130.8750 85 225920 88476.64 137443.3611 86 62133 64960.87 -2827.8657 87 61370 64960.87 -3590.8657 88 43836 29635.10 14200.9032 89 106117 88476.64 17640.3611 90 38692 45131.86 -6439.8571 91 84651 106666.88 -22015.8750 92 56622 64960.87 -8338.8657 93 15986 29635.10 -13649.0968 94 95364 64960.87 30403.1343 95 26706 29635.10 -2929.0968 96 89691 88476.64 1214.3611 97 67267 88476.64 -21209.6389 98 126846 106666.88 20179.1250 99 41140 88476.64 -47336.6389 100 102860 106666.88 -3806.8750 101 51715 64960.87 -13245.8657 102 55801 88476.64 -32675.6389 103 111813 88476.64 23336.3611 104 120293 64960.87 55332.1343 105 138599 106666.88 31932.1250 106 161647 143135.29 18511.7143 107 115929 106666.88 9262.1250 108 24266 29635.10 -5369.0968 109 162901 143135.29 19765.7143 110 109825 88476.64 21348.3611 111 129838 106666.88 23171.1250 112 37510 45131.86 -7621.8571 113 43750 25252.00 18498.0000 114 40652 64960.87 -24308.8657 115 87771 106666.88 -18895.8750 116 85872 88476.64 -2604.6389 117 89275 88476.64 798.3611 118 44418 88476.64 -44058.6389 119 192565 64960.87 127604.1343 120 35232 29635.10 5596.9032 121 40909 64960.87 -24051.8657 122 13294 29635.10 -16341.0968 123 32387 64960.87 -32573.8657 124 140867 64960.87 75906.1343 125 120662 88476.64 32185.3611 126 21233 29635.10 -8402.0968 127 44332 29635.10 14696.9032 128 61056 64960.87 -3904.8657 129 101338 106666.88 -5328.8750 130 1168 6630.87 -5462.8696 131 13497 6630.87 6866.1304 132 65567 64960.87 606.1343 133 25162 29635.10 -4473.0968 134 32334 29635.10 2698.9032 135 40735 64960.87 -24225.8657 136 91413 143135.29 -51722.2857 137 855 6630.87 -5775.8696 138 97068 88476.64 8591.3611 139 44339 25252.00 19087.0000 140 14116 25252.00 -11136.0000 141 10288 6630.87 3657.1304 142 65622 64960.87 661.1343 143 16563 29635.10 -13072.0968 144 76643 88476.64 -11833.6389 145 110681 88476.64 22204.3611 146 29011 29635.10 -624.0968 147 92696 54303.75 38392.2500 148 94785 64960.87 29824.1343 149 8773 6630.87 2142.1304 150 83209 64960.87 18248.1343 151 93815 106666.88 -12851.8750 152 86687 106666.88 -19979.8750 153 34553 29635.10 4917.9032 154 105547 106666.88 -1119.8750 155 103487 106666.88 -3179.8750 156 213688 143135.29 70552.7143 157 71220 64960.87 6259.1343 158 23517 29635.10 -6118.0968 159 56926 29635.10 27290.9032 160 91721 88476.64 3244.3611 161 115168 106666.88 8501.1250 162 111194 54303.75 56890.2500 163 51009 64960.87 -13951.8657 164 135777 106666.88 29110.1250 165 51513 64960.87 -13447.8657 166 74163 88476.64 -14313.6389 167 51633 64960.87 -13327.8657 168 75345 64960.87 10384.1343 169 33416 64960.87 -31544.8657 170 83305 45131.86 38173.1429 171 98952 88476.64 10475.3611 172 102372 143135.29 -40763.2857 173 37238 45131.86 -7893.8571 174 103772 106666.88 -2894.8750 175 123969 64960.87 59008.1343 176 27142 29635.10 -2493.0968 177 135400 106666.88 28733.1250 178 21399 29635.10 -8236.0968 179 130115 106666.88 23448.1250 180 24874 29635.10 -4761.0968 181 34988 29635.10 5352.9032 182 45549 29635.10 15913.9032 183 6023 6630.87 -607.8696 184 64466 64960.87 -494.8657 185 54990 106666.88 -51676.8750 186 1644 6630.87 -4986.8696 187 6179 6630.87 -451.8696 188 3926 6630.87 -2704.8696 189 32755 64960.87 -32205.8657 190 34777 29635.10 5141.9032 191 73224 64960.87 8263.1343 192 27114 29635.10 -2521.0968 193 20760 29635.10 -8875.0968 194 37636 54303.75 -16667.7500 195 65461 64960.87 500.1343 196 30080 64960.87 -34880.8657 197 24094 29635.10 -5541.0968 198 69008 64960.87 4047.1343 199 54968 64960.87 -9992.8657 200 46090 64960.87 -18870.8657 201 27507 29635.10 -2128.0968 202 10672 25252.00 -14580.0000 203 34029 29635.10 4393.9032 204 46300 29635.10 16664.9032 205 24760 29635.10 -4875.0968 206 18779 6630.87 12148.1304 207 21280 29635.10 -8355.0968 208 40662 45131.86 -4469.8571 209 28987 29635.10 -648.0968 210 22827 29635.10 -6808.0968 211 18513 29635.10 -11122.0968 212 30594 29635.10 958.9032 213 24006 29635.10 -5629.0968 214 27913 29635.10 -1722.0968 215 42744 54303.75 -11559.7500 216 12934 29635.10 -16701.0968 217 22574 29635.10 -7061.0968 218 41385 54303.75 -12918.7500 219 18653 29635.10 -10982.0968 220 18472 29635.10 -11163.0968 221 30976 29635.10 1340.9032 222 63339 54303.75 9035.2500 223 25568 64960.87 -39392.8657 224 33747 29635.10 4111.9032 225 4154 6630.87 -2476.8696 226 19474 64960.87 -45486.8657 227 35130 29635.10 5494.9032 228 39067 64960.87 -25893.8657 229 13310 29635.10 -16325.0968 230 65892 29635.10 36256.9032 231 4143 6630.87 -2487.8696 232 28579 29635.10 -1056.0968 233 51776 29635.10 22140.9032 234 21152 29635.10 -8483.0968 235 38084 29635.10 8448.9032 236 27717 29635.10 -1918.0968 237 32928 45131.86 -12203.8571 238 11342 25252.00 -13910.0000 239 19499 29635.10 -10136.0968 240 16380 25252.00 -8872.0000 241 36874 29635.10 7238.9032 242 48259 64960.87 -16701.8657 243 16734 29635.10 -12901.0968 244 28207 29635.10 -1428.0968 245 30143 29635.10 507.9032 246 41369 29635.10 11733.9032 247 45833 64960.87 -19127.8657 248 29156 29635.10 -479.0968 249 35944 29635.10 6308.9032 250 36278 25252.00 11026.0000 251 45588 45131.86 456.1429 252 45097 64960.87 -19863.8657 253 3895 6630.87 -2735.8696 254 28394 29635.10 -1241.0968 255 18632 29635.10 -11003.0968 256 2325 6630.87 -4305.8696 257 25139 25252.00 -113.0000 258 27975 29635.10 -1660.0968 259 14483 29635.10 -15152.0968 260 13127 6630.87 6496.1304 261 5839 6630.87 -791.8696 262 24069 29635.10 -5566.0968 263 3738 6630.87 -2892.8696 264 18625 29635.10 -11010.0968 265 36341 29635.10 6705.9032 266 24548 29635.10 -5087.0968 267 21792 29635.10 -7843.0968 268 26263 29635.10 -3372.0968 269 23686 29635.10 -5949.0968 270 49303 64960.87 -15657.8657 271 25659 29635.10 -3976.0968 272 28904 29635.10 -731.0968 273 2781 6630.87 -3849.8696 274 29236 29635.10 -399.0968 275 19546 29635.10 -10089.0968 276 22818 54303.75 -31485.7500 277 32689 29635.10 3053.9032 278 5752 6630.87 -878.8696 279 22197 29635.10 -7438.0968 280 20055 29635.10 -9580.0968 281 25272 29635.10 -4363.0968 282 82206 29635.10 52570.9032 283 32073 29635.10 2437.9032 284 5444 6630.87 -1186.8696 285 20154 29635.10 -9481.0968 286 36944 29635.10 7308.9032 287 8019 29635.10 -21616.0968 288 30884 64960.87 -34076.8657 289 19540 29635.10 -10095.0968 > 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/42yl01354823166.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/5xrzt1354823166.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/65w9i1354823166.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/73mye1354823166.tab") + } > > try(system("convert tmp/2bv741354823166.ps tmp/2bv741354823166.png",intern=TRUE)) character(0) > try(system("convert tmp/390sy1354823166.ps tmp/390sy1354823166.png",intern=TRUE)) character(0) > try(system("convert tmp/42yl01354823166.ps tmp/42yl01354823166.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.801 0.543 8.325