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(102 + ,122 + ,88 + ,1 + ,9 + ,8976 + ,102 + ,918 + ,88 + ,792 + ,9 + ,99 + ,114 + ,106 + ,1 + ,3 + ,10494 + ,99 + ,297 + ,106 + ,318 + ,3 + ,97 + ,140 + ,70 + ,1 + ,2 + ,6790 + ,97 + ,194 + ,70 + ,140 + ,2 + ,82 + ,143 + ,70 + ,1 + ,21 + ,5740 + ,82 + ,1722 + ,70 + ,1470 + ,21 + ,77 + ,122 + ,56 + ,1 + ,10 + ,4312 + ,77 + ,770 + ,56 + ,560 + ,10 + ,65 + ,127 + ,50 + ,1 + ,2 + ,3250 + ,65 + ,130 + ,50 + ,100 + ,2 + ,64 + ,113 + ,48 + ,1 + ,4 + ,3072 + ,64 + ,256 + ,48 + ,192 + ,4 + ,62 + ,118 + ,71 + ,1 + ,4 + ,4402 + ,62 + ,248 + ,71 + ,284 + ,4 + ,62 + ,161 + ,61 + ,1 + ,4 + ,3782 + ,62 + ,248 + ,61 + ,244 + ,4 + ,62 + ,134 + ,66 + ,1 + ,5 + ,4092 + ,62 + ,310 + ,66 + ,330 + ,5 + ,61 + ,96 + ,80 + ,1 + ,2 + ,4880 + ,61 + ,122 + ,80 + ,160 + ,2 + ,59 + ,104 + ,37 + ,1 + ,3 + ,2183 + ,59 + ,177 + ,37 + ,111 + ,3 + ,57 + ,135 + ,53 + ,1 + ,3 + ,3021 + ,57 + ,171 + ,53 + ,159 + ,3 + ,56 + ,110 + ,39 + ,1 + ,6 + ,2184 + ,56 + ,336 + ,39 + ,234 + ,6 + ,54 + ,128 + ,40 + ,1 + ,3 + ,2160 + ,54 + ,162 + ,40 + ,120 + ,3 + ,54 + ,142 + ,59 + ,1 + ,4 + ,3186 + ,54 + ,216 + ,59 + ,236 + ,4 + ,53 + ,117 + ,42 + ,1 + ,3 + ,2226 + ,53 + ,159 + ,42 + ,126 + ,3 + ,52 + ,94 + ,33 + ,1 + ,13 + ,1716 + ,52 + ,676 + ,33 + ,429 + ,13 + ,51 + ,135 + ,36 + ,1 + ,3 + ,1836 + ,51 + ,153 + ,36 + ,108 + ,3 + ,51 + ,121 + ,57 + ,1 + ,4 + ,2907 + ,51 + ,204 + ,57 + ,228 + ,4 + ,51 + ,103 + ,38 + ,1 + ,8 + ,1938 + ,51 + ,408 + ,38 + ,304 + ,8 + ,50 + ,118 + ,98 + ,1 + ,8 + ,4900 + ,50 + ,400 + ,98 + ,784 + ,8 + ,50 + ,127 + ,43 + ,1 + ,3 + ,2150 + ,50 + ,150 + ,43 + ,129 + ,3 + ,50 + ,116 + ,73 + ,1 + ,4 + ,3650 + ,50 + ,200 + ,73 + ,292 + ,4 + ,49 + ,129 + ,52 + ,1 + ,2 + ,2548 + ,49 + ,98 + ,52 + ,104 + ,2 + ,49 + ,115 + ,53 + ,1 + ,5 + ,2597 + ,49 + ,245 + ,53 + ,265 + ,5 + ,49 + ,135 + ,51 + ,1 + ,4 + ,2499 + ,49 + ,196 + ,51 + ,204 + ,4 + ,48 + ,133 + ,32 + ,1 + ,3 + ,1536 + ,48 + ,144 + ,32 + ,96 + ,3 + ,48 + ,113 + ,43 + ,1 + ,3 + ,2064 + ,48 + ,144 + ,43 + ,129 + ,3 + ,47 + ,111 + ,53 + ,1 + ,2 + ,2491 + ,47 + ,94 + ,53 + ,106 + ,2 + ,47 + ,92 + ,50 + ,1 + ,3 + ,2350 + ,47 + ,141 + ,50 + ,150 + ,3 + ,46 + ,118 + ,50 + ,1 + ,3 + ,2300 + ,46 + ,138 + ,50 + ,150 + ,3 + ,46 + ,134 + ,56 + ,1 + ,3 + ,2576 + ,46 + ,138 + ,56 + ,168 + ,3 + ,45 + ,106 + ,53 + ,1 + ,5 + ,2385 + ,45 + ,225 + ,53 + ,265 + ,5 + ,45 + ,137 + ,47 + ,1 + ,3 + ,2115 + ,45 + ,135 + ,47 + ,141 + ,3 + ,45 + ,100 + ,42 + ,1 + ,4 + ,1890 + ,45 + ,180 + ,42 + ,168 + ,4 + ,44 + ,102 + ,29 + ,1 + ,3 + ,1276 + ,44 + ,132 + ,29 + ,87 + ,3 + ,43 + ,134 + ,54 + ,1 + ,4 + ,2322 + ,43 + ,172 + ,54 + ,216 + ,4 + ,42 + ,130 + ,40 + ,1 + ,8 + ,1680 + ,42 + ,336 + ,40 + ,320 + ,8 + ,42 + ,144 + ,41 + ,1 + ,3 + ,1722 + ,42 + ,126 + ,41 + ,123 + ,3 + ,42 + ,120 + ,37 + ,1 + ,4 + ,1554 + ,42 + ,168 + ,37 + ,148 + ,4 + ,42 + ,91 + ,25 + ,1 + ,2 + ,1050 + ,42 + ,84 + ,25 + ,50 + ,2 + ,42 + ,100 + ,27 + ,1 + ,5 + ,1134 + ,42 + ,210 + ,27 + ,135 + ,5 + ,42 + ,134 + ,61 + ,1 + ,4 + ,2562 + ,42 + ,168 + ,61 + ,244 + ,4 + ,41 + ,161 + ,54 + ,1 + ,7 + ,2214 + ,41 + ,287 + ,54 + ,378 + ,7 + ,41 + ,128 + ,35 + ,1 + ,3 + ,1435 + ,41 + ,123 + ,35 + ,105 + ,3 + ,41 + ,124 + ,55 + ,1 + ,4 + ,2255 + ,41 + ,164 + ,55 + ,220 + ,4 + ,41 + ,115 + ,47 + ,1 + ,6 + ,1927 + ,41 + ,246 + ,47 + ,282 + ,6 + ,41 + ,123 + ,49 + ,1 + ,7 + ,2009 + ,41 + ,287 + ,49 + ,343 + ,7 + ,41 + ,117 + ,38 + ,1 + ,20 + ,1558 + ,41 + ,820 + ,38 + ,760 + ,20 + ,41 + ,111 + ,52 + ,1 + ,49 + ,2132 + ,41 + ,2009 + ,52 + ,2548 + ,49 + ,40 + ,146 + ,35 + ,1 + ,3 + ,1400 + ,40 + ,120 + ,35 + ,105 + ,3 + ,40 + ,101 + ,52 + ,1 + ,3 + ,2080 + ,40 + ,120 + ,52 + ,156 + ,3 + ,40 + ,131 + ,54 + ,1 + ,6 + ,2160 + ,40 + ,240 + ,54 + ,324 + ,6 + ,40 + ,122 + ,40 + ,1 + ,6 + ,1600 + ,40 + ,240 + ,40 + ,240 + ,6 + ,40 + ,78 + ,52 + ,1 + ,4 + ,2080 + ,40 + ,160 + ,52 + ,208 + ,4 + ,39 + ,120 + ,34 + ,1 + ,5 + ,1326 + ,39 + ,195 + ,34 + ,170 + ,5 + ,39 + ,115 + ,51 + ,1 + ,4 + ,1989 + ,39 + ,156 + ,51 + ,204 + ,4 + ,38 + ,142 + ,43 + ,1 + ,4 + ,1634 + ,38 + ,152 + ,43 + ,172 + ,4 + ,38 + ,94 + ,40 + ,1 + ,31 + ,1520 + ,38 + ,1178 + ,40 + ,1240 + ,31 + ,36 + ,114 + ,38 + ,1 + ,3 + ,1368 + ,36 + ,108 + ,38 + ,114 + ,3 + ,36 + ,108 + ,33 + ,1 + ,3 + ,1188 + ,36 + ,108 + ,33 + ,99 + ,3 + ,35 + ,119 + ,27 + ,1 + ,4 + ,945 + ,35 + ,140 + ,27 + ,108 + ,4 + ,35 + ,117 + ,34 + ,1 + ,6 + ,1190 + ,35 + ,210 + ,34 + ,204 + ,6 + ,35 + ,86 + ,44 + ,1 + ,5 + ,1540 + ,35 + ,175 + ,44 + ,220 + ,5 + ,35 + ,138 + ,46 + ,1 + ,3 + ,1610 + ,35 + ,105 + ,46 + ,138 + ,3 + ,34 + ,119 + ,50 + ,1 + ,3 + ,1700 + ,34 + ,102 + ,50 + ,150 + ,3 + ,34 + ,117 + ,31 + ,1 + ,2 + ,1054 + ,34 + ,68 + ,31 + ,62 + ,2 + ,34 + ,117 + ,33 + ,1 + ,3 + ,1122 + ,34 + ,102 + ,33 + ,99 + ,3 + ,33 + ,76 + ,37 + ,1 + ,3 + ,1221 + ,33 + ,99 + ,37 + ,111 + ,3 + ,33 + ,119 + ,48 + ,1 + ,16 + ,1584 + ,33 + ,528 + ,48 + ,768 + ,16 + ,33 + ,119 + ,33 + ,1 + ,3 + ,1089 + ,33 + ,99 + ,33 + ,99 + ,3 + ,32 + ,124 + ,40 + ,1 + ,3 + ,1280 + ,32 + ,96 + ,40 + ,120 + ,3 + ,32 + ,116 + ,21 + ,1 + ,3 + ,672 + ,32 + ,96 + ,21 + ,63 + ,3 + ,32 + ,118 + ,33 + ,1 + ,2 + ,1056 + ,32 + ,64 + ,33 + ,66 + ,2 + ,31 + ,102 + ,41 + ,1 + ,5 + ,1271 + ,31 + ,155 + ,41 + ,205 + ,5 + ,31 + ,116 + ,35 + ,1 + ,3 + ,1085 + ,31 + ,93 + ,35 + ,105 + ,3 + ,30 + ,103 + ,60 + ,1 + ,4 + ,1800 + ,30 + ,120 + ,60 + ,240 + ,4 + ,30 + ,117 + ,30 + ,1 + ,5 + ,900 + ,30 + ,150 + ,30 + ,150 + ,5 + ,30 + ,108 + ,45 + ,1 + ,2 + ,1350 + ,30 + ,60 + ,45 + ,90 + ,2 + ,30 + ,122 + ,26 + ,1 + ,3 + ,780 + ,30 + ,90 + ,26 + ,78 + ,3 + ,29 + ,90 + ,41 + ,1 + ,3 + ,1189 + ,29 + ,87 + ,41 + ,123 + ,3 + ,28 + ,133 + ,48 + ,1 + ,14 + ,1344 + ,28 + ,392 + ,48 + ,672 + ,14 + ,28 + ,116 + ,10 + ,1 + ,8 + ,280 + ,28 + ,224 + ,10 + ,80 + ,8 + ,27 + ,110 + ,35 + ,1 + ,4 + ,945 + ,27 + ,108 + ,35 + ,140 + ,4 + ,27 + ,90 + ,23 + ,1 + ,4 + ,621 + ,27 + ,108 + ,23 + ,92 + ,4 + ,27 + ,74 + ,29 + ,1 + ,3 + ,783 + ,27 + ,81 + ,29 + ,87 + ,3 + ,26 + ,75 + ,17 + ,1 + ,4 + ,442 + ,26 + ,104 + ,17 + ,68 + ,4 + ,25 + ,107 + ,35 + ,1 + ,3 + ,875 + ,25 + ,75 + ,35 + ,105 + ,3 + ,25 + ,90 + ,50 + ,1 + ,5 + ,1250 + ,25 + ,125 + ,50 + ,250 + ,5 + ,25 + ,96 + ,33 + ,1 + ,3 + ,825 + ,25 + ,75 + ,33 + ,99 + ,3 + ,24 + ,115 + ,23 + ,1 + ,3 + ,552 + ,24 + ,72 + ,23 + ,69 + ,3 + ,24 + ,91 + ,22 + ,1 + ,2 + ,528 + ,24 + ,48 + ,22 + ,44 + ,2 + ,23 + ,77 + ,52 + ,1 + ,4 + ,1196 + ,23 + ,92 + ,52 + ,208 + ,4 + ,23 + ,108 + ,38 + ,1 + ,31 + ,874 + ,23 + ,713 + ,38 + ,1178 + ,31 + ,23 + ,83 + ,32 + ,1 + ,2 + ,736 + ,23 + ,46 + ,32 + ,64 + ,2 + ,23 + ,77 + ,28 + ,1 + ,5 + ,644 + ,23 + ,115 + ,28 + ,140 + ,5 + ,23 + ,99 + ,43 + ,1 + ,5 + ,989 + ,23 + ,115 + ,43 + ,215 + ,5 + ,22 + ,115 + ,32 + ,1 + ,2 + ,704 + ,22 + ,44 + ,32 + ,64 + ,2 + ,22 + ,99 + ,35 + ,1 + ,2 + ,770 + ,22 + ,44 + ,35 + ,70 + ,2 + ,22 + ,106 + ,25 + ,1 + ,3 + ,550 + ,22 + ,66 + ,25 + ,75 + ,3 + ,22 + ,77 + ,14 + ,1 + ,8 + ,308 + ,22 + ,176 + ,14 + ,112 + ,8 + ,20 + ,115 + ,17 + ,1 + ,6 + ,340 + ,20 + ,120 + ,17 + ,102 + ,6 + ,19 + ,67 + ,18 + ,1 + ,3 + ,342 + ,19 + ,57 + ,18 + ,54 + ,3 + ,19 + ,8 + ,12 + ,1 + ,2 + ,228 + ,19 + ,38 + ,12 + ,24 + ,2 + ,17 + ,69 + ,27 + ,1 + ,5 + ,459 + ,17 + ,85 + ,27 + ,135 + ,5 + ,17 + ,88 + ,28 + ,1 + ,3 + ,476 + ,17 + ,51 + ,28 + ,84 + ,3 + ,16 + ,107 + ,12 + ,1 + ,5 + ,192 + ,16 + ,80 + ,12 + ,60 + ,5 + ,16 + ,120 + ,21 + ,1 + ,5 + ,336 + ,16 + ,80 + ,21 + ,105 + ,5 + ,5 + ,3 + ,9 + ,1 + ,4 + ,45 + ,5 + ,20 + ,9 + ,36 + ,4 + ,4 + ,1 + ,11 + ,1 + ,2 + ,44 + ,4 + ,8 + ,11 + ,22 + ,2 + ,3 + ,0 + ,3 + ,1 + ,4 + ,9 + ,3 + ,12 + ,3 + ,12 + ,4 + ,156 + ,111 + ,111 + ,0 + ,4 + ,17316 + ,0 + ,624 + ,0 + ,444 + ,0 + ,109 + ,69 + ,137 + ,0 + ,8 + ,14933 + ,0 + ,872 + ,0 + ,1096 + ,0 + ,104 + ,116 + ,112 + ,0 + ,3 + ,11648 + ,0 + ,312 + ,0 + ,336 + ,0 + ,98 + ,103 + ,73 + ,0 + ,4 + ,7154 + ,0 + ,392 + ,0 + ,292 + ,0 + ,78 + ,139 + ,99 + ,0 + ,3 + ,7722 + ,0 + ,234 + ,0 + ,297 + ,0 + ,77 + ,135 + ,115 + ,0 + ,3 + ,8855 + ,0 + ,231 + ,0 + ,345 + ,0 + ,73 + ,113 + ,95 + ,0 + ,3 + ,6935 + ,0 + ,219 + ,0 + ,285 + ,0 + ,71 + ,99 + ,60 + ,0 + ,4 + ,4260 + ,0 + ,284 + ,0 + ,240 + ,0 + ,67 + ,76 + ,94 + ,0 + ,4 + ,6298 + ,0 + ,268 + ,0 + ,376 + ,0 + ,64 + ,110 + ,70 + ,0 + ,5 + ,4480 + ,0 + ,320 + ,0 + ,350 + ,0 + ,62 + ,121 + ,87 + ,0 + ,2 + ,5394 + ,0 + ,124 + ,0 + ,174 + ,0 + ,61 + ,95 + ,102 + ,0 + ,3 + ,6222 + ,0 + ,183 + ,0 + ,306 + ,0 + ,58 + ,66 + ,69 + ,0 + ,4 + ,4002 + ,0 + ,232 + ,0 + ,276 + ,0 + ,58 + ,111 + ,111 + ,0 + ,7 + ,6438 + ,0 + ,406 + ,0 + ,777 + ,0 + ,56 + ,77 + ,55 + ,0 + ,3 + ,3080 + ,0 + ,168 + ,0 + ,165 + ,0 + ,56 + ,101 + ,118 + ,0 + ,4 + ,6608 + ,0 + ,224 + ,0 + ,472 + ,0 + ,52 + ,108 + ,90 + ,0 + ,3 + ,4680 + ,0 + ,156 + ,0 + ,270 + ,0 + ,51 + ,135 + ,81 + ,0 + ,4 + ,4131 + ,0 + ,204 + ,0 + ,324 + ,0 + ,51 + ,70 + ,88 + ,0 + ,4 + ,4488 + ,0 + ,204 + ,0 + ,352 + ,0 + ,50 + ,124 + ,63 + ,0 + ,3 + ,3150 + ,0 + ,150 + ,0 + ,189 + ,0 + ,49 + ,92 + ,84 + ,0 + ,6 + ,4116 + ,0 + ,294 + ,0 + ,504 + ,0 + ,49 + ,104 + ,87 + ,0 + ,4 + ,4263 + ,0 + ,196 + ,0 + ,348 + ,0 + ,48 + ,113 + ,78 + ,0 + ,4 + ,3744 + ,0 + ,192 + ,0 + ,312 + ,0 + ,47 + ,95 + ,93 + ,0 + ,4 + ,4371 + ,0 + ,188 + ,0 + ,372 + ,0 + ,47 + ,89 + ,69 + ,0 + ,4 + ,3243 + ,0 + ,188 + ,0 + ,276 + ,0 + ,46 + ,83 + ,67 + ,0 + ,3 + ,3082 + ,0 + ,138 + ,0 + ,201 + ,0 + ,45 + ,96 + ,61 + ,0 + ,6 + ,2745 + ,0 + ,270 + ,0 + ,366 + ,0 + ,45 + ,95 + ,123 + ,0 + ,4 + ,5535 + ,0 + ,180 + ,0 + ,492 + ,0 + ,45 + ,110 + ,91 + ,0 + ,6 + ,4095 + ,0 + ,270 + ,0 + ,546 + ,0 + ,45 + ,106 + ,98 + ,0 + ,6 + ,4410 + ,0 + ,270 + ,0 + ,588 + ,0 + ,44 + ,78 + ,38 + ,0 + ,2 + ,1672 + ,0 + ,88 + ,0 + ,76 + ,0 + ,44 + ,115 + ,72 + ,0 + ,3 + ,3168 + ,0 + ,132 + ,0 + ,216 + ,0 + ,44 + ,74 + ,59 + ,0 + ,3 + ,2596 + ,0 + ,132 + ,0 + ,177 + ,0 + ,43 + ,93 + ,78 + ,0 + ,2 + ,3354 + ,0 + ,86 + ,0 + ,156 + ,0 + ,43 + ,88 + ,58 + ,0 + ,4 + ,2494 + ,0 + ,172 + ,0 + ,232 + ,0 + ,42 + ,104 + ,97 + ,0 + ,5 + ,4074 + ,0 + ,210 + ,0 + ,485 + ,0 + ,41 + ,86 + ,69 + ,0 + ,3 + ,2829 + ,0 + ,123 + ,0 + ,207 + ,0 + ,41 + ,104 + ,50 + ,0 + ,7 + ,2050 + ,0 + ,287 + ,0 + ,350 + ,0 + ,40 + ,99 + ,66 + ,0 + ,4 + ,2640 + ,0 + ,160 + ,0 + ,264 + ,0 + ,39 + ,101 + ,70 + ,0 + ,3 + ,2730 + ,0 + ,117 + ,0 + ,210 + ,0 + ,39 + ,53 + ,65 + ,0 + ,4 + ,2535 + ,0 + ,156 + ,0 + ,260 + ,0 + ,39 + ,96 + ,69 + ,0 + ,4 + ,2691 + ,0 + ,156 + ,0 + ,276 + ,0 + ,39 + ,58 + ,49 + ,0 + ,3 + ,1911 + ,0 + ,117 + ,0 + ,147 + ,0 + ,39 + ,117 + ,72 + ,0 + ,3 + ,2808 + ,0 + ,117 + ,0 + ,216 + ,0 + ,39 + ,82 + ,74 + ,0 + ,4 + ,2886 + ,0 + ,156 + ,0 + ,296 + ,0 + ,39 + ,57 + ,82 + ,0 + ,5 + ,3198 + ,0 + ,195 + ,0 + ,410 + ,0 + ,38 + ,71 + ,61 + ,0 + ,3 + ,2318 + ,0 + ,114 + ,0 + ,183 + ,0 + ,38 + ,105 + ,72 + ,0 + ,4 + ,2736 + ,0 + ,152 + ,0 + ,288 + ,0 + ,38 + ,60 + ,77 + ,0 + ,6 + ,2926 + ,0 + ,228 + ,0 + ,462 + ,0 + ,38 + ,77 + ,64 + ,0 + ,5 + ,2432 + ,0 + ,190 + ,0 + ,320 + ,0 + ,37 + ,73 + ,23 + ,0 + ,7 + ,851 + ,0 + ,259 + ,0 + ,161 + ,0 + ,37 + ,78 + ,39 + ,0 + ,5 + ,1443 + ,0 + ,185 + ,0 + ,195 + ,0 + ,37 + ,81 + ,87 + ,0 + ,5 + ,3219 + ,0 + ,185 + ,0 + ,435 + ,0 + ,36 + ,101 + ,46 + ,0 + ,3 + ,1656 + ,0 + ,108 + ,0 + ,138 + ,0 + ,36 + ,118 + ,66 + ,0 + ,5 + ,2376 + ,0 + ,180 + ,0 + ,330 + ,0 + ,36 + ,59 + ,57 + ,0 + ,4 + ,2052 + ,0 + ,144 + ,0 + ,228 + ,0 + ,36 + ,101 + ,48 + ,0 + ,9 + ,1728 + ,0 + ,324 + ,0 + ,432 + ,0 + ,36 + ,22 + ,75 + ,0 + ,3 + ,2700 + ,0 + ,108 + ,0 + ,225 + ,0 + ,36 + ,77 + ,35 + ,0 + ,3 + ,1260 + ,0 + ,108 + ,0 + ,105 + ,0 + ,35 + ,100 + ,53 + ,0 + ,3 + ,1855 + ,0 + ,105 + ,0 + ,159 + ,0 + ,35 + ,39 + ,60 + ,0 + ,3 + ,2100 + ,0 + ,105 + ,0 + ,180 + ,0 + ,34 + ,42 + ,20 + ,0 + ,15 + ,680 + ,0 + ,510 + ,0 + ,300 + ,0 + ,34 + ,80 + ,66 + ,0 + ,4 + ,2244 + ,0 + ,136 + ,0 + ,264 + ,0 + ,34 + ,48 + ,34 + ,0 + ,6 + ,1156 + ,0 + ,204 + ,0 + ,204 + ,0 + ,34 + ,131 + ,80 + ,0 + ,3 + ,2720 + ,0 + ,102 + ,0 + ,240 + ,0 + ,34 + ,46 + ,63 + ,0 + ,3 + ,2142 + ,0 + ,102 + ,0 + ,189 + ,0 + ,33 + ,89 + ,46 + ,0 + ,3 + ,1518 + ,0 + ,99 + ,0 + ,138 + ,0 + ,33 + ,51 + ,20 + ,0 + ,5 + ,660 + ,0 + ,165 + ,0 + ,100 + ,0 + ,33 + ,108 + ,73 + ,0 + ,3 + ,2409 + ,0 + ,99 + ,0 + ,219 + ,0 + ,33 + ,86 + ,57 + ,0 + ,4 + ,1881 + ,0 + ,132 + ,0 + ,228 + ,0 + ,33 + ,105 + ,65 + ,0 + ,7 + ,2145 + ,0 + ,231 + ,0 + ,455 + ,0 + ,33 + ,85 + ,70 + ,0 + ,4 + ,2310 + ,0 + ,132 + ,0 + ,280 + ,0 + ,32 + ,103 + ,53 + ,0 + ,5 + ,1696 + ,0 + ,160 + ,0 + ,265 + ,0 + ,32 + ,83 + ,60 + ,0 + ,7 + ,1920 + ,0 + ,224 + ,0 + ,420 + ,0 + ,32 + ,77 + ,34 + ,0 + ,14 + ,1088 + ,0 + ,448 + ,0 + ,476 + ,0 + ,32 + ,26 + ,18 + ,0 + ,25 + ,576 + ,0 + ,800 + ,0 + ,450 + ,0 + ,32 + ,73 + ,49 + ,0 + ,6 + ,1568 + ,0 + ,192 + ,0 + ,294 + ,0 + ,31 + ,42 + ,27 + ,0 + ,4 + ,837 + ,0 + ,124 + ,0 + ,108 + ,0 + ,31 + ,71 + ,45 + ,0 + ,3 + ,1395 + ,0 + ,93 + ,0 + ,135 + ,0 + ,31 + ,105 + ,9 + ,0 + ,62 + ,279 + ,0 + ,1922 + ,0 + ,558 + ,0 + ,30 + ,73 + ,23 + ,0 + ,5 + ,690 + ,0 + ,150 + ,0 + ,115 + ,0 + ,30 + ,98 + ,61 + ,0 + ,10 + ,1830 + ,0 + ,300 + ,0 + ,610 + ,0 + ,29 + ,108 + ,67 + ,0 + ,4 + ,1943 + ,0 + ,116 + ,0 + ,268 + ,0 + ,29 + ,57 + ,72 + ,0 + ,5 + ,2088 + ,0 + ,145 + ,0 + ,360 + ,0 + ,29 + ,37 + ,58 + ,0 + ,5 + ,1682 + ,0 + ,145 + ,0 + ,290 + ,0 + ,28 + ,70 + ,55 + ,0 + ,4 + ,1540 + ,0 + ,112 + ,0 + ,220 + ,0 + ,28 + ,73 + ,33 + ,0 + ,10 + ,924 + ,0 + ,280 + ,0 + ,330 + ,0 + ,28 + ,47 + ,40 + ,0 + ,5 + ,1120 + ,0 + ,140 + ,0 + ,200 + ,0 + ,28 + ,73 + ,57 + ,0 + ,3 + ,1596 + ,0 + ,84 + ,0 + ,171 + ,0 + ,28 + ,91 + ,61 + ,0 + ,3 + ,1708 + ,0 + ,84 + ,0 + ,183 + ,0 + ,28 + ,110 + ,87 + ,0 + ,17 + ,2436 + ,0 + ,476 + ,0 + ,1479 + ,0 + ,27 + ,78 + ,65 + ,0 + ,4 + ,1755 + ,0 + ,108 + ,0 + ,260 + ,0 + ,27 + ,92 + ,85 + ,0 + ,6 + ,2295 + ,0 + ,162 + ,0 + ,510 + ,0 + ,27 + ,52 + ,85 + ,0 + ,3 + ,2295 + ,0 + ,81 + ,0 + ,255 + ,0 + ,26 + ,88 + ,54 + ,0 + ,4 + ,1404 + ,0 + ,104 + ,0 + ,216 + ,0 + ,26 + ,100 + ,24 + ,0 + ,8 + ,624 + ,0 + ,208 + ,0 + ,192 + ,0 + ,26 + ,33 + ,31 + ,0 + ,3 + ,806 + ,0 + ,78 + ,0 + ,93 + ,0 + ,26 + ,42 + ,64 + ,0 + ,4 + ,1664 + ,0 + ,104 + ,0 + ,256 + ,0 + ,25 + ,81 + ,70 + ,0 + ,4 + ,1750 + ,0 + ,100 + ,0 + ,280 + ,0 + ,25 + ,67 + ,2 + ,0 + ,47 + ,50 + ,0 + ,1175 + ,0 + ,94 + ,0 + ,24 + ,8 + ,27 + ,0 + ,8 + ,648 + ,0 + ,192 + ,0 + ,216 + ,0 + ,24 + ,46 + ,29 + ,0 + ,3 + ,696 + ,0 + ,72 + ,0 + ,87 + ,0 + ,24 + ,83 + ,68 + ,0 + ,5 + ,1632 + ,0 + ,120 + ,0 + ,340 + ,0 + ,24 + ,87 + ,42 + ,0 + ,3 + ,1008 + ,0 + ,72 + ,0 + ,126 + ,0 + ,24 + ,82 + ,78 + ,0 + ,4 + ,1872 + ,0 + ,96 + ,0 + ,312 + ,0 + ,24 + ,63 + ,13 + ,0 + ,30 + ,312 + ,0 + ,720 + ,0 + ,390 + ,0 + ,24 + ,27 + ,52 + ,0 + ,4 + ,1248 + ,0 + ,96 + ,0 + ,208 + ,0 + ,23 + ,14 + ,25 + ,0 + ,12 + ,575 + ,0 + ,276 + ,0 + ,300 + ,0 + ,23 + ,83 + ,38 + ,0 + ,8 + ,874 + ,0 + ,184 + ,0 + ,304 + ,0 + ,23 + ,168 + ,40 + ,0 + ,3 + ,920 + ,0 + ,69 + ,0 + ,120 + ,0 + ,23 + ,67 + ,42 + ,0 + ,8 + ,966 + ,0 + ,184 + ,0 + ,336 + ,0 + ,23 + ,21 + ,40 + ,0 + ,4 + ,920 + ,0 + ,92 + ,0 + ,160 + ,0 + ,23 + ,55 + ,74 + ,0 + ,3 + ,1702 + ,0 + ,69 + ,0 + ,222 + ,0 + ,23 + ,54 + ,73 + ,0 + ,4 + ,1679 + ,0 + ,92 + ,0 + ,292 + ,0 + ,22 + ,118 + ,56 + ,0 + ,4 + ,1232 + ,0 + ,88 + ,0 + ,224 + ,0 + ,22 + ,69 + ,3 + ,0 + ,21 + ,66 + ,0 + ,462 + ,0 + ,63 + ,0 + ,21 + ,77 + ,9 + ,0 + ,12 + ,189 + ,0 + ,252 + ,0 + ,108 + ,0 + ,21 + ,72 + ,68 + ,0 + ,3 + ,1428 + ,0 + ,63 + ,0 + ,204 + ,0 + ,21 + ,53 + ,28 + ,0 + ,3 + ,588 + ,0 + ,63 + ,0 + ,84 + ,0 + ,21 + ,40 + ,36 + ,0 + ,4 + ,756 + ,0 + ,84 + ,0 + ,144 + ,0 + ,20 + ,102 + ,38 + ,0 + ,6 + ,760 + ,0 + ,120 + ,0 + ,228 + ,0 + ,20 + ,25 + ,55 + ,0 + ,17 + ,1100 + ,0 + ,340 + ,0 + ,935 + ,0 + ,20 + ,31 + ,36 + ,0 + ,3 + ,720 + ,0 + ,60 + ,0 + ,108 + ,0 + ,20 + ,77 + ,17 + ,0 + ,18 + ,340 + ,0 + ,360 + ,0 + ,306 + ,0 + ,20 + ,38 + ,54 + ,0 + ,5 + ,1080 + ,0 + ,100 + ,0 + ,270 + ,0 + ,19 + ,23 + ,57 + ,0 + ,5 + ,1083 + ,0 + ,95 + ,0 + ,285 + ,0 + ,19 + ,91 + ,30 + ,0 + ,16 + ,570 + ,0 + ,304 + ,0 + ,480 + ,0 + ,19 + ,58 + ,40 + ,0 + ,10 + ,760 + ,0 + ,190 + ,0 + ,400 + ,0 + ,18 + ,42 + ,37 + ,0 + ,5 + ,666 + ,0 + ,90 + ,0 + ,185 + ,0 + ,18 + ,44 + ,46 + ,0 + ,4 + ,828 + ,0 + ,72 + ,0 + ,184 + ,0 + ,18 + ,58 + ,32 + ,0 + ,3 + ,576 + ,0 + ,54 + ,0 + ,96 + ,0 + ,18 + ,35 + ,34 + ,0 + ,5 + ,612 + ,0 + ,90 + ,0 + ,170 + ,0 + ,18 + ,88 + ,22 + ,0 + ,4 + ,396 + ,0 + ,72 + ,0 + ,88 + ,0 + ,17 + ,25 + ,59 + ,0 + ,5 + ,1003 + ,0 + ,85 + ,0 + ,295 + ,0 + ,17 + ,39 + ,32 + ,0 + ,10 + ,544 + ,0 + ,170 + ,0 + ,320 + ,0 + ,16 + ,48 + ,18 + ,0 + ,12 + ,288 + ,0 + ,192 + ,0 + ,216 + ,0 + ,16 + ,64 + ,28 + ,0 + ,4 + ,448 + ,0 + ,64 + ,0 + ,112 + ,0 + ,15 + ,65 + ,34 + ,0 + ,9 + ,510 + ,0 + ,135 + ,0 + ,306 + ,0 + ,15 + ,95 + ,29 + ,0 + ,12 + ,435 + ,0 + ,180 + ,0 + ,348 + ,0 + ,15 + ,29 + ,24 + ,0 + ,10 + ,360 + ,0 + ,150 + ,0 + ,240 + ,0 + ,15 + ,2 + ,24 + ,0 + ,9 + ,360 + ,0 + ,135 + ,0 + ,216 + ,0 + ,14 + ,83 + ,23 + ,0 + ,17 + ,322 + ,0 + ,238 + ,0 + ,391 + ,0 + ,13 + ,11 + ,43 + ,0 + ,6 + ,559 + ,0 + ,78 + ,0 + ,258 + ,0 + ,13 + ,16 + ,28 + ,0 + ,3 + ,364 + ,0 + ,39 + ,0 + ,84 + ,0 + ,12 + ,9 + ,19 + ,0 + ,4 + ,228 + ,0 + ,48 + ,0 + ,76 + ,0 + ,11 + ,46 + ,16 + ,0 + ,19 + ,176 + ,0 + ,209 + ,0 + ,304 + ,0 + ,11 + ,41 + ,40 + ,0 + ,3 + ,440 + ,0 + ,33 + ,0 + ,120 + ,0 + ,10 + ,14 + ,14 + ,0 + ,9 + ,140 + ,0 + ,90 + ,0 + ,126 + ,0 + ,10 + ,63 + ,19 + ,0 + ,7 + ,190 + ,0 + ,70 + ,0 + ,133 + ,0 + ,10 + ,9 + ,22 + ,0 + ,4 + ,220 + ,0 + ,40 + ,0 + ,88 + ,0 + ,10 + ,0 + ,8 + ,0 + ,3 + ,80 + ,0 + ,30 + ,0 + ,24 + ,0 + ,9 + ,58 + ,31 + ,0 + ,46 + ,279 + ,0 + ,414 + ,0 + ,1426 + ,0 + ,8 + ,18 + ,9 + ,0 + ,31 + ,72 + ,0 + ,248 + ,0 + ,279 + ,0 + ,8 + ,42 + ,18 + ,0 + ,21 + ,144 + ,0 + ,168 + ,0 + ,378 + ,0 + ,7 + ,26 + ,9 + ,0 + ,7 + ,63 + ,0 + ,49 + ,0 + ,63 + ,0 + ,7 + ,38 + ,5 + ,0 + ,29 + ,35 + ,0 + ,203 + ,0 + ,145 + ,0 + ,4 + ,1 + ,11 + ,0 + ,5 + ,44 + ,0 + ,20 + ,0 + ,55 + ,0) + ,dim=c(11 + ,269) + ,dimnames=list(c('hours' + ,'lfm' + ,'blogs' + ,'uk' + ,'spr' + ,'hours_blogs' + ,'hours_uk' + ,'hours_spr' + ,'blogs_uk' + ,'blogs_spr' + ,'uk_spr') + ,1:269)) > y <- array(NA,dim=c(11,269),dimnames=list(c('hours','lfm','blogs','uk','spr','hours_blogs','hours_uk','hours_spr','blogs_uk','blogs_spr','uk_spr'),1:269)) > 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 = '2' > par4 <- 'no' > par3 <- '3' > par2 <- 'none' > par1 <- '2' > #'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] "lfm" > x[,par1] [1] 122 114 140 143 122 127 113 118 161 134 96 104 135 110 128 142 117 94 [19] 135 121 103 118 127 116 129 115 135 133 113 111 92 118 134 106 137 100 [37] 102 134 130 144 120 91 100 134 161 128 124 115 123 117 111 146 101 131 [55] 122 78 120 115 142 94 114 108 119 117 86 138 119 117 117 76 119 119 [73] 124 116 118 102 116 103 117 108 122 90 133 116 110 90 74 75 107 90 [91] 96 115 91 77 108 83 77 99 115 99 106 77 115 67 8 69 88 107 [109] 120 3 1 0 111 69 116 103 139 135 113 99 76 110 121 95 66 111 [127] 77 101 108 135 70 124 92 104 113 95 89 83 96 95 110 106 78 115 [145] 74 93 88 104 86 104 99 101 53 96 58 117 82 57 71 105 60 77 [163] 73 78 81 101 118 59 101 22 77 100 39 42 80 48 131 46 89 51 [181] 108 86 105 85 103 83 77 26 73 42 71 105 73 98 108 57 37 70 [199] 73 47 73 91 110 78 92 52 88 100 33 42 81 67 8 46 83 87 [217] 82 63 27 14 83 168 67 21 55 54 118 69 77 72 53 40 102 25 [235] 31 77 38 23 91 58 42 44 58 35 88 25 39 48 64 65 95 29 [253] 2 83 11 16 9 46 41 14 63 9 0 58 18 42 26 38 1 > 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]) 0 1 2 3 8 9 11 14 16 18 21 22 23 25 26 27 29 31 33 35 2 2 1 1 2 2 1 2 1 1 1 1 1 2 2 1 1 1 1 1 37 38 39 40 41 42 44 46 47 48 51 52 53 54 55 57 58 59 60 63 1 2 2 1 1 5 1 3 1 2 1 1 2 1 1 2 4 1 1 2 64 65 66 67 69 70 71 72 73 74 75 76 77 78 80 81 82 83 85 86 1 1 1 3 3 2 2 1 5 2 1 2 9 4 1 2 2 6 1 3 87 88 89 90 91 92 93 94 95 96 98 99 100 101 102 103 104 105 106 107 1 4 2 3 4 3 1 2 4 4 1 4 4 5 3 4 4 3 3 2 108 110 111 113 114 115 116 117 118 119 120 121 122 123 124 127 128 129 130 131 6 5 4 4 2 7 5 7 6 4 3 2 4 1 3 2 2 1 1 2 133 134 135 137 138 139 140 142 143 144 146 161 168 2 4 5 1 1 1 1 2 1 1 1 2 1 > colnames(x) [1] "hours" "lfm" "blogs" "uk" "spr" [6] "hours_blogs" "hours_uk" "hours_spr" "blogs_uk" "blogs_spr" [11] "uk_spr" > colnames(x)[par1] [1] "lfm" > x[,par1] [1] 122 114 140 143 122 127 113 118 161 134 96 104 135 110 128 142 117 94 [19] 135 121 103 118 127 116 129 115 135 133 113 111 92 118 134 106 137 100 [37] 102 134 130 144 120 91 100 134 161 128 124 115 123 117 111 146 101 131 [55] 122 78 120 115 142 94 114 108 119 117 86 138 119 117 117 76 119 119 [73] 124 116 118 102 116 103 117 108 122 90 133 116 110 90 74 75 107 90 [91] 96 115 91 77 108 83 77 99 115 99 106 77 115 67 8 69 88 107 [109] 120 3 1 0 111 69 116 103 139 135 113 99 76 110 121 95 66 111 [127] 77 101 108 135 70 124 92 104 113 95 89 83 96 95 110 106 78 115 [145] 74 93 88 104 86 104 99 101 53 96 58 117 82 57 71 105 60 77 [163] 73 78 81 101 118 59 101 22 77 100 39 42 80 48 131 46 89 51 [181] 108 86 105 85 103 83 77 26 73 42 71 105 73 98 108 57 37 70 [199] 73 47 73 91 110 78 92 52 88 100 33 42 81 67 8 46 83 87 [217] 82 63 27 14 83 168 67 21 55 54 118 69 77 72 53 40 102 25 [235] 31 77 38 23 91 58 42 44 58 35 88 25 39 48 64 65 95 29 [253] 2 83 11 16 9 46 41 14 63 9 0 58 18 42 26 38 1 > 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/14dgi1355754641.tab") + } + } > m Conditional inference tree with 6 terminal nodes Response: lfm Inputs: hours, blogs, uk, spr, hours_blogs, hours_uk, hours_spr, blogs_uk, blogs_spr, uk_spr Number of observations: 269 1) hours_uk <= 19; criterion = 1, statistic = 87.81 2) blogs <= 60; criterion = 1, statistic = 48.598 3) hours <= 13; criterion = 1, statistic = 22.325 4)* weights = 18 3) hours > 13 5)* weights = 81 2) blogs > 60 6) hours <= 39; criterion = 0.955, statistic = 8.025 7)* weights = 34 6) hours > 39 8)* weights = 33 1) hours_uk > 19 9) hours <= 27; criterion = 1, statistic = 16.848 10)* weights = 19 9) hours > 27 11)* weights = 84 > postscript(file="/var/wessaorg/rcomp/tmp/2rpcy1355754641.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/3au911355754641.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 122 118.57143 3.4285714 2 114 118.57143 -4.5714286 3 140 118.57143 21.4285714 4 143 118.57143 24.4285714 5 122 118.57143 3.4285714 6 127 118.57143 8.4285714 7 113 118.57143 -5.5714286 8 118 118.57143 -0.5714286 9 161 118.57143 42.4285714 10 134 118.57143 15.4285714 11 96 118.57143 -22.5714286 12 104 118.57143 -14.5714286 13 135 118.57143 16.4285714 14 110 118.57143 -8.5714286 15 128 118.57143 9.4285714 16 142 118.57143 23.4285714 17 117 118.57143 -1.5714286 18 94 118.57143 -24.5714286 19 135 118.57143 16.4285714 20 121 118.57143 2.4285714 21 103 118.57143 -15.5714286 22 118 118.57143 -0.5714286 23 127 118.57143 8.4285714 24 116 118.57143 -2.5714286 25 129 118.57143 10.4285714 26 115 118.57143 -3.5714286 27 135 118.57143 16.4285714 28 133 118.57143 14.4285714 29 113 118.57143 -5.5714286 30 111 118.57143 -7.5714286 31 92 118.57143 -26.5714286 32 118 118.57143 -0.5714286 33 134 118.57143 15.4285714 34 106 118.57143 -12.5714286 35 137 118.57143 18.4285714 36 100 118.57143 -18.5714286 37 102 118.57143 -16.5714286 38 134 118.57143 15.4285714 39 130 118.57143 11.4285714 40 144 118.57143 25.4285714 41 120 118.57143 1.4285714 42 91 118.57143 -27.5714286 43 100 118.57143 -18.5714286 44 134 118.57143 15.4285714 45 161 118.57143 42.4285714 46 128 118.57143 9.4285714 47 124 118.57143 5.4285714 48 115 118.57143 -3.5714286 49 123 118.57143 4.4285714 50 117 118.57143 -1.5714286 51 111 118.57143 -7.5714286 52 146 118.57143 27.4285714 53 101 118.57143 -17.5714286 54 131 118.57143 12.4285714 55 122 118.57143 3.4285714 56 78 118.57143 -40.5714286 57 120 118.57143 1.4285714 58 115 118.57143 -3.5714286 59 142 118.57143 23.4285714 60 94 118.57143 -24.5714286 61 114 118.57143 -4.5714286 62 108 118.57143 -10.5714286 63 119 118.57143 0.4285714 64 117 118.57143 -1.5714286 65 86 118.57143 -32.5714286 66 138 118.57143 19.4285714 67 119 118.57143 0.4285714 68 117 118.57143 -1.5714286 69 117 118.57143 -1.5714286 70 76 118.57143 -42.5714286 71 119 118.57143 0.4285714 72 119 118.57143 0.4285714 73 124 118.57143 5.4285714 74 116 118.57143 -2.5714286 75 118 118.57143 -0.5714286 76 102 118.57143 -16.5714286 77 116 118.57143 -2.5714286 78 103 118.57143 -15.5714286 79 117 118.57143 -1.5714286 80 108 118.57143 -10.5714286 81 122 118.57143 3.4285714 82 90 118.57143 -28.5714286 83 133 118.57143 14.4285714 84 116 118.57143 -2.5714286 85 110 94.94737 15.0526316 86 90 94.94737 -4.9473684 87 74 94.94737 -20.9473684 88 75 94.94737 -19.9473684 89 107 94.94737 12.0526316 90 90 94.94737 -4.9473684 91 96 94.94737 1.0526316 92 115 94.94737 20.0526316 93 91 94.94737 -3.9473684 94 77 94.94737 -17.9473684 95 108 94.94737 13.0526316 96 83 94.94737 -11.9473684 97 77 94.94737 -17.9473684 98 99 94.94737 4.0526316 99 115 94.94737 20.0526316 100 99 94.94737 4.0526316 101 106 94.94737 11.0526316 102 77 94.94737 -17.9473684 103 115 94.94737 20.0526316 104 67 65.74074 1.2592593 105 8 65.74074 -57.7407407 106 69 65.74074 3.2592593 107 88 65.74074 22.2592593 108 107 65.74074 41.2592593 109 120 65.74074 54.2592593 110 3 22.00000 -19.0000000 111 1 22.00000 -21.0000000 112 0 22.00000 -22.0000000 113 111 102.51515 8.4848485 114 69 102.51515 -33.5151515 115 116 102.51515 13.4848485 116 103 102.51515 0.4848485 117 139 102.51515 36.4848485 118 135 102.51515 32.4848485 119 113 102.51515 10.4848485 120 99 65.74074 33.2592593 121 76 102.51515 -26.5151515 122 110 102.51515 7.4848485 123 121 102.51515 18.4848485 124 95 102.51515 -7.5151515 125 66 102.51515 -36.5151515 126 111 102.51515 8.4848485 127 77 65.74074 11.2592593 128 101 102.51515 -1.5151515 129 108 102.51515 5.4848485 130 135 102.51515 32.4848485 131 70 102.51515 -32.5151515 132 124 102.51515 21.4848485 133 92 102.51515 -10.5151515 134 104 102.51515 1.4848485 135 113 102.51515 10.4848485 136 95 102.51515 -7.5151515 137 89 102.51515 -13.5151515 138 83 102.51515 -19.5151515 139 96 102.51515 -6.5151515 140 95 102.51515 -7.5151515 141 110 102.51515 7.4848485 142 106 102.51515 3.4848485 143 78 65.74074 12.2592593 144 115 102.51515 12.4848485 145 74 65.74074 8.2592593 146 93 102.51515 -9.5151515 147 88 65.74074 22.2592593 148 104 102.51515 1.4848485 149 86 102.51515 -16.5151515 150 104 65.74074 38.2592593 151 99 102.51515 -3.5151515 152 101 80.88235 20.1176471 153 53 80.88235 -27.8823529 154 96 80.88235 15.1176471 155 58 65.74074 -7.7407407 156 117 80.88235 36.1176471 157 82 80.88235 1.1176471 158 57 80.88235 -23.8823529 159 71 80.88235 -9.8823529 160 105 80.88235 24.1176471 161 60 80.88235 -20.8823529 162 77 80.88235 -3.8823529 163 73 65.74074 7.2592593 164 78 65.74074 12.2592593 165 81 80.88235 0.1176471 166 101 65.74074 35.2592593 167 118 80.88235 37.1176471 168 59 65.74074 -6.7407407 169 101 65.74074 35.2592593 170 22 80.88235 -58.8823529 171 77 65.74074 11.2592593 172 100 65.74074 34.2592593 173 39 65.74074 -26.7407407 174 42 65.74074 -23.7407407 175 80 80.88235 -0.8823529 176 48 65.74074 -17.7407407 177 131 80.88235 50.1176471 178 46 80.88235 -34.8823529 179 89 65.74074 23.2592593 180 51 65.74074 -14.7407407 181 108 80.88235 27.1176471 182 86 65.74074 20.2592593 183 105 80.88235 24.1176471 184 85 80.88235 4.1176471 185 103 65.74074 37.2592593 186 83 65.74074 17.2592593 187 77 65.74074 11.2592593 188 26 65.74074 -39.7407407 189 73 65.74074 7.2592593 190 42 65.74074 -23.7407407 191 71 65.74074 5.2592593 192 105 65.74074 39.2592593 193 73 65.74074 7.2592593 194 98 80.88235 17.1176471 195 108 80.88235 27.1176471 196 57 80.88235 -23.8823529 197 37 65.74074 -28.7407407 198 70 65.74074 4.2592593 199 73 65.74074 7.2592593 200 47 65.74074 -18.7407407 201 73 65.74074 7.2592593 202 91 80.88235 10.1176471 203 110 80.88235 29.1176471 204 78 80.88235 -2.8823529 205 92 80.88235 11.1176471 206 52 80.88235 -28.8823529 207 88 65.74074 22.2592593 208 100 65.74074 34.2592593 209 33 65.74074 -32.7407407 210 42 80.88235 -38.8823529 211 81 80.88235 0.1176471 212 67 65.74074 1.2592593 213 8 65.74074 -57.7407407 214 46 65.74074 -19.7407407 215 83 80.88235 2.1176471 216 87 65.74074 21.2592593 217 82 80.88235 1.1176471 218 63 65.74074 -2.7407407 219 27 65.74074 -38.7407407 220 14 65.74074 -51.7407407 221 83 65.74074 17.2592593 222 168 65.74074 102.2592593 223 67 65.74074 1.2592593 224 21 65.74074 -44.7407407 225 55 80.88235 -25.8823529 226 54 80.88235 -26.8823529 227 118 65.74074 52.2592593 228 69 65.74074 3.2592593 229 77 65.74074 11.2592593 230 72 80.88235 -8.8823529 231 53 65.74074 -12.7407407 232 40 65.74074 -25.7407407 233 102 65.74074 36.2592593 234 25 65.74074 -40.7407407 235 31 65.74074 -34.7407407 236 77 65.74074 11.2592593 237 38 65.74074 -27.7407407 238 23 65.74074 -42.7407407 239 91 65.74074 25.2592593 240 58 65.74074 -7.7407407 241 42 65.74074 -23.7407407 242 44 65.74074 -21.7407407 243 58 65.74074 -7.7407407 244 35 65.74074 -30.7407407 245 88 65.74074 22.2592593 246 25 65.74074 -40.7407407 247 39 65.74074 -26.7407407 248 48 65.74074 -17.7407407 249 64 65.74074 -1.7407407 250 65 65.74074 -0.7407407 251 95 65.74074 29.2592593 252 29 65.74074 -36.7407407 253 2 65.74074 -63.7407407 254 83 65.74074 17.2592593 255 11 22.00000 -11.0000000 256 16 22.00000 -6.0000000 257 9 22.00000 -13.0000000 258 46 22.00000 24.0000000 259 41 22.00000 19.0000000 260 14 22.00000 -8.0000000 261 63 22.00000 41.0000000 262 9 22.00000 -13.0000000 263 0 22.00000 -22.0000000 264 58 22.00000 36.0000000 265 18 22.00000 -4.0000000 266 42 22.00000 20.0000000 267 26 22.00000 4.0000000 268 38 22.00000 16.0000000 269 1 22.00000 -21.0000000 > 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/4ldeb1355754641.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/5gxsk1355754641.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/60mpm1355754641.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/7y7ca1355754641.tab") + } > > try(system("convert tmp/2rpcy1355754641.ps tmp/2rpcy1355754641.png",intern=TRUE)) character(0) > try(system("convert tmp/3au911355754641.ps tmp/3au911355754641.png",intern=TRUE)) character(0) > try(system("convert tmp/4ldeb1355754641.ps tmp/4ldeb1355754641.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 9.430 0.669 11.271