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 + ,396 + ,81 + ,3 + ,79 + ,30 + ,869 + ,120982 + ,297 + ,55 + ,4 + ,58 + ,28 + ,1530 + ,176508 + ,559 + ,50 + ,12 + ,60 + ,38 + ,2172 + ,179321 + ,967 + ,125 + ,2 + ,108 + ,30 + ,901 + ,123185 + ,270 + ,40 + ,1 + ,49 + ,22 + ,463 + ,52746 + ,143 + ,37 + ,3 + ,0 + ,26 + ,3201 + ,385534 + ,1562 + ,63 + ,0 + ,121 + ,25 + ,371 + ,33170 + ,109 + ,44 + ,0 + ,1 + ,18 + ,1192 + ,101645 + ,371 + ,88 + ,0 + ,20 + ,11 + ,1583 + ,149061 + ,656 + ,66 + ,5 + ,43 + ,26 + ,1439 + ,165446 + ,511 + ,57 + ,0 + ,69 + ,25 + ,1764 + ,237213 + ,655 + ,74 + ,0 + ,78 + ,38 + ,1495 + ,173326 + ,465 + ,49 + ,7 + ,86 + ,44 + ,1373 + ,133131 + ,525 + ,52 + ,7 + ,44 + ,30 + ,2187 + ,258873 + ,885 + ,88 + ,3 + ,104 + ,40 + ,1491 + ,180083 + ,497 + ,36 + ,9 + ,63 + ,34 + ,4041 + ,324799 + ,1436 + ,108 + ,0 + ,158 + ,47 + ,1706 + ,230964 + ,612 + ,43 + ,4 + ,102 + ,30 + ,2152 + ,236785 + ,865 + ,75 + ,3 + ,77 + ,31 + ,1036 + ,135473 + ,385 + ,32 + ,0 + ,82 + ,23 + ,1882 + ,202925 + ,567 + ,44 + ,7 + ,115 + ,36 + ,1929 + ,215147 + ,639 + ,85 + ,0 + ,101 + ,36 + ,2242 + ,344297 + ,963 + ,86 + ,1 + ,80 + ,30 + ,1220 + ,153935 + ,398 + ,56 + ,5 + ,50 + ,25 + ,1289 + ,132943 + ,410 + ,50 + ,7 + ,83 + ,39 + ,2515 + ,174724 + ,966 + ,135 + ,0 + ,123 + ,34 + ,2147 + ,174415 + ,801 + ,63 + ,0 + ,73 + ,31 + ,2352 + ,225548 + ,892 + ,81 + ,5 + ,81 + ,31 + ,1638 + ,223632 + ,513 + ,52 + ,0 + ,105 + ,33 + ,1222 + ,124817 + ,469 + ,44 + ,0 + ,47 + ,25 + ,1812 + ,221698 + ,683 + ,113 + ,0 + ,105 + ,33 + ,1677 + ,210767 + ,643 + ,39 + ,3 + ,94 + ,35 + ,1579 + ,170266 + ,535 + ,73 + ,4 + ,44 + ,42 + ,1731 + ,260561 + ,625 + ,48 + ,1 + ,114 + ,43 + ,807 + ,84853 + ,264 + ,33 + ,4 + ,38 + ,30 + ,2452 + ,294424 + ,992 + ,59 + ,2 + ,107 + ,33 + ,829 + ,101011 + ,238 + ,41 + ,0 + ,30 + ,13 + ,1940 + ,215641 + ,818 + ,69 + ,0 + ,71 + ,32 + ,2662 + ,325107 + ,937 + ,64 + ,0 + ,84 + ,36 + ,186 + ,7176 + ,70 + ,1 + ,0 + ,0 + ,0 + ,1499 + ,167542 + ,507 + ,59 + ,2 + ,59 + ,28 + ,865 + ,106408 + ,260 + ,32 + ,1 + ,33 + ,14 + ,1793 + ,96560 + ,503 + ,129 + ,0 + ,42 + ,17 + ,2527 + ,265769 + ,927 + ,37 + ,2 + ,96 + ,32 + ,2747 + ,269651 + ,1269 + ,31 + ,10 + ,106 + ,30 + ,1324 + ,149112 + ,537 + ,65 + ,6 + ,56 + ,35 + ,2702 + ,175824 + ,910 + ,107 + ,0 + ,57 + ,20 + ,1383 + ,152871 + ,532 + ,74 + ,5 + ,59 + ,28 + ,1179 + ,111665 + ,345 + ,54 + ,4 + ,39 + ,28 + ,2099 + ,116408 + ,918 + ,76 + ,1 + ,34 + ,39 + ,4308 + ,362301 + ,1635 + ,715 + ,2 + ,76 + ,34 + ,918 + ,78800 + ,330 + ,57 + ,2 + ,20 + ,26 + ,1831 + ,183167 + ,557 + ,66 + ,0 + ,91 + ,39 + ,3373 + ,277965 + ,1178 + ,106 + ,8 + ,115 + ,39 + ,1713 + ,150629 + ,740 + ,54 + ,3 + ,85 + ,33 + ,1438 + ,168809 + ,452 + ,32 + ,0 + ,76 + ,28 + ,496 + ,24188 + ,218 + ,20 + ,0 + ,8 + ,4 + ,2253 + ,329267 + ,764 + ,71 + ,8 + ,79 + ,39 + ,744 + ,65029 + ,255 + ,21 + ,5 + ,21 + ,18 + ,1161 + ,101097 + ,454 + ,70 + ,3 + ,30 + ,14 + ,2352 + ,218946 + ,866 + ,112 + ,1 + ,76 + ,29 + ,2144 + ,244052 + ,574 + ,66 + ,5 + ,101 + ,44 + ,4691 + ,341570 + ,1276 + ,190 + ,1 + ,94 + ,21 + ,1112 + ,103597 + ,379 + ,66 + ,1 + ,27 + ,16 + ,2694 + ,233328 + ,825 + ,165 + ,5 + ,92 + ,28 + ,1973 + ,256462 + ,798 + ,56 + ,0 + ,123 + ,35 + ,1769 + ,206161 + ,663 + ,61 + ,12 + ,75 + ,28 + ,3148 + ,311473 + ,1069 + ,53 + ,8 + ,128 + ,38 + ,2474 + ,235800 + ,921 + ,127 + ,8 + ,105 + ,23 + ,2084 + ,177939 + ,858 + ,63 + ,8 + ,55 + ,36 + ,1954 + ,207176 + ,711 + ,38 + ,8 + ,56 + ,32 + ,1226 + ,196553 + ,503 + ,50 + ,2 + ,41 + ,29 + ,1389 + ,174184 + ,382 + ,52 + ,0 + ,72 + ,25 + ,1496 + ,143246 + ,464 + ,42 + ,5 + ,67 + ,27 + ,2269 + ,187559 + ,717 + ,76 + ,8 + ,75 + ,36 + ,1833 + ,187681 + ,690 + ,67 + ,2 + ,114 + ,28 + ,1268 + ,119016 + ,462 + ,50 + ,5 + ,118 + ,23 + ,1943 + ,182192 + ,657 + ,53 + ,12 + ,77 + ,40 + ,893 + ,73566 + ,385 + ,39 + ,6 + ,22 + ,23 + ,1762 + ,194979 + ,577 + ,50 + ,7 + ,66 + ,40 + ,1403 + ,167488 + ,619 + ,77 + ,2 + ,69 + ,28 + ,1425 + ,143756 + ,479 + ,57 + ,0 + ,105 + ,34 + ,1857 + ,275541 + ,817 + ,73 + ,4 + ,116 + ,33 + ,1840 + ,243199 + ,752 + ,34 + ,3 + ,88 + ,28 + ,1502 + ,182999 + ,430 + ,39 + ,6 + ,73 + ,34 + ,1441 + ,135649 + ,451 + ,46 + ,2 + ,99 + ,30 + ,1420 + ,152299 + ,537 + ,63 + ,0 + ,62 + ,33 + ,1416 + ,120221 + ,519 + ,35 + ,1 + ,53 + ,22 + ,2970 + ,346485 + ,1000 + ,106 + ,0 + ,118 + ,38 + ,1317 + ,145790 + ,637 + ,43 + ,5 + ,30 + ,26 + ,1644 + ,193339 + ,465 + ,47 + ,2 + ,100 + ,35 + ,870 + ,80953 + ,437 + ,31 + ,0 + ,49 + ,8 + ,1654 + ,122774 + ,711 + ,162 + ,0 + ,24 + ,24 + ,1054 + ,130585 + ,299 + ,57 + ,5 + ,67 + ,29 + ,937 + ,112611 + ,248 + ,36 + ,0 + ,46 + ,20 + ,3004 + ,286468 + ,1162 + ,263 + ,1 + ,57 + ,29 + ,2008 + ,241066 + ,714 + ,78 + ,0 + ,75 + ,45 + ,2547 + ,148446 + ,905 + ,63 + ,1 + ,135 + ,37 + ,1885 + ,204713 + ,649 + ,54 + ,1 + ,68 + ,33 + ,1626 + ,182079 + ,512 + ,63 + ,2 + ,124 + ,33 + ,1468 + ,140344 + ,472 + ,77 + ,6 + ,33 + ,25 + ,2445 + ,220516 + ,905 + ,79 + ,1 + ,98 + ,32 + ,1964 + ,243060 + ,786 + ,110 + ,4 + ,58 + ,29 + ,1381 + ,162765 + ,489 + ,56 + ,2 + ,68 + ,28 + ,1369 + ,182613 + ,479 + ,56 + ,3 + ,81 + ,28 + ,1659 + ,232138 + ,617 + ,43 + ,0 + ,131 + ,31 + ,2888 + ,265318 + ,925 + ,111 + ,10 + ,110 + ,52 + ,1290 + ,85574 + ,351 + ,71 + ,0 + ,37 + ,21 + ,2845 + ,310839 + ,1144 + ,62 + ,9 + ,130 + ,24 + ,1982 + ,225060 + ,669 + ,56 + ,7 + ,93 + ,41 + ,1904 + ,232317 + ,707 + ,74 + ,0 + ,118 + ,33 + ,1391 + ,144966 + ,458 + ,60 + ,0 + ,39 + ,32 + ,602 + ,43287 + ,214 + ,43 + ,4 + ,13 + ,19 + ,1743 + ,155754 + ,599 + ,68 + ,4 + ,74 + ,20 + ,1559 + ,164709 + ,572 + ,53 + ,0 + ,81 + ,31 + ,2014 + ,201940 + ,897 + ,87 + ,0 + ,109 + ,31 + ,2143 + ,235454 + ,819 + ,46 + ,0 + ,151 + ,32 + ,2146 + ,220801 + ,720 + ,105 + ,1 + ,51 + ,18 + ,874 + ,99466 + ,273 + ,32 + ,0 + ,28 + ,23 + ,1590 + ,92661 + ,508 + ,133 + ,1 + ,40 + ,17 + ,1590 + ,133328 + ,506 + ,79 + ,0 + ,56 + ,20 + ,1210 + ,61361 + ,451 + ,51 + ,0 + ,27 + ,12 + ,2072 + ,125930 + ,699 + ,207 + ,4 + ,37 + ,17 + ,1281 + ,100750 + ,407 + ,67 + ,0 + ,83 + ,30 + ,1401 + ,224549 + ,465 + ,47 + ,4 + ,54 + ,31 + ,834 + ,82316 + ,245 + ,34 + ,4 + ,27 + ,10 + ,1105 + ,102010 + ,370 + ,66 + ,3 + ,28 + ,13 + ,1272 + ,101523 + ,316 + ,76 + ,0 + ,59 + ,22 + ,1944 + ,243511 + ,603 + ,65 + ,0 + ,133 + ,42 + ,391 + ,22938 + ,154 + ,9 + ,0 + ,12 + ,1 + ,761 + ,41566 + ,229 + ,42 + ,5 + ,0 + ,9 + ,1605 + ,152474 + ,577 + ,45 + ,0 + ,106 + ,32 + ,530 + ,61857 + ,192 + ,25 + ,4 + ,23 + ,11 + ,1988 + ,99923 + ,617 + ,115 + ,0 + ,44 + ,25 + ,1386 + ,132487 + ,411 + ,97 + ,0 + ,71 + ,36 + ,2395 + ,317394 + ,975 + ,53 + ,1 + ,116 + ,31 + ,387 + ,21054 + ,146 + ,2 + ,0 + ,4 + ,0 + ,1742 + ,209641 + ,705 + ,52 + ,5 + ,62 + ,24 + ,620 + ,22648 + ,184 + ,44 + ,0 + ,12 + ,13 + ,449 + ,31414 + ,200 + ,22 + ,0 + ,18 + ,8 + ,800 + ,46698 + ,274 + ,35 + ,0 + ,14 + ,13 + ,1684 + ,131698 + ,502 + ,74 + ,0 + ,60 + ,19 + ,1050 + ,91735 + ,382 + ,103 + ,0 + ,7 + ,18 + ,2699 + ,244749 + ,964 + ,144 + ,2 + ,98 + ,33 + ,1606 + ,184510 + ,537 + ,60 + ,7 + ,64 + ,40 + ,1502 + ,79863 + ,438 + ,134 + ,1 + ,29 + ,22 + ,1204 + ,128423 + ,369 + ,89 + ,8 + ,32 + ,38 + ,1138 + ,97839 + ,417 + ,42 + ,2 + ,25 + ,24 + ,568 + ,38214 + ,276 + ,52 + ,0 + ,16 + ,8 + ,1459 + ,151101 + ,514 + ,98 + ,2 + ,48 + ,35 + ,2158 + ,272458 + ,822 + ,99 + ,0 + ,100 + ,43 + ,1111 + ,172494 + ,389 + ,52 + ,0 + ,46 + ,43 + ,1421 + ,108043 + ,466 + ,29 + ,1 + ,45 + ,14 + ,2833 + ,328107 + ,1255 + ,125 + ,3 + ,129 + ,41 + ,1955 + ,250579 + ,694 + ,106 + ,0 + ,130 + ,38 + ,2922 + ,351067 + ,1024 + ,95 + ,3 + ,136 + ,45 + ,1002 + ,158015 + ,400 + ,40 + ,0 + ,59 + ,31 + ,1060 + ,98866 + ,397 + ,140 + ,0 + ,25 + ,13 + ,956 + ,85439 + ,350 + ,43 + ,0 + ,32 + ,28 + ,2186 + ,229242 + ,719 + ,128 + ,4 + ,63 + ,31 + ,3604 + ,351619 + ,1277 + ,142 + ,4 + ,95 + ,40 + ,1035 + ,84207 + ,356 + ,73 + ,11 + ,14 + ,30 + ,1417 + ,120445 + ,457 + ,72 + ,0 + ,36 + ,16 + ,3261 + ,324598 + ,1402 + ,128 + ,0 + ,113 + ,37 + ,1587 + ,131069 + ,600 + ,61 + ,4 + ,47 + ,30 + ,1424 + ,204271 + ,480 + ,73 + ,0 + ,92 + ,35 + ,1701 + ,165543 + ,595 + ,148 + ,1 + ,70 + ,32 + ,1249 + ,141722 + ,436 + ,64 + ,0 + ,19 + ,27 + ,946 + ,116048 + ,230 + ,45 + ,0 + ,50 + ,20 + ,1926 + ,250047 + ,651 + ,58 + ,0 + ,41 + ,18 + ,3352 + ,299775 + ,1367 + ,97 + ,9 + ,91 + ,31 + ,1641 + ,195838 + ,564 + ,50 + ,1 + ,111 + ,31 + ,2035 + ,173260 + ,716 + ,37 + ,3 + ,41 + ,21 + ,2312 + ,254488 + ,747 + ,50 + ,10 + ,120 + ,39 + ,1369 + ,104389 + ,467 + ,105 + ,5 + ,135 + ,41 + ,1577 + ,136084 + ,671 + ,69 + ,0 + ,27 + ,13 + ,2201 + ,199476 + ,861 + ,46 + ,2 + ,87 + ,32 + ,961 + ,92499 + ,319 + ,57 + ,0 + ,25 + ,18 + ,1900 + ,224330 + ,612 + ,52 + ,1 + ,131 + ,39 + ,1254 + ,135781 + ,433 + ,98 + ,2 + ,45 + ,14 + ,1335 + ,74408 + ,434 + ,61 + ,4 + ,29 + ,7 + ,1597 + ,81240 + ,503 + ,89 + ,0 + ,58 + ,17 + ,207 + ,14688 + ,85 + ,0 + ,0 + ,4 + ,0 + ,1645 + ,181633 + ,564 + ,48 + ,2 + ,47 + ,30 + ,2429 + ,271856 + ,824 + ,91 + ,1 + ,109 + ,37 + ,151 + ,7199 + ,74 + ,0 + ,0 + ,7 + ,0 + ,474 + ,46660 + ,259 + ,7 + ,0 + ,12 + ,5 + ,141 + ,17547 + ,69 + ,3 + ,0 + ,0 + ,1 + ,1639 + ,133368 + ,535 + ,54 + ,1 + ,37 + ,16 + ,872 + ,95227 + ,239 + ,70 + ,0 + ,37 + ,32 + ,1318 + ,152601 + ,438 + ,36 + ,2 + ,46 + ,24 + ,1018 + ,98146 + ,459 + ,37 + ,0 + ,15 + ,17 + ,1383 + ,79619 + ,426 + ,123 + ,3 + ,42 + ,11 + ,1314 + ,59194 + ,288 + ,247 + ,6 + ,7 + ,24 + ,1335 + ,139942 + ,498 + ,46 + ,0 + ,54 + ,22 + ,1403 + ,118612 + ,454 + ,72 + ,2 + ,54 + ,12 + ,910 + ,72880 + ,376 + ,41 + ,0 + ,14 + ,19 + ,616 + ,65475 + ,225 + ,24 + ,2 + ,16 + ,13 + ,1407 + ,99643 + ,555 + ,45 + ,1 + ,33 + ,17 + ,771 + ,71965 + ,252 + ,33 + ,1 + ,32 + ,15 + ,766 + ,77272 + ,208 + ,27 + ,2 + ,21 + ,16 + ,473 + ,49289 + ,130 + ,36 + ,1 + ,15 + ,24 + ,1376 + ,135131 + ,481 + ,87 + ,0 + ,38 + ,15 + ,1232 + ,108446 + ,389 + ,90 + ,1 + ,22 + ,17 + ,1521 + ,89746 + ,565 + ,114 + ,3 + ,28 + ,18 + ,572 + ,44296 + ,173 + ,31 + ,0 + ,10 + ,20 + ,1059 + ,77648 + ,278 + ,45 + ,0 + ,31 + ,16 + ,1544 + ,181528 + ,609 + ,69 + ,0 + ,32 + ,16 + ,1230 + ,134019 + ,422 + ,51 + ,0 + ,32 + ,18 + ,1206 + ,124064 + ,445 + ,34 + ,1 + ,43 + ,22 + ,1205 + ,92630 + ,387 + ,60 + ,4 + ,27 + ,8 + ,1255 + ,121848 + ,339 + ,45 + ,0 + ,37 + ,17 + ,613 + ,52915 + ,181 + ,54 + ,0 + ,20 + ,18 + ,721 + ,81872 + ,245 + ,25 + ,0 + ,32 + ,16 + ,1109 + ,58981 + ,384 + ,38 + ,7 + ,0 + ,23 + ,740 + ,53515 + ,212 + ,52 + ,2 + ,5 + ,22 + ,1126 + ,60812 + ,399 + ,67 + ,0 + ,26 + ,13 + ,728 + ,56375 + ,229 + ,74 + ,7 + ,10 + ,13 + ,689 + ,65490 + ,224 + ,38 + ,3 + ,27 + ,16 + ,592 + ,80949 + ,203 + ,30 + ,0 + ,11 + ,16 + ,995 + ,76302 + ,333 + ,26 + ,0 + ,29 + ,20 + ,1613 + ,104011 + ,384 + ,67 + ,6 + ,25 + ,22 + ,2048 + ,98104 + ,636 + ,132 + ,2 + ,55 + ,17 + ,705 + ,67989 + ,185 + ,42 + ,0 + ,23 + ,18 + ,301 + ,30989 + ,93 + ,35 + ,0 + ,5 + ,17 + ,1803 + ,135458 + ,581 + ,118 + ,3 + ,43 + ,12 + ,799 + ,73504 + ,248 + ,68 + ,0 + ,23 + ,7 + ,861 + ,63123 + ,304 + ,43 + ,1 + ,34 + ,17 + ,1186 + ,61254 + ,344 + ,76 + ,1 + ,36 + ,14 + ,1451 + ,74914 + ,407 + ,64 + ,0 + ,35 + ,23 + ,628 + ,31774 + ,170 + ,48 + ,1 + ,0 + ,17 + ,1161 + ,81437 + ,312 + ,64 + ,0 + ,37 + ,14 + ,1463 + ,87186 + ,507 + ,56 + ,0 + ,28 + ,15 + ,742 + ,50090 + ,224 + ,71 + ,0 + ,16 + ,17 + ,979 + ,65745 + ,340 + ,75 + ,0 + ,26 + ,21 + ,675 + ,56653 + ,168 + ,39 + ,0 + ,38 + ,18 + ,1241 + ,158399 + ,443 + ,42 + ,0 + ,23 + ,18 + ,676 + ,46455 + ,204 + ,39 + ,0 + ,22 + ,17 + ,1049 + ,73624 + ,367 + ,93 + ,0 + ,30 + ,17 + ,620 + ,38395 + ,210 + ,38 + ,0 + ,16 + ,16 + ,1081 + ,91899 + ,335 + ,60 + ,0 + ,18 + ,15 + ,1688 + ,139526 + ,364 + ,71 + ,0 + ,28 + ,21 + ,736 + ,52164 + ,178 + ,52 + ,0 + ,32 + ,16 + ,617 + ,51567 + ,206 + ,27 + ,2 + ,21 + ,14 + ,812 + ,70551 + ,279 + ,59 + ,0 + ,23 + ,15 + ,1051 + ,84856 + ,387 + ,40 + ,1 + ,29 + ,17 + ,1656 + ,102538 + ,490 + ,79 + ,1 + ,50 + ,15 + ,705 + ,86678 + ,238 + ,44 + ,0 + ,12 + ,15 + ,945 + ,85709 + ,343 + ,65 + ,0 + ,21 + ,10 + ,554 + ,34662 + ,232 + ,10 + ,0 + ,18 + ,6 + ,1597 + ,150580 + ,530 + ,124 + ,0 + ,27 + ,22 + ,982 + ,99611 + ,291 + ,81 + ,0 + ,41 + ,21 + ,222 + ,19349 + ,67 + ,15 + ,0 + ,13 + ,1 + ,1212 + ,99373 + ,397 + ,92 + ,1 + ,12 + ,18 + ,1143 + ,86230 + ,467 + ,42 + ,0 + ,21 + ,17 + ,435 + ,30837 + ,178 + ,10 + ,0 + ,8 + ,4 + ,532 + ,31706 + ,175 + ,24 + ,0 + ,26 + ,10 + ,882 + ,89806 + ,299 + ,64 + ,0 + ,27 + ,16 + ,608 + ,62088 + ,154 + ,45 + ,1 + ,13 + ,16 + ,459 + ,40151 + ,106 + ,22 + ,0 + ,16 + ,9 + ,578 + ,27634 + ,189 + ,56 + ,0 + ,2 + ,16 + ,826 + ,76990 + ,194 + ,94 + ,0 + ,42 + ,17 + ,509 + ,37460 + ,135 + ,19 + ,0 + ,5 + ,7 + ,717 + ,54157 + ,201 + ,35 + ,0 + ,37 + ,15 + ,637 + ,49862 + ,207 + ,32 + ,0 + ,17 + ,14 + ,857 + ,84337 + ,280 + ,35 + ,0 + ,38 + ,14 + ,830 + ,64175 + ,260 + ,48 + ,0 + ,37 + ,18 + ,652 + ,59382 + ,227 + ,49 + ,0 + ,29 + ,12 + ,707 + ,119308 + ,239 + ,48 + ,0 + ,32 + ,16 + ,954 + ,76702 + ,333 + ,62 + ,0 + ,35 + ,21 + ,1461 + ,103425 + ,428 + ,96 + ,1 + ,17 + ,19 + ,672 + ,70344 + ,230 + ,45 + ,0 + ,20 + ,16 + ,778 + ,43410 + ,292 + ,63 + ,0 + ,7 + ,1 + ,1141 + ,104838 + ,350 + ,71 + ,1 + ,46 + ,16 + ,680 + ,62215 + ,186 + ,26 + ,0 + ,24 + ,10 + ,1090 + ,69304 + ,326 + ,48 + ,6 + ,40 + ,19 + ,616 + ,53117 + ,155 + ,29 + ,3 + ,3 + ,12 + ,285 + ,19764 + ,75 + ,19 + ,1 + ,10 + ,2 + ,1145 + ,86680 + ,361 + ,45 + ,2 + ,37 + ,14 + ,733 + ,84105 + ,261 + ,45 + ,0 + ,17 + ,17 + ,888 + ,77945 + ,299 + ,67 + ,0 + ,28 + ,19 + ,849 + ,89113 + ,300 + ,30 + ,0 + ,19 + ,14 + ,1182 + ,91005 + ,450 + ,36 + ,3 + ,29 + ,11 + ,528 + ,40248 + ,183 + ,34 + ,1 + ,8 + ,4 + ,642 + ,64187 + ,238 + ,36 + ,0 + ,10 + ,16 + ,947 + ,50857 + ,165 + ,34 + ,0 + ,15 + ,20 + ,819 + ,56613 + ,234 + ,37 + ,1 + ,15 + ,12 + ,757 + ,62792 + ,176 + ,46 + ,0 + ,28 + ,15 + ,894 + ,72535 + ,329 + ,44 + ,0 + ,17 + ,16) + ,dim=c(7 + ,289) + ,dimnames=list(c('pageviews' + ,'time' + ,'compinfo' + ,'comppr' + ,'sharedcomp' + ,'bloggedcomp' + ,'compreviewed') + ,1:289)) > y <- array(NA,dim=c(7,289),dimnames=list(c('pageviews','time','compinfo','comppr','sharedcomp','bloggedcomp','compreviewed'),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 = '1' > par4 <- 'no' > par3 <- '3' > par2 <- 'none' > par1 <- '1' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., 2012, Recursive Partitioning (Regression Trees) (v1.0.3) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_regression_trees.wasp/ > #Source of accompanying publication: > # > 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] "pageviews" > x[,par1] [1] 1418 869 1530 2172 901 463 3201 371 1192 1583 1439 1764 1495 1373 2187 [16] 1491 4041 1706 2152 1036 1882 1929 2242 1220 1289 2515 2147 2352 1638 1222 [31] 1812 1677 1579 1731 807 2452 829 1940 2662 186 1499 865 1793 2527 2747 [46] 1324 2702 1383 1179 2099 4308 918 1831 3373 1713 1438 496 2253 744 1161 [61] 2352 2144 4691 1112 2694 1973 1769 3148 2474 2084 1954 1226 1389 1496 2269 [76] 1833 1268 1943 893 1762 1403 1425 1857 1840 1502 1441 1420 1416 2970 1317 [91] 1644 870 1654 1054 937 3004 2008 2547 1885 1626 1468 2445 1964 1381 1369 [106] 1659 2888 1290 2845 1982 1904 1391 602 1743 1559 2014 2143 2146 874 1590 [121] 1590 1210 2072 1281 1401 834 1105 1272 1944 391 761 1605 530 1988 1386 [136] 2395 387 1742 620 449 800 1684 1050 2699 1606 1502 1204 1138 568 1459 [151] 2158 1111 1421 2833 1955 2922 1002 1060 956 2186 3604 1035 1417 3261 1587 [166] 1424 1701 1249 946 1926 3352 1641 2035 2312 1369 1577 2201 961 1900 1254 [181] 1335 1597 207 1645 2429 151 474 141 1639 872 1318 1018 1383 1314 1335 [196] 1403 910 616 1407 771 766 473 1376 1232 1521 572 1059 1544 1230 1206 [211] 1205 1255 613 721 1109 740 1126 728 689 592 995 1613 2048 705 301 [226] 1803 799 861 1186 1451 628 1161 1463 742 979 675 1241 676 1049 620 [241] 1081 1688 736 617 812 1051 1656 705 945 554 1597 982 222 1212 1143 [256] 435 532 882 608 459 578 826 509 717 637 857 830 652 707 954 [271] 1461 672 778 1141 680 1090 616 285 1145 733 888 849 1182 528 642 [286] 947 819 757 894 > 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]) 141 151 186 207 222 285 301 371 387 391 435 449 459 463 473 474 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 496 509 528 530 532 554 568 572 578 592 602 608 613 616 617 620 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 628 637 642 652 672 675 676 680 689 705 707 717 721 728 733 736 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 740 742 744 757 761 766 771 778 799 800 807 812 819 826 829 830 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 834 849 857 861 865 869 870 872 874 882 888 893 894 901 910 918 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 937 945 946 947 954 956 961 979 982 995 1002 1018 1035 1036 1049 1050 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1051 1054 1059 1060 1081 1090 1105 1109 1111 1112 1126 1138 1141 1143 1145 1161 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1179 1182 1186 1192 1204 1205 1206 1210 1212 1220 1222 1226 1230 1232 1241 1249 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1254 1255 1268 1272 1281 1289 1290 1314 1317 1318 1324 1335 1369 1373 1376 1381 1 1 1 1 1 1 1 1 1 1 1 2 2 1 1 1 1383 1386 1389 1391 1401 1403 1407 1416 1417 1418 1420 1421 1424 1425 1438 1439 2 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1441 1451 1459 1461 1463 1468 1491 1495 1496 1499 1502 1521 1530 1544 1559 1577 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1579 1583 1587 1590 1597 1605 1606 1613 1626 1638 1639 1641 1644 1645 1654 1656 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1659 1677 1684 1688 1701 1706 1713 1731 1742 1743 1762 1764 1769 1793 1803 1812 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1831 1833 1840 1857 1882 1885 1900 1904 1926 1929 1940 1943 1944 1954 1955 1964 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1973 1982 1988 2008 2014 2035 2048 2072 2084 2099 2143 2144 2146 2147 2152 2158 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2172 2186 2187 2201 2242 2253 2269 2312 2352 2395 2429 2445 2452 2474 2515 2527 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 2547 2662 2694 2699 2702 2747 2833 2845 2888 2922 2970 3004 3148 3201 3261 3352 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3373 3604 4041 4308 4691 1 1 1 1 1 > colnames(x) [1] "pageviews" "time" "compinfo" "comppr" "sharedcomp" [6] "bloggedcomp" "compreviewed" > colnames(x)[par1] [1] "pageviews" > x[,par1] [1] 1418 869 1530 2172 901 463 3201 371 1192 1583 1439 1764 1495 1373 2187 [16] 1491 4041 1706 2152 1036 1882 1929 2242 1220 1289 2515 2147 2352 1638 1222 [31] 1812 1677 1579 1731 807 2452 829 1940 2662 186 1499 865 1793 2527 2747 [46] 1324 2702 1383 1179 2099 4308 918 1831 3373 1713 1438 496 2253 744 1161 [61] 2352 2144 4691 1112 2694 1973 1769 3148 2474 2084 1954 1226 1389 1496 2269 [76] 1833 1268 1943 893 1762 1403 1425 1857 1840 1502 1441 1420 1416 2970 1317 [91] 1644 870 1654 1054 937 3004 2008 2547 1885 1626 1468 2445 1964 1381 1369 [106] 1659 2888 1290 2845 1982 1904 1391 602 1743 1559 2014 2143 2146 874 1590 [121] 1590 1210 2072 1281 1401 834 1105 1272 1944 391 761 1605 530 1988 1386 [136] 2395 387 1742 620 449 800 1684 1050 2699 1606 1502 1204 1138 568 1459 [151] 2158 1111 1421 2833 1955 2922 1002 1060 956 2186 3604 1035 1417 3261 1587 [166] 1424 1701 1249 946 1926 3352 1641 2035 2312 1369 1577 2201 961 1900 1254 [181] 1335 1597 207 1645 2429 151 474 141 1639 872 1318 1018 1383 1314 1335 [196] 1403 910 616 1407 771 766 473 1376 1232 1521 572 1059 1544 1230 1206 [211] 1205 1255 613 721 1109 740 1126 728 689 592 995 1613 2048 705 301 [226] 1803 799 861 1186 1451 628 1161 1463 742 979 675 1241 676 1049 620 [241] 1081 1688 736 617 812 1051 1656 705 945 554 1597 982 222 1212 1143 [256] 435 532 882 608 459 578 826 509 717 637 857 830 652 707 954 [271] 1461 672 778 1141 680 1090 616 285 1145 733 888 849 1182 528 642 [286] 947 819 757 894 > 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/13lbi1354975010.tab") + } + } > m Conditional inference tree with 13 terminal nodes Response: pageviews Inputs: time, compinfo, comppr, sharedcomp, bloggedcomp, compreviewed Number of observations: 289 1) compinfo <= 555; criterion = 1, statistic = 266.8 2) compinfo <= 304; criterion = 1, statistic = 164.668 3) compinfo <= 154; criterion = 1, statistic = 57.696 4)* weights = 15 3) compinfo > 154 5) time <= 46660; criterion = 1, statistic = 27.859 6)* weights = 17 5) time > 46660 7) compinfo <= 264; criterion = 1, statistic = 19.113 8) bloggedcomp <= 32; criterion = 0.992, statistic = 10.188 9)* weights = 30 8) bloggedcomp > 32 10)* weights = 9 7) compinfo > 264 11)* weights = 14 2) compinfo > 304 12) compinfo <= 462; criterion = 1, statistic = 51.023 13) time <= 98866; criterion = 0.999, statistic = 15.229 14)* weights = 33 13) time > 98866 15)* weights = 36 12) compinfo > 462 16) comppr <= 50; criterion = 0.954, statistic = 7.082 17)* weights = 12 16) comppr > 50 18)* weights = 27 1) compinfo > 555 19) compinfo <= 992; criterion = 1, statistic = 76.433 20) compinfo <= 818; criterion = 1, statistic = 51.209 21) compinfo <= 711; criterion = 0.999, statistic = 14.803 22)* weights = 42 21) compinfo > 711 23)* weights = 14 20) compinfo > 818 24)* weights = 25 19) compinfo > 992 25)* weights = 15 > postscript(file="/var/wessaorg/rcomp/tmp/2lquf1354975010.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/3rrlb1354975010.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 1418 1286.5833 131.4166667 2 869 928.7143 -59.7142857 3 1530 1765.5952 -235.5952381 4 2172 2383.4000 -211.4000000 5 901 928.7143 -27.7142857 6 463 343.6000 119.4000000 7 3201 3353.3333 -152.3333333 8 371 343.6000 27.4000000 9 1192 1286.5833 -94.5833333 10 1583 1765.5952 -182.5952381 11 1439 1509.8889 -70.8888889 12 1764 1765.5952 -1.5952381 13 1495 1391.4167 103.5833333 14 1373 1509.8889 -136.8888889 15 2187 2383.4000 -196.4000000 16 1491 1391.4167 99.5833333 17 4041 3353.3333 687.6666667 18 1706 1765.5952 -59.5952381 19 2152 2383.4000 -231.4000000 20 1036 1286.5833 -250.5833333 21 1882 1765.5952 116.4047619 22 1929 1765.5952 163.4047619 23 2242 2383.4000 -141.4000000 24 1220 1286.5833 -66.5833333 25 1289 1286.5833 2.4166667 26 2515 2383.4000 131.6000000 27 2147 2045.9286 101.0714286 28 2352 2383.4000 -31.4000000 29 1638 1509.8889 128.1111111 30 1222 1391.4167 -169.4166667 31 1812 1765.5952 46.4047619 32 1677 1765.5952 -88.5952381 33 1579 1509.8889 69.1111111 34 1731 1765.5952 -34.5952381 35 807 830.5556 -23.5555556 36 2452 2383.4000 68.6000000 37 829 711.3000 117.7000000 38 1940 2045.9286 -105.9285714 39 2662 2383.4000 278.6000000 40 186 343.6000 -157.6000000 41 1499 1509.8889 -10.8888889 42 865 830.5556 34.4444444 43 1793 1509.8889 283.1111111 44 2527 2383.4000 143.6000000 45 2747 3353.3333 -606.3333333 46 1324 1509.8889 -185.8888889 47 2702 2383.4000 318.6000000 48 1383 1509.8889 -126.8888889 49 1179 1286.5833 -107.5833333 50 2099 2383.4000 -284.4000000 51 4308 3353.3333 954.6666667 52 918 1094.9091 -176.9090909 53 1831 1765.5952 65.4047619 54 3373 3353.3333 19.6666667 55 1713 2045.9286 -332.9285714 56 1438 1286.5833 151.4166667 57 496 580.6471 -84.6470588 58 2253 2045.9286 207.0714286 59 744 711.3000 32.7000000 60 1161 1286.5833 -125.5833333 61 2352 2383.4000 -31.4000000 62 2144 1765.5952 378.4047619 63 4691 3353.3333 1337.6666667 64 1112 1286.5833 -174.5833333 65 2694 2383.4000 310.6000000 66 1973 2045.9286 -72.9285714 67 1769 1765.5952 3.4047619 68 3148 3353.3333 -205.3333333 69 2474 2383.4000 90.6000000 70 2084 2383.4000 -299.4000000 71 1954 1765.5952 188.4047619 72 1226 1391.4167 -165.4166667 73 1389 1286.5833 102.4166667 74 1496 1391.4167 104.5833333 75 2269 2045.9286 223.0714286 76 1833 1765.5952 67.4047619 77 1268 1286.5833 -18.5833333 78 1943 1765.5952 177.4047619 79 893 1094.9091 -201.9090909 80 1762 1765.5952 -3.5952381 81 1403 1765.5952 -362.5952381 82 1425 1509.8889 -84.8888889 83 1857 2045.9286 -188.9285714 84 1840 2045.9286 -205.9285714 85 1502 1286.5833 215.4166667 86 1441 1286.5833 154.4166667 87 1420 1509.8889 -89.8888889 88 1416 1391.4167 24.5833333 89 2970 3353.3333 -383.3333333 90 1317 1765.5952 -448.5952381 91 1644 1391.4167 252.5833333 92 870 1094.9091 -224.9090909 93 1654 1765.5952 -111.5952381 94 1054 928.7143 125.2857143 95 937 830.5556 106.4444444 96 3004 3353.3333 -349.3333333 97 2008 2045.9286 -37.9285714 98 2547 2383.4000 163.6000000 99 1885 1765.5952 119.4047619 100 1626 1509.8889 116.1111111 101 1468 1509.8889 -41.8888889 102 2445 2383.4000 61.6000000 103 1964 2045.9286 -81.9285714 104 1381 1509.8889 -128.8888889 105 1369 1509.8889 -140.8888889 106 1659 1765.5952 -106.5952381 107 2888 2383.4000 504.6000000 108 1290 1094.9091 195.0909091 109 2845 3353.3333 -508.3333333 110 1982 1765.5952 216.4047619 111 1904 1765.5952 138.4047619 112 1391 1286.5833 104.4166667 113 602 580.6471 21.3529412 114 1743 1765.5952 -22.5952381 115 1559 1765.5952 -206.5952381 116 2014 2383.4000 -369.4000000 117 2143 2383.4000 -240.4000000 118 2146 2045.9286 100.0714286 119 874 928.7143 -54.7142857 120 1590 1509.8889 80.1111111 121 1590 1509.8889 80.1111111 122 1210 1094.9091 115.0909091 123 2072 1765.5952 306.4047619 124 1281 1286.5833 -5.5833333 125 1401 1391.4167 9.5833333 126 834 711.3000 122.7000000 127 1105 1286.5833 -181.5833333 128 1272 1286.5833 -14.5833333 129 1944 1765.5952 178.4047619 130 391 343.6000 47.4000000 131 761 580.6471 180.3529412 132 1605 1765.5952 -160.5952381 133 530 711.3000 -181.3000000 134 1988 1765.5952 222.4047619 135 1386 1286.5833 99.4166667 136 2395 2383.4000 11.6000000 137 387 343.6000 43.4000000 138 1742 1765.5952 -23.5952381 139 620 580.6471 39.3529412 140 449 580.6471 -131.6470588 141 800 928.7143 -128.7142857 142 1684 1509.8889 174.1111111 143 1050 1094.9091 -44.9090909 144 2699 2383.4000 315.6000000 145 1606 1509.8889 96.1111111 146 1502 1094.9091 407.0909091 147 1204 1286.5833 -82.5833333 148 1138 1094.9091 43.0909091 149 568 580.6471 -12.6470588 150 1459 1509.8889 -50.8888889 151 2158 2383.4000 -225.4000000 152 1111 1286.5833 -175.5833333 153 1421 1391.4167 29.5833333 154 2833 3353.3333 -520.3333333 155 1955 1765.5952 189.4047619 156 2922 3353.3333 -431.3333333 157 1002 1286.5833 -284.5833333 158 1060 1094.9091 -34.9090909 159 956 1094.9091 -138.9090909 160 2186 2045.9286 140.0714286 161 3604 3353.3333 250.6666667 162 1035 1094.9091 -59.9090909 163 1417 1286.5833 130.4166667 164 3261 3353.3333 -92.3333333 165 1587 1765.5952 -178.5952381 166 1424 1509.8889 -85.8888889 167 1701 1765.5952 -64.5952381 168 1249 1286.5833 -37.5833333 169 946 830.5556 115.4444444 170 1926 1765.5952 160.4047619 171 3352 3353.3333 -1.3333333 172 1641 1765.5952 -124.5952381 173 2035 2045.9286 -10.9285714 174 2312 2045.9286 266.0714286 175 1369 1509.8889 -140.8888889 176 1577 1765.5952 -188.5952381 177 2201 2383.4000 -182.4000000 178 961 1094.9091 -133.9090909 179 1900 1765.5952 134.4047619 180 1254 1286.5833 -32.5833333 181 1335 1094.9091 240.0909091 182 1597 1509.8889 87.1111111 183 207 343.6000 -136.6000000 184 1645 1765.5952 -120.5952381 185 2429 2383.4000 45.6000000 186 151 343.6000 -192.6000000 187 474 580.6471 -106.6470588 188 141 343.6000 -202.6000000 189 1639 1509.8889 129.1111111 190 872 830.5556 41.4444444 191 1318 1286.5833 31.4166667 192 1018 1094.9091 -76.9090909 193 1383 1094.9091 288.0909091 194 1314 928.7143 385.2857143 195 1335 1391.4167 -56.4166667 196 1403 1286.5833 116.4166667 197 910 1094.9091 -184.9090909 198 616 711.3000 -95.3000000 199 1407 1391.4167 15.5833333 200 771 711.3000 59.7000000 201 766 711.3000 54.7000000 202 473 343.6000 129.4000000 203 1376 1509.8889 -133.8888889 204 1232 1286.5833 -54.5833333 205 1521 1765.5952 -244.5952381 206 572 580.6471 -8.6470588 207 1059 928.7143 130.2857143 208 1544 1765.5952 -221.5952381 209 1230 1286.5833 -56.5833333 210 1206 1286.5833 -80.5833333 211 1205 1094.9091 110.0909091 212 1255 1286.5833 -31.5833333 213 613 711.3000 -98.3000000 214 721 711.3000 9.7000000 215 1109 1094.9091 14.0909091 216 740 711.3000 28.7000000 217 1126 1094.9091 31.0909091 218 728 711.3000 16.7000000 219 689 711.3000 -22.3000000 220 592 711.3000 -119.3000000 221 995 1094.9091 -99.9090909 222 1613 1286.5833 326.4166667 223 2048 1765.5952 282.4047619 224 705 711.3000 -6.3000000 225 301 343.6000 -42.6000000 226 1803 1765.5952 37.4047619 227 799 711.3000 87.7000000 228 861 928.7143 -67.7142857 229 1186 1094.9091 91.0909091 230 1451 1094.9091 356.0909091 231 628 580.6471 47.3529412 232 1161 1094.9091 66.0909091 233 1463 1509.8889 -46.8888889 234 742 711.3000 30.7000000 235 979 1094.9091 -115.9090909 236 675 830.5556 -155.5555556 237 1241 1286.5833 -45.5833333 238 676 580.6471 95.3529412 239 1049 1094.9091 -45.9090909 240 620 580.6471 39.3529412 241 1081 1094.9091 -13.9090909 242 1688 1286.5833 401.4166667 243 736 711.3000 24.7000000 244 617 711.3000 -94.3000000 245 812 928.7143 -116.7142857 246 1051 1094.9091 -43.9090909 247 1656 1509.8889 146.1111111 248 705 711.3000 -6.3000000 249 945 1094.9091 -149.9090909 250 554 580.6471 -26.6470588 251 1597 1509.8889 87.1111111 252 982 928.7143 53.2857143 253 222 343.6000 -121.6000000 254 1212 1286.5833 -74.5833333 255 1143 1391.4167 -248.4166667 256 435 580.6471 -145.6470588 257 532 580.6471 -48.6470588 258 882 928.7143 -46.7142857 259 608 343.6000 264.4000000 260 459 343.6000 115.4000000 261 578 580.6471 -2.6470588 262 826 830.5556 -4.5555556 263 509 343.6000 165.4000000 264 717 830.5556 -113.5555556 265 637 711.3000 -74.3000000 266 857 928.7143 -71.7142857 267 830 830.5556 -0.5555556 268 652 711.3000 -59.3000000 269 707 711.3000 -4.3000000 270 954 1094.9091 -140.9090909 271 1461 1286.5833 174.4166667 272 672 711.3000 -39.3000000 273 778 580.6471 197.3529412 274 1141 1286.5833 -145.5833333 275 680 711.3000 -31.3000000 276 1090 1094.9091 -4.9090909 277 616 711.3000 -95.3000000 278 285 343.6000 -58.6000000 279 1145 1094.9091 50.0909091 280 733 711.3000 21.7000000 281 888 928.7143 -40.7142857 282 849 928.7143 -79.7142857 283 1182 1094.9091 87.0909091 284 528 580.6471 -52.6470588 285 642 711.3000 -69.3000000 286 947 711.3000 235.7000000 287 819 711.3000 107.7000000 288 757 711.3000 45.7000000 289 894 1094.9091 -200.9090909 > 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/4ribq1354975010.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/5yztt1354975010.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/653g31354975010.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/7x8ia1354975010.tab") + } > > try(system("convert tmp/2lquf1354975010.ps tmp/2lquf1354975010.png",intern=TRUE)) character(0) > try(system("convert tmp/3rrlb1354975010.ps tmp/3rrlb1354975010.png",intern=TRUE)) character(0) > try(system("convert tmp/4ribq1354975010.ps tmp/4ribq1354975010.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.724 0.475 8.177