R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(210907 + ,79 + ,30 + ,12.33207023 + ,120982 + ,58 + ,28 + ,9.279506726 + ,176508 + ,60 + ,38 + ,13.28668541 + ,179321 + ,108 + ,30 + ,8.61003914 + ,123185 + ,49 + ,22 + ,9.182672595 + ,52746 + ,0 + ,26 + ,10.07606028 + ,385534 + ,121 + ,25 + ,16.85785849 + ,33170 + ,1 + ,18 + ,7.874589695 + ,101645 + ,20 + ,11 + ,8.714737001 + ,149061 + ,43 + ,26 + ,11.47745609 + ,165446 + ,69 + ,25 + ,10.15413531 + ,237213 + ,78 + ,38 + ,14.85888908 + ,173326 + ,86 + ,44 + ,12.04942679 + ,133131 + ,44 + ,30 + ,11.2213685 + ,258873 + ,104 + ,40 + ,14.23285865 + ,180083 + ,63 + ,34 + ,12.64272724 + ,324799 + ,158 + ,47 + ,14.36453624 + ,230964 + ,102 + ,30 + ,11.56076809 + ,236785 + ,77 + ,31 + ,13.88190107 + ,135473 + ,82 + ,23 + ,7.426300295 + ,202925 + ,115 + ,36 + ,10.10584472 + ,215147 + ,101 + ,36 + ,11.75638145 + ,344297 + ,80 + ,30 + ,18.70484851 + ,153935 + ,50 + ,25 + ,11.03580835 + ,132943 + ,83 + ,39 + ,9.587133128 + ,174724 + ,123 + ,34 + ,7.842133748 + ,174415 + ,73 + ,31 + ,11.16951753 + ,225548 + ,81 + ,31 + ,13.03590275 + ,223632 + ,105 + ,33 + ,11.4215223 + ,124817 + ,47 + ,25 + ,9.855233575 + ,221698 + ,105 + ,33 + ,11.32802697 + ,210767 + ,94 + ,35 + ,11.92705655 + ,170266 + ,44 + ,42 + ,14.7857096 + ,260561 + ,114 + ,43 + ,13.99982215 + ,84853 + ,38 + ,30 + ,9.341618368 + ,294424 + ,107 + ,33 + ,14.69243455 + ,101011 + ,30 + ,13 + ,8.222021054 + ,215641 + ,71 + ,32 + ,13.46131645 + ,325107 + ,84 + ,36 + ,18.3589407 + ,7176 + ,0 + ,0 + ,4.039967571 + ,167542 + ,59 + ,28 + ,11.4546639 + ,106408 + ,33 + ,14 + ,8.403278993 + ,96560 + ,42 + ,17 + ,7.68824991 + ,265769 + ,96 + ,32 + ,13.992352 + ,269651 + ,106 + ,30 + ,13.1282448 + ,149112 + ,56 + ,35 + ,11.8227682 + ,175824 + ,57 + ,20 + ,10.82700827 + ,152871 + ,59 + ,28 + ,10.74542401 + ,111665 + ,39 + ,28 + ,10.26724426 + ,116408 + ,34 + ,39 + ,12.49669274 + ,362301 + ,76 + ,34 + ,20.46769195 + ,78800 + ,20 + ,26 + ,9.821747177 + ,183167 + ,91 + ,39 + ,11.40957458 + ,277965 + ,115 + ,39 + ,14.17578319 + ,150629 + ,85 + ,33 + ,9.40618075 + ,168809 + ,76 + ,28 + ,10.22914948 + ,24188 + ,8 + ,4 + ,4.846550075 + ,329267 + ,79 + ,39 + ,19.38078891 + ,65029 + ,21 + ,18 + ,7.9009076 + ,101097 + ,30 + ,14 + ,8.37360559 + ,218946 + ,76 + ,29 + ,12.8003486 + ,244052 + ,101 + ,44 + ,14.33315165 + ,341570 + ,94 + ,21 + ,16.18648504 + ,103597 + ,27 + ,16 + ,9.016393296 + ,233328 + ,92 + ,28 + ,12.1371174 + ,256462 + ,123 + ,35 + ,11.94101943 + ,206161 + ,75 + ,28 + ,12.11054859 + ,311473 + ,128 + ,38 + ,14.66423603 + ,235800 + ,105 + ,23 + ,10.5354893 + ,177939 + ,55 + ,36 + ,13.43947043 + ,207176 + ,56 + ,32 + ,14.18747397 + ,196553 + ,41 + ,29 + ,14.36702622 + ,174184 + ,72 + ,25 + ,10.34948012 + ,143246 + ,67 + ,27 + ,9.527159314 + ,187559 + ,75 + ,36 + ,12.39068876 + ,187681 + ,114 + ,28 + ,8.265180043 + ,119016 + ,118 + ,23 + ,3.905805772 + ,182192 + ,77 + ,40 + ,12.56955602 + ,73566 + ,22 + ,23 + ,8.975054776 + ,194979 + ,66 + ,40 + ,14.02033036 + ,167488 + ,69 + ,28 + ,10.6951328 + ,143756 + ,105 + ,34 + ,7.707505325 + ,275541 + ,116 + ,33 + ,13.0983455 + ,243199 + ,88 + ,28 + ,12.9170792 + ,182999 + ,73 + ,34 + ,12.0267748 + ,135649 + ,99 + ,30 + ,7.180032959 + ,152299 + ,62 + ,33 + ,11.22783085 + ,120221 + ,53 + ,22 + ,8.736615767 + ,346485 + ,118 + ,38 + ,17.11374109 + ,145790 + ,30 + ,26 + ,12.30332295 + ,193339 + ,100 + ,35 + ,10.63038272 + ,80953 + ,49 + ,8 + ,5.077073234 + ,122774 + ,24 + ,24 + ,11.34995915 + ,130585 + ,67 + ,29 + ,9.209942901 + ,112611 + ,46 + ,20 + ,8.603715999 + ,286468 + ,57 + ,29 + ,17.5027125 + ,241066 + ,75 + ,45 + ,16.30422004 + ,148446 + ,135 + ,37 + ,6.105753302 + ,204713 + ,68 + ,33 + ,13.30752755 + ,182079 + ,124 + ,33 + ,7.974577282 + ,140344 + ,33 + ,25 + ,11.66554386 + ,220516 + ,98 + ,32 + ,11.65330293 + ,243060 + ,58 + ,29 + ,15.32854829 + ,162765 + ,68 + ,28 + ,10.54250096 + ,182613 + ,81 + ,28 + ,10.51801571 + ,232138 + ,131 + ,31 + ,9.569880124 + ,265318 + ,110 + ,52 + ,15.8594013 + ,85574 + ,37 + ,21 + ,8.125322358 + ,310839 + ,130 + ,24 + ,12.41822391 + ,225060 + ,93 + ,41 + ,13.57827708 + ,232317 + ,118 + ,33 + ,10.85738435 + ,144966 + ,39 + ,32 + ,12.46682205 + ,43287 + ,13 + ,19 + ,7.602797991 + ,155754 + ,74 + ,20 + ,8.56999965 + ,164709 + ,81 + ,31 + ,10.09476408 + ,201940 + ,109 + ,31 + ,9.775244027 + ,235454 + ,151 + ,32 + ,8.36377134 + ,220801 + ,51 + ,18 + ,13.16062883 + ,99466 + ,28 + ,23 + ,9.772985659 + ,92661 + ,40 + ,17 + ,7.651144739 + ,133328 + ,56 + ,20 + ,8.848316977 + ,61361 + ,27 + ,12 + ,6.38487096 + ,125930 + ,37 + ,17 + ,9.486543572 + ,100750 + ,83 + ,30 + ,6.703984159 + ,224549 + ,54 + ,31 + ,15.03129367 + ,82316 + ,27 + ,10 + ,7.103044063 + ,102010 + ,28 + ,13 + ,8.421699808 + ,101523 + ,59 + ,22 + ,7.378546348 + ,243511 + ,133 + ,42 + ,11.58999818 + ,22938 + ,12 + ,1 + ,4.041071998 + ,41566 + ,0 + ,9 + ,7.029326071 + ,152474 + ,106 + ,32 + ,7.758413303 + ,61857 + ,23 + ,11 + ,6.564190269 + ,99923 + ,44 + ,25 + ,8.87885956 + ,132487 + ,71 + ,36 + ,10.0311123 + ,317394 + ,116 + ,31 + ,14.82679024 + ,21054 + ,4 + ,0 + ,4.408103242 + ,209641 + ,62 + ,24 + ,12.67307076 + ,22648 + ,12 + ,13 + ,5.79617701 + ,31414 + ,18 + ,8 + ,5.028664044 + ,46698 + ,14 + ,13 + ,6.807441606 + ,131698 + ,60 + ,19 + ,8.319322646 + ,91735 + ,7 + ,18 + ,10.25164408 + ,244749 + ,98 + ,33 + ,12.97222545 + ,184510 + ,64 + ,40 + ,13.6656118 + ,79863 + ,29 + ,22 + ,8.60219909 + ,128423 + ,32 + ,38 + ,13.08149075 + ,97839 + ,25 + ,24 + ,10.06883484 + ,38214 + ,16 + ,8 + ,5.508780435 + ,151101 + ,48 + ,35 + ,12.52445885 + ,272458 + ,100 + ,43 + ,15.63464741 + ,172494 + ,46 + ,43 + ,14.88946069 + ,108043 + ,45 + ,14 + ,7.574015078 + ,328107 + ,129 + ,41 + ,15.83496225 + ,250579 + ,130 + ,38 + ,11.56905439 + ,351067 + ,136 + ,45 + ,17.00478087 + ,158015 + ,59 + ,31 + ,11.43638143 + ,98866 + ,25 + ,13 + ,8.496785646 + ,85439 + ,32 + ,28 + ,9.529245621 + ,229242 + ,63 + ,31 + ,14.57693876 + ,351619 + ,95 + ,40 + ,19.39770536 + ,84207 + ,14 + ,30 + ,11.12699818 + ,120445 + ,36 + ,16 + ,9.149647335 + ,324598 + ,113 + ,37 + ,16.28669149 + ,131069 + ,47 + ,30 + ,10.8946091 + ,204271 + ,92 + ,35 + ,11.76440465 + ,165543 + ,70 + ,32 + ,11.1151218 + ,141722 + ,19 + ,27 + ,13.08670337 + ,116048 + ,50 + ,20 + ,8.467102597 + ,250047 + ,41 + ,18 + ,15.33138825 + ,299775 + ,91 + ,31 + ,15.86733668 + ,195838 + ,111 + ,31 + ,9.328871037 + ,173260 + ,41 + ,21 + ,12.06155683 + ,254488 + ,120 + ,39 + ,12.66237472 + ,104389 + ,135 + ,41 + ,4.565614713 + ,136084 + ,27 + ,13 + ,10.14463063 + ,199476 + ,87 + ,32 + ,11.46877923 + ,92499 + ,25 + ,18 + ,8.926121079 + ,224330 + ,131 + ,39 + ,10.37183444 + ,135781 + ,45 + ,14 + ,8.914952706 + ,74408 + ,29 + ,7 + ,6.127082529 + ,81240 + ,58 + ,17 + ,5.736562508 + ,14688 + ,4 + ,0 + ,4.10035182 + ,181633 + ,47 + ,30 + ,13.33902363 + ,271856 + ,109 + ,37 + ,14.03975418 + ,7199 + ,7 + ,0 + ,3.511235057 + ,46660 + ,12 + ,5 + ,5.777572371 + ,17547 + ,0 + ,1 + ,4.688759674 + ,133368 + ,37 + ,16 + ,9.698691631 + ,95227 + ,37 + ,32 + ,10.2136746 + ,152601 + ,46 + ,24 + ,11.12666 + ,98146 + ,15 + ,17 + ,9.808607433 + ,79619 + ,42 + ,11 + ,5.984709218 + ,59194 + ,7 + ,24 + ,9.563077345 + ,139942 + ,54 + ,22 + ,9.614295652 + ,118612 + ,54 + ,12 + ,7.108869455 + ,72880 + ,14 + ,19 + ,8.957719792 + ,65475 + ,16 + ,13 + ,7.563793659 + ,99643 + ,33 + ,17 + ,8.518519841 + ,71965 + ,32 + ,15 + ,6.96132077 + ,77272 + ,21 + ,16 + ,8.197916647 + ,49289 + ,15 + ,24 + ,8.47870365 + ,135131 + ,38 + ,15 + ,9.560801211 + ,108446 + ,22 + ,17 + ,9.776695742 + ,89746 + ,28 + ,18 + ,8.565956678 + ,44296 + ,10 + ,20 + ,8.026079271 + ,77648 + ,31 + ,16 + ,7.459173032 + ,181528 + ,32 + ,16 + ,12.40534992 + ,134019 + ,32 + ,18 + ,10.40347728 + ,124064 + ,43 + ,22 + ,9.679318421 + ,92630 + ,27 + ,8 + ,7.306799498 + ,121848 + ,37 + ,17 + ,9.289207521 + ,52915 + ,20 + ,18 + ,7.390972776 + ,81872 + ,32 + ,16 + ,7.58768173 + ,58981 + ,0 + ,23 + ,9.935197653 + ,53515 + ,5 + ,22 + ,9.145067587 + ,60812 + ,26 + ,13 + ,6.58144976 + ,56375 + ,10 + ,13 + ,7.578024871 + ,65490 + ,27 + ,16 + ,7.17418729 + ,80949 + ,11 + ,16 + ,9.132594366 + ,76302 + ,29 + ,20 + ,8.135195652 + ,104011 + ,25 + ,22 + ,10.07235364 + ,98104 + ,55 + ,17 + ,6.778894725 + ,67989 + ,23 + ,18 + ,7.892618711 + ,30989 + ,5 + ,17 + ,7.318958382 + ,135458 + ,43 + ,12 + ,8.755867959 + ,73504 + ,23 + ,7 + ,6.537532819 + ,63123 + ,34 + ,17 + ,6.677342089 + ,61254 + ,36 + ,14 + ,5.993323822 + ,74914 + ,35 + ,23 + ,8.056224367 + ,31774 + ,0 + ,17 + ,7.73536791 + ,81437 + ,37 + ,14 + ,6.893338165 + ,87186 + ,28 + ,15 + ,7.999917525 + ,50090 + ,16 + ,17 + ,7.409745044 + ,65745 + ,26 + ,21 + ,7.999342006 + ,56653 + ,38 + ,18 + ,6.209221806 + ,158399 + ,23 + ,18 + ,12.26330769 + ,46455 + ,22 + ,17 + ,6.779865959 + ,73624 + ,30 + ,17 + ,7.487759971 + ,38395 + ,16 + ,16 + ,6.696946832 + ,91899 + ,18 + ,15 + ,8.984678574 + ,139526 + ,28 + ,21 + ,11.41475143 + ,52164 + ,32 + ,16 + ,6.151508427 + ,51567 + ,21 + ,14 + ,6.660406221 + ,70551 + ,23 + ,15 + ,7.574192311 + ,84856 + ,29 + ,17 + ,8.106440399 + ,102538 + ,50 + ,15 + ,7.076853715 + ,86678 + ,12 + ,15 + ,9.186432211 + ,85709 + ,21 + ,10 + ,7.721224146 + ,34662 + ,18 + ,6 + ,4.89082797 + ,150580 + ,27 + ,22 + ,12.17225385 + ,99611 + ,41 + ,21 + ,8.501144563 + ,19349 + ,13 + ,1 + ,3.791876979 + ,99373 + ,12 + ,18 + ,10.24242748 + ,86230 + ,21 + ,17 + ,8.778400117 + ,30837 + ,8 + ,4 + ,5.167982561 + ,31706 + ,26 + ,10 + ,4.732097814 + ,89806 + ,27 + ,16 + ,8.349695235 + ,62088 + ,13 + ,16 + ,8.069413272 + ,40151 + ,16 + ,9 + ,5.749847831 + ,27634 + ,2 + ,16 + ,7.236416811 + ,76990 + ,42 + ,17 + ,6.742177757 + ,37460 + ,5 + ,7 + ,6.157515421 + ,54157 + ,37 + ,15 + ,5.721968662 + ,49862 + ,17 + ,14 + ,6.880749667 + ,84337 + ,38 + ,14 + ,6.957840755 + ,64175 + ,37 + ,18 + ,6.648549773 + ,59382 + ,29 + ,12 + ,6.137816084 + ,119308 + ,32 + ,16 + ,9.397449595 + ,76702 + ,35 + ,21 + ,7.847807539 + ,103425 + ,17 + ,19 + ,10.20728 + ,70344 + ,20 + ,16 + ,7.938688526 + ,43410 + ,7 + ,1 + ,5.409209809 + ,104838 + ,46 + ,16 + ,7.638237843 + ,62215 + ,24 + ,10 + ,6.35837796 + ,69304 + ,40 + ,19 + ,6.816851793 + ,53117 + ,3 + ,12 + ,7.802940799 + ,19764 + ,10 + ,2 + ,4.186442529 + ,86680 + ,37 + ,14 + ,7.146800419 + ,84105 + ,17 + ,17 + ,8.978439511 + ,77945 + ,28 + ,19 + ,8.142888189 + ,89113 + ,19 + ,14 + ,8.62687593 + ,91005 + ,29 + ,11 + ,7.519139156 + ,40248 + ,8 + ,4 + ,5.622938362 + ,64187 + ,10 + ,16 + ,8.397961363 + ,50857 + ,15 + ,20 + ,7.964797287 + ,56613 + ,15 + ,12 + ,7.063643173 + ,62792 + ,28 + ,15 + ,6.820638828 + ,72535 + ,17 + ,16 + ,8.271684172) + ,dim=c(4 + ,289) + ,dimnames=list(c('time_in_rfc' + ,'blogged_computations' + ,'compendiums_reviewed' + ,'Forecast') + ,1:289)) > y <- array(NA,dim=c(4,289),dimnames=list(c('time_in_rfc','blogged_computations','compendiums_reviewed','Forecast'),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 = '0' > par2 = 'none' > par1 = '4' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > library(party) Loading required package: survival Loading required package: splines Loading required package: grid Loading required package: modeltools Loading required package: stats4 Loading required package: coin Loading required package: mvtnorm Loading required package: zoo Loading required package: sandwich Loading required package: strucchange Loading required package: vcd Loading required package: MASS Loading required package: colorspace > library(Hmisc) Attaching package: 'Hmisc' The following object(s) are masked from 'package:survival': untangle.specials The following object(s) are masked from 'package:base': format.pval, round.POSIXt, trunc.POSIXt, units > par1 <- as.numeric(par1) > par3 <- as.numeric(par3) > x <- data.frame(t(y)) > is.data.frame(x) [1] TRUE > x <- x[!is.na(x[,par1]),] > k <- length(x[1,]) > n <- length(x[,1]) > colnames(x)[par1] [1] "Forecast" > x[,par1] [1] 12.332070 9.279507 13.286685 8.610039 9.182673 10.076060 16.857858 [8] 7.874590 8.714737 11.477456 10.154135 14.858889 12.049427 11.221369 [15] 14.232859 12.642727 14.364536 11.560768 13.881901 7.426300 10.105845 [22] 11.756381 18.704849 11.035808 9.587133 7.842134 11.169518 13.035903 [29] 11.421522 9.855234 11.328027 11.927057 14.785710 13.999822 9.341618 [36] 14.692435 8.222021 13.461316 18.358941 4.039968 11.454664 8.403279 [43] 7.688250 13.992352 13.128245 11.822768 10.827008 10.745424 10.267244 [50] 12.496693 20.467692 9.821747 11.409575 14.175783 9.406181 10.229149 [57] 4.846550 19.380789 7.900908 8.373606 12.800349 14.333152 16.186485 [64] 9.016393 12.137117 11.941019 12.110549 14.664236 10.535489 13.439470 [71] 14.187474 14.367026 10.349480 9.527159 12.390689 8.265180 3.905806 [78] 12.569556 8.975055 14.020330 10.695133 7.707505 13.098346 12.917079 [85] 12.026775 7.180033 11.227831 8.736616 17.113741 12.303323 10.630383 [92] 5.077073 11.349959 9.209943 8.603716 17.502713 16.304220 6.105753 [99] 13.307528 7.974577 11.665544 11.653303 15.328548 10.542501 10.518016 [106] 9.569880 15.859401 8.125322 12.418224 13.578277 10.857384 12.466822 [113] 7.602798 8.570000 10.094764 9.775244 8.363771 13.160629 9.772986 [120] 7.651145 8.848317 6.384871 9.486544 6.703984 15.031294 7.103044 [127] 8.421700 7.378546 11.589998 4.041072 7.029326 7.758413 6.564190 [134] 8.878860 10.031112 14.826790 4.408103 12.673071 5.796177 5.028664 [141] 6.807442 8.319323 10.251644 12.972225 13.665612 8.602199 13.081491 [148] 10.068835 5.508780 12.524459 15.634647 14.889461 7.574015 15.834962 [155] 11.569054 17.004781 11.436381 8.496786 9.529246 14.576939 19.397705 [162] 11.126998 9.149647 16.286691 10.894609 11.764405 11.115122 13.086703 [169] 8.467103 15.331388 15.867337 9.328871 12.061557 12.662375 4.565615 [176] 10.144631 11.468779 8.926121 10.371834 8.914953 6.127083 5.736563 [183] 4.100352 13.339024 14.039754 3.511235 5.777572 4.688760 9.698692 [190] 10.213675 11.126660 9.808607 5.984709 9.563077 9.614296 7.108869 [197] 8.957720 7.563794 8.518520 6.961321 8.197917 8.478704 9.560801 [204] 9.776696 8.565957 8.026079 7.459173 12.405350 10.403477 9.679318 [211] 7.306799 9.289208 7.390973 7.587682 9.935198 9.145068 6.581450 [218] 7.578025 7.174187 9.132594 8.135196 10.072354 6.778895 7.892619 [225] 7.318958 8.755868 6.537533 6.677342 5.993324 8.056224 7.735368 [232] 6.893338 7.999918 7.409745 7.999342 6.209222 12.263308 6.779866 [239] 7.487760 6.696947 8.984679 11.414751 6.151508 6.660406 7.574192 [246] 8.106440 7.076854 9.186432 7.721224 4.890828 12.172254 8.501145 [253] 3.791877 10.242427 8.778400 5.167983 4.732098 8.349695 8.069413 [260] 5.749848 7.236417 6.742178 6.157515 5.721969 6.880750 6.957841 [267] 6.648550 6.137816 9.397450 7.847808 10.207280 7.938689 5.409210 [274] 7.638238 6.358378 6.816852 7.802941 4.186443 7.146800 8.978440 [281] 8.142888 8.626876 7.519139 5.622938 8.397961 7.964797 7.063643 [288] 6.820639 8.271684 > 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]) 3.511235057 3.791876979 3.905805772 4.039967571 4.041071998 4.10035182 1 1 1 1 1 1 4.186442529 4.408103242 4.565614713 4.688759674 4.732097814 4.846550075 1 1 1 1 1 1 4.89082797 5.028664044 5.077073234 5.167982561 5.409209809 5.508780435 1 1 1 1 1 1 5.622938362 5.721968662 5.736562508 5.749847831 5.777572371 5.79617701 1 1 1 1 1 1 5.984709218 5.993323822 6.105753302 6.127082529 6.137816084 6.151508427 1 1 1 1 1 1 6.157515421 6.209221806 6.35837796 6.38487096 6.537532819 6.564190269 1 1 1 1 1 1 6.58144976 6.648549773 6.660406221 6.677342089 6.696946832 6.703984159 1 1 1 1 1 1 6.742177757 6.778894725 6.779865959 6.807441606 6.816851793 6.820638828 1 1 1 1 1 1 6.880749667 6.893338165 6.957840755 6.96132077 7.029326071 7.063643173 1 1 1 1 1 1 7.076853715 7.103044063 7.108869455 7.146800419 7.17418729 7.180032959 1 1 1 1 1 1 7.236416811 7.306799498 7.318958382 7.378546348 7.390972776 7.409745044 1 1 1 1 1 1 7.426300295 7.459173032 7.487759971 7.519139156 7.563793659 7.574015078 1 1 1 1 1 1 7.574192311 7.578024871 7.58768173 7.602797991 7.638237843 7.651144739 1 1 1 1 1 1 7.68824991 7.707505325 7.721224146 7.73536791 7.758413303 7.802940799 1 1 1 1 1 1 7.842133748 7.847807539 7.874589695 7.892618711 7.9009076 7.938688526 1 1 1 1 1 1 7.964797287 7.974577282 7.999342006 7.999917525 8.026079271 8.056224367 1 1 1 1 1 1 8.069413272 8.106440399 8.125322358 8.135195652 8.142888189 8.197916647 1 1 1 1 1 1 8.222021054 8.265180043 8.271684172 8.319322646 8.349695235 8.36377134 1 1 1 1 1 1 8.37360559 8.397961363 8.403278993 8.421699808 8.467102597 8.47870365 1 1 1 1 1 1 8.496785646 8.501144563 8.518519841 8.565956678 8.56999965 8.60219909 1 1 1 1 1 1 8.603715999 8.61003914 8.62687593 8.714737001 8.736615767 8.755867959 1 1 1 1 1 1 8.778400117 8.848316977 8.87885956 8.914952706 8.926121079 8.957719792 1 1 1 1 1 1 8.975054776 8.978439511 8.984678574 9.016393296 9.132594366 9.145067587 1 1 1 1 1 1 9.149647335 9.182672595 9.186432211 9.209942901 9.279506726 9.289207521 1 1 1 1 1 1 9.328871037 9.341618368 9.397449595 9.40618075 9.486543572 9.527159314 1 1 1 1 1 1 9.529245621 9.560801211 9.563077345 9.569880124 9.587133128 9.614295652 1 1 1 1 1 1 9.679318421 9.698691631 9.772985659 9.775244027 9.776695742 9.808607433 1 1 1 1 1 1 9.821747177 9.855233575 9.935197653 10.0311123 10.06883484 10.07235364 1 1 1 1 1 1 10.07606028 10.09476408 10.10584472 10.14463063 10.15413531 10.20728 1 1 1 1 1 1 10.2136746 10.22914948 10.24242748 10.25164408 10.26724426 10.34948012 1 1 1 1 1 1 10.37183444 10.40347728 10.51801571 10.5354893 10.54250096 10.63038272 1 1 1 1 1 1 10.6951328 10.74542401 10.82700827 10.85738435 10.8946091 11.03580835 1 1 1 1 1 1 11.1151218 11.12666 11.12699818 11.16951753 11.2213685 11.22783085 1 1 1 1 1 1 11.32802697 11.34995915 11.40957458 11.41475143 11.4215223 11.43638143 1 1 1 1 1 1 11.4546639 11.46877923 11.47745609 11.56076809 11.56905439 11.58999818 1 1 1 1 1 1 11.65330293 11.66554386 11.75638145 11.76440465 11.8227682 11.92705655 1 1 1 1 1 1 11.94101943 12.0267748 12.04942679 12.06155683 12.11054859 12.1371174 1 1 1 1 1 1 12.17225385 12.26330769 12.30332295 12.33207023 12.39068876 12.40534992 1 1 1 1 1 1 12.41822391 12.46682205 12.49669274 12.52445885 12.56955602 12.64272724 1 1 1 1 1 1 12.66237472 12.67307076 12.8003486 12.9170792 12.97222545 13.03590275 1 1 1 1 1 1 13.08149075 13.08670337 13.0983455 13.1282448 13.16062883 13.28668541 1 1 1 1 1 1 13.30752755 13.33902363 13.43947043 13.46131645 13.57827708 13.6656118 1 1 1 1 1 1 13.88190107 13.992352 13.99982215 14.02033036 14.03975418 14.17578319 1 1 1 1 1 1 14.18747397 14.23285865 14.33315165 14.36453624 14.36702622 14.57693876 1 1 1 1 1 1 14.66423603 14.69243455 14.7857096 14.82679024 14.85888908 14.88946069 1 1 1 1 1 1 15.03129367 15.32854829 15.33138825 15.63464741 15.83496225 15.8594013 1 1 1 1 1 1 15.86733668 16.18648504 16.28669149 16.30422004 16.85785849 17.00478087 1 1 1 1 1 1 17.11374109 17.5027125 18.3589407 18.70484851 19.38078891 19.39770536 1 1 1 1 1 1 20.46769195 1 > colnames(x) [1] "time_in_rfc" "blogged_computations" "compendiums_reviewed" [4] "Forecast" > colnames(x)[par1] [1] "Forecast" > x[,par1] [1] 12.332070 9.279507 13.286685 8.610039 9.182673 10.076060 16.857858 [8] 7.874590 8.714737 11.477456 10.154135 14.858889 12.049427 11.221369 [15] 14.232859 12.642727 14.364536 11.560768 13.881901 7.426300 10.105845 [22] 11.756381 18.704849 11.035808 9.587133 7.842134 11.169518 13.035903 [29] 11.421522 9.855234 11.328027 11.927057 14.785710 13.999822 9.341618 [36] 14.692435 8.222021 13.461316 18.358941 4.039968 11.454664 8.403279 [43] 7.688250 13.992352 13.128245 11.822768 10.827008 10.745424 10.267244 [50] 12.496693 20.467692 9.821747 11.409575 14.175783 9.406181 10.229149 [57] 4.846550 19.380789 7.900908 8.373606 12.800349 14.333152 16.186485 [64] 9.016393 12.137117 11.941019 12.110549 14.664236 10.535489 13.439470 [71] 14.187474 14.367026 10.349480 9.527159 12.390689 8.265180 3.905806 [78] 12.569556 8.975055 14.020330 10.695133 7.707505 13.098346 12.917079 [85] 12.026775 7.180033 11.227831 8.736616 17.113741 12.303323 10.630383 [92] 5.077073 11.349959 9.209943 8.603716 17.502713 16.304220 6.105753 [99] 13.307528 7.974577 11.665544 11.653303 15.328548 10.542501 10.518016 [106] 9.569880 15.859401 8.125322 12.418224 13.578277 10.857384 12.466822 [113] 7.602798 8.570000 10.094764 9.775244 8.363771 13.160629 9.772986 [120] 7.651145 8.848317 6.384871 9.486544 6.703984 15.031294 7.103044 [127] 8.421700 7.378546 11.589998 4.041072 7.029326 7.758413 6.564190 [134] 8.878860 10.031112 14.826790 4.408103 12.673071 5.796177 5.028664 [141] 6.807442 8.319323 10.251644 12.972225 13.665612 8.602199 13.081491 [148] 10.068835 5.508780 12.524459 15.634647 14.889461 7.574015 15.834962 [155] 11.569054 17.004781 11.436381 8.496786 9.529246 14.576939 19.397705 [162] 11.126998 9.149647 16.286691 10.894609 11.764405 11.115122 13.086703 [169] 8.467103 15.331388 15.867337 9.328871 12.061557 12.662375 4.565615 [176] 10.144631 11.468779 8.926121 10.371834 8.914953 6.127083 5.736563 [183] 4.100352 13.339024 14.039754 3.511235 5.777572 4.688760 9.698692 [190] 10.213675 11.126660 9.808607 5.984709 9.563077 9.614296 7.108869 [197] 8.957720 7.563794 8.518520 6.961321 8.197917 8.478704 9.560801 [204] 9.776696 8.565957 8.026079 7.459173 12.405350 10.403477 9.679318 [211] 7.306799 9.289208 7.390973 7.587682 9.935198 9.145068 6.581450 [218] 7.578025 7.174187 9.132594 8.135196 10.072354 6.778895 7.892619 [225] 7.318958 8.755868 6.537533 6.677342 5.993324 8.056224 7.735368 [232] 6.893338 7.999918 7.409745 7.999342 6.209222 12.263308 6.779866 [239] 7.487760 6.696947 8.984679 11.414751 6.151508 6.660406 7.574192 [246] 8.106440 7.076854 9.186432 7.721224 4.890828 12.172254 8.501145 [253] 3.791877 10.242427 8.778400 5.167983 4.732098 8.349695 8.069413 [260] 5.749848 7.236417 6.742178 6.157515 5.721969 6.880750 6.957841 [267] 6.648550 6.137816 9.397450 7.847808 10.207280 7.938689 5.409210 [274] 7.638238 6.358378 6.816852 7.802941 4.186443 7.146800 8.978440 [281] 8.142888 8.626876 7.519139 5.622938 8.397961 7.964797 7.063643 [288] 6.820639 8.271684 > 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/150k01324378707.tab") + } + } > m Conditional inference tree with 20 terminal nodes Response: Forecast Inputs: time_in_rfc, blogged_computations, compendiums_reviewed Number of observations: 289 1) time_in_rfc <= 136084; criterion = 1, statistic = 224.282 2) compendiums_reviewed <= 10; criterion = 1, statistic = 78.908 3) time_in_rfc <= 34662; criterion = 1, statistic = 18.585 4)* weights = 13 3) time_in_rfc > 34662 5)* weights = 14 2) compendiums_reviewed > 10 6) time_in_rfc <= 81872; criterion = 1, statistic = 34.136 7) compendiums_reviewed <= 21; criterion = 1, statistic = 32.706 8) blogged_computations <= 35; criterion = 1, statistic = 15.062 9) compendiums_reviewed <= 15; criterion = 0.999, statistic = 14.022 10)* weights = 15 9) compendiums_reviewed > 15 11) time_in_rfc <= 63123; criterion = 0.956, statistic = 5.93 12)* weights = 14 11) time_in_rfc > 63123 13)* weights = 16 8) blogged_computations > 35 14)* weights = 9 7) compendiums_reviewed > 21 15)* weights = 9 6) time_in_rfc > 81872 16) blogged_computations <= 49; criterion = 1, statistic = 23.994 17) compendiums_reviewed <= 22; criterion = 1, statistic = 32.185 18) time_in_rfc <= 108043; criterion = 0.997, statistic = 11.096 19) blogged_computations <= 27; criterion = 1, statistic = 20.145 20)* weights = 15 19) blogged_computations > 27 21)* weights = 17 18) time_in_rfc > 108043 22)* weights = 14 17) compendiums_reviewed > 22 23)* weights = 14 16) blogged_computations > 49 24)* weights = 17 1) time_in_rfc > 136084 25) time_in_rfc <= 235800; criterion = 1, statistic = 65.93 26) blogged_computations <= 102; criterion = 1, statistic = 30.962 27) time_in_rfc <= 168809; criterion = 1, statistic = 14.221 28) blogged_computations <= 48; criterion = 1, statistic = 15.666 29)* weights = 10 28) blogged_computations > 48 30)* weights = 16 27) time_in_rfc > 168809 31) blogged_computations <= 71; criterion = 0.999, statistic = 12.399 32)* weights = 19 31) blogged_computations > 71 33)* weights = 21 26) blogged_computations > 102 34)* weights = 17 25) time_in_rfc > 235800 35) time_in_rfc <= 324799; criterion = 1, statistic = 18.018 36) blogged_computations <= 116; criterion = 0.987, statistic = 8.071 37)* weights = 22 36) blogged_computations > 116 38)* weights = 7 35) time_in_rfc > 324799 39)* weights = 10 > postscript(file="/var/wessaorg/rcomp/tmp/2qb8m1324378707.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/3wj171324378707.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 12.332070 11.868494 0.463576202 2 9.279507 7.682586 1.596921127 3 13.286685 13.480432 -0.193746716 4 8.610039 9.171851 -0.561812081 5 9.182673 9.431691 -0.249018276 6 10.076060 9.183704 0.892356733 7 16.857858 17.930780 -1.072921827 8 7.874590 7.352486 0.522103856 9 8.714737 9.242725 -0.527987748 10 11.477456 12.050128 -0.572671924 11 10.154135 10.479457 -0.325321974 12 14.858889 14.693844 0.165044640 13 12.049427 11.868494 0.180932762 14 11.221369 10.578487 0.642881721 15 14.232859 14.693844 -0.460985790 16 12.642727 13.480432 -0.837704886 17 14.364536 12.744206 1.620330111 18 11.560768 11.868494 -0.307725938 19 13.881901 14.693844 -0.811943370 20 7.426300 7.682586 -0.256285304 21 10.105845 9.171851 0.933993499 22 11.756381 11.868494 -0.112112578 23 18.704849 17.930780 0.774068193 24 11.035808 10.479457 0.556351066 25 9.587133 7.682586 1.904547529 26 7.842134 9.171851 -1.329717473 27 11.169518 11.868494 -0.698976498 28 13.035903 11.868494 1.167408722 29 11.421522 9.171851 2.249671079 30 9.855234 10.578487 -0.723253204 31 11.328027 9.171851 2.156175749 32 11.927057 11.868494 0.058562522 33 14.785710 13.480432 1.305277474 34 13.999822 14.693844 -0.694022290 35 9.341618 10.578487 -1.236868411 36 14.692435 14.693844 -0.001409890 37 8.222021 7.965490 0.256530777 38 13.461316 13.480432 -0.019115676 39 18.358941 17.930780 0.428160383 40 4.039968 4.417995 -0.378027147 41 11.454664 10.479457 0.975206616 42 8.403279 7.965490 0.437788716 43 7.688250 7.965490 -0.277240367 44 13.992352 14.693844 -0.701492440 45 13.128245 14.693844 -1.565599640 46 11.822768 10.479457 1.343310917 47 10.827008 13.480432 -2.653423856 48 10.745424 10.479457 0.265966727 49 10.267244 10.578487 -0.311242519 50 12.496693 10.578487 1.918205961 51 20.467692 17.930780 2.536911633 52 9.821747 9.183704 0.638043630 53 11.409575 11.868494 -0.458919448 54 14.175783 14.693844 -0.518061250 55 9.406181 10.479457 -1.073276533 56 10.229149 10.479457 -0.250307804 57 4.846550 4.417995 0.428555357 58 19.380789 17.930780 1.450008593 59 7.900908 8.032758 -0.131850312 60 8.373606 7.965490 0.408115313 61 12.800349 11.868494 0.931854572 62 14.333152 14.693844 -0.360692790 63 16.186485 17.930780 -1.744295277 64 9.016393 9.242725 -0.226331453 65 12.137117 11.868494 0.268623372 66 11.941019 12.744206 -0.803186699 67 12.110549 11.868494 0.242054562 68 14.664236 12.744206 1.920029901 69 10.535489 9.171851 1.363638079 70 13.439470 13.480432 -0.040961696 71 14.187474 13.480432 0.707041844 72 14.367026 13.480432 0.886594094 73 10.349480 11.868494 -1.519013908 74 9.527159 10.479457 -0.952297970 75 12.390689 11.868494 0.522194732 76 8.265180 9.171851 -0.906671178 77 3.905806 7.682586 -3.776779827 78 12.569556 11.868494 0.701061992 79 8.975055 9.183704 -0.208648771 80 14.020330 13.480432 0.539898234 81 10.695133 10.479457 0.215675516 82 7.707505 9.171851 -1.464345896 83 13.098346 14.693844 -1.595498940 84 12.917079 14.693844 -1.776765240 85 12.026775 11.868494 0.158280772 86 7.180033 7.682586 -0.502552640 87 11.227831 10.479457 0.748373566 88 8.736616 7.682586 1.054030168 89 17.113741 17.930780 -0.817039227 90 12.303323 12.050128 0.253194936 91 10.630383 11.868494 -1.238111308 92 5.077073 6.249023 -1.171949948 93 11.349959 10.578487 0.771472371 94 9.209943 7.682586 1.527357302 95 8.603716 9.431691 -0.827974872 96 17.502713 14.693844 2.808868060 97 16.304220 14.693844 1.610375600 98 6.105753 9.171851 -3.066097919 99 13.307528 13.480432 -0.172904576 100 7.974577 9.171851 -1.197273939 101 11.665544 12.050128 -0.384584154 102 11.653303 11.868494 -0.215191098 103 15.328548 14.693844 0.634703850 104 10.542501 10.479457 0.063043676 105 10.518016 11.868494 -1.350478318 106 9.569880 9.171851 0.398028903 107 15.859401 14.693844 1.165556860 108 8.125322 7.965490 0.159832081 109 12.418224 12.744206 -0.325982219 110 13.578277 11.868494 1.709783052 111 10.857384 9.171851 1.685533129 112 12.466822 12.050128 0.416694036 113 7.602798 7.352486 0.250312152 114 8.570000 10.479457 -1.909457634 115 10.094764 10.479457 -0.384693204 116 9.775244 9.171851 0.603392806 117 8.363771 9.171851 -0.808079881 118 13.160629 13.480432 -0.319803296 119 9.772986 10.578487 -0.805501120 120 7.651145 7.965490 -0.314345538 121 8.848317 7.682586 1.165731378 122 6.384871 6.878510 -0.493639439 123 9.486544 9.431691 0.054852701 124 6.703984 7.682586 -0.978601440 125 15.031294 13.480432 1.550861544 126 7.103044 6.249023 0.854020881 127 8.421700 7.965490 0.456209531 128 7.378546 7.682586 -0.304039251 129 11.589998 12.744206 -1.154207949 130 4.041072 4.417995 -0.376922720 131 7.029326 6.249023 0.780302889 132 7.758413 9.171851 -1.413437918 133 6.564190 6.878510 -0.314320130 134 8.878860 10.578487 -1.699627219 135 10.031112 7.682586 2.348526701 136 14.826790 14.693844 0.132945800 137 4.408103 4.417995 -0.009891476 138 12.673071 13.480432 -0.807361366 139 5.796177 6.878510 -1.082333389 140 5.028664 4.417995 0.610669326 141 6.807442 6.878510 -0.071068793 142 8.319323 7.682586 0.636737047 143 10.251644 9.242725 1.008919331 144 12.972225 14.693844 -1.721618990 145 13.665612 13.480432 0.185179674 146 8.602199 9.183704 -0.581504457 147 13.081491 10.578487 2.503003971 148 10.068835 10.578487 -0.509651939 149 5.508780 6.249023 -0.740242747 150 12.524459 12.050128 0.474330836 151 15.634647 14.693844 0.940802970 152 14.889461 13.480432 1.409028564 153 7.574015 7.965490 -0.391475199 154 15.834962 17.930780 -2.095818067 155 11.569054 12.744206 -1.175151739 156 17.004781 17.930780 -0.925999447 157 11.436381 10.479457 0.956924147 158 8.496786 9.242725 -0.745939103 159 9.529246 10.578487 -1.049241158 160 14.576939 13.480432 1.096506634 161 19.397705 17.930780 1.466925043 162 11.126998 10.578487 0.548511401 163 9.149647 9.431691 -0.282043536 164 16.286691 14.693844 1.592847050 165 10.894609 10.578487 0.316122321 166 11.764405 11.868494 -0.104089378 167 11.115122 10.479457 0.635664517 168 13.086703 12.050128 1.036575356 169 8.467103 7.682586 0.784516998 170 15.331388 14.693844 0.637543810 171 15.867337 14.693844 1.173492240 172 9.328871 9.171851 0.157019816 173 12.061557 13.480432 -1.418875296 174 12.662375 12.744206 -0.081831409 175 4.565615 7.682586 -3.116970886 176 10.144631 9.431691 0.712939759 177 11.468779 11.868494 -0.399714798 178 8.926121 9.242725 -0.316603670 179 10.371834 9.171851 1.199983219 180 8.914953 9.431691 -0.516738165 181 6.127083 6.249023 -0.121940653 182 5.736563 6.305189 -0.568626770 183 4.100352 4.417995 -0.317642898 184 13.339024 13.480432 -0.141408496 185 14.039754 14.693844 -0.654090260 186 3.511235 4.417995 -0.906759661 187 5.777572 6.249023 -0.471450811 188 4.688760 4.417995 0.270764956 189 9.698692 9.431691 0.267000760 190 10.213675 10.578487 -0.364812179 191 11.126660 12.050128 -0.923468014 192 9.808607 9.242725 0.565882684 193 5.984709 6.305189 -0.320480060 194 9.563077 9.183704 0.379373798 195 9.614296 10.479457 -0.865161632 196 7.108869 7.682586 -0.573716144 197 8.957720 8.032758 0.924961880 198 7.563794 6.878510 0.685283260 199 8.518520 7.965490 0.553029564 200 6.961321 6.878510 0.082810371 201 8.197917 8.032758 0.165158735 202 8.478704 9.183704 -0.704999897 203 9.560801 9.431691 0.129110340 204 9.776696 9.431691 0.345004871 205 8.565957 7.965490 0.600466401 206 8.026079 7.352486 0.673593432 207 7.459173 8.032758 -0.573584880 208 12.405350 13.480432 -1.075082206 209 10.403477 9.431691 0.971786409 210 9.679318 9.431691 0.247627550 211 7.306799 6.249023 1.057776316 212 9.289208 9.431691 -0.142483350 213 7.390973 7.352486 0.038486937 214 7.587682 8.032758 -0.445076182 215 9.935198 9.183704 0.751494106 216 9.145068 9.183704 -0.038635960 217 6.581450 6.878510 -0.297060639 218 7.578025 6.878510 0.699514472 219 7.174187 8.032758 -0.858570622 220 9.132594 8.032758 1.099836454 221 8.135196 8.032758 0.102437740 222 10.072354 9.242725 0.829628891 223 6.778895 7.682586 -0.903690874 224 7.892619 8.032758 -0.140139201 225 7.318958 7.352486 -0.033527457 226 8.755868 9.431691 -0.675822912 227 6.537533 6.249023 0.288509637 228 6.677342 7.352486 -0.675143750 229 5.993324 6.305189 -0.311865456 230 8.056224 9.183704 -1.127479180 231 7.735368 7.352486 0.382882071 232 6.893338 6.305189 0.588148887 233 7.999918 7.965490 0.034427248 234 7.409745 7.352486 0.057259205 235 7.999342 8.032758 -0.033415906 236 6.209222 6.305189 -0.095967472 237 12.263308 12.050128 0.213179676 238 6.779866 7.352486 -0.572619880 239 7.487760 8.032758 -0.544997941 240 6.696947 7.352486 -0.655539007 241 8.984679 9.242725 -0.258046175 242 11.414751 12.050128 -0.635376584 243 6.151508 7.352486 -1.200977412 244 6.660406 6.878510 -0.218104178 245 7.574192 6.878510 0.695681912 246 8.106440 7.965490 0.140950122 247 7.076854 7.682586 -0.605731884 248 9.186432 9.242725 -0.056292538 249 7.721224 6.249023 1.472200964 250 4.890828 4.417995 0.472833252 251 12.172254 12.050128 0.122125836 252 8.501145 7.965490 0.535654286 253 3.791877 4.417995 -0.626117739 254 10.242427 9.242725 0.999702731 255 8.778400 9.242725 -0.464324632 256 5.167983 4.417995 0.749987843 257 4.732098 4.417995 0.314103096 258 8.349695 9.242725 -0.893029514 259 8.069413 7.352486 0.716927433 260 5.749848 6.249023 -0.499175351 261 7.236417 7.352486 -0.116069028 262 6.742178 6.305189 0.436988479 263 6.157515 6.249023 -0.091507761 264 5.721969 6.305189 -0.583220616 265 6.880750 6.878510 0.002239268 266 6.957841 7.965490 -1.007649522 267 6.648550 6.305189 0.343360495 268 6.137816 6.878510 -0.740694315 269 9.397450 9.431691 -0.034241276 270 7.847808 8.032758 -0.184950373 271 10.207280 9.242725 0.964555251 272 7.938689 8.032758 -0.094069386 273 5.409210 6.249023 -0.839813373 274 7.638238 7.965490 -0.327252434 275 6.358378 6.249023 0.109354778 276 6.816852 6.305189 0.511662515 277 7.802941 6.878510 0.924430400 278 4.186443 4.417995 -0.231552189 279 7.146800 7.965490 -0.818689858 280 8.978440 9.242725 -0.264285238 281 8.142888 8.032758 0.110130277 282 8.626876 9.242725 -0.615848819 283 7.519139 7.965490 -0.446351121 284 5.622938 6.249023 -0.626084820 285 8.397961 8.032758 0.365203451 286 7.964797 7.352486 0.612311448 287 7.063643 6.878510 0.185132774 288 6.820639 6.878510 -0.057871571 289 8.271684 8.032758 0.238926260 > 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/4akn61324378707.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/5djo41324378707.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/6nxd41324378707.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/7jx3i1324378707.tab") + } > > try(system("convert tmp/2qb8m1324378707.ps tmp/2qb8m1324378707.png",intern=TRUE)) character(0) > try(system("convert tmp/3wj171324378707.ps tmp/3wj171324378707.png",intern=TRUE)) character(0) > try(system("convert tmp/4akn61324378707.ps tmp/4akn61324378707.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.979 0.284 6.257