R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(112285 + ,3 + ,24188 + ,146283 + ,84786 + ,4 + ,18273 + ,98364 + ,83123 + ,12 + ,14130 + ,86146 + ,101193 + ,2 + ,32287 + ,96933 + ,38361 + ,1 + ,8654 + ,79234 + ,68504 + ,3 + ,9245 + ,42551 + ,119182 + ,0 + ,33251 + ,195663 + ,22807 + ,0 + ,1271 + ,6853 + ,17140 + ,0 + ,5279 + ,21529 + ,116174 + ,5 + ,27101 + ,95757 + ,57635 + ,0 + ,16373 + ,85584 + ,66198 + ,0 + ,19716 + ,143983 + ,71701 + ,7 + ,17753 + ,75851 + ,57793 + ,7 + ,9028 + ,59238 + ,80444 + ,3 + ,18653 + ,93163 + ,53855 + ,9 + ,8828 + ,96037 + ,97668 + ,0 + ,29498 + ,151511 + ,133824 + ,4 + ,27563 + ,136368 + ,101481 + ,3 + ,18293 + ,112642 + ,99645 + ,0 + ,22530 + ,94728 + ,114789 + ,7 + ,15977 + ,105499 + ,99052 + ,0 + ,35082 + ,121527 + ,67654 + ,1 + ,16116 + ,127766 + ,65553 + ,5 + ,15849 + ,98958 + ,97500 + ,7 + ,16026 + ,77900 + ,69112 + ,0 + ,26569 + ,85646 + ,82753 + ,0 + ,24785 + ,98579 + ,85323 + ,5 + ,17569 + ,130767 + ,72654 + ,0 + ,23825 + ,131741 + ,30727 + ,0 + ,7869 + ,53907 + ,77873 + ,0 + ,14975 + ,178812 + ,117478 + ,3 + ,37791 + ,146761 + ,74007 + ,4 + ,9605 + ,82036 + ,90183 + ,1 + ,27295 + ,163253 + ,61542 + ,4 + ,2746 + ,27032 + ,101494 + ,2 + ,34461 + ,171975 + ,27570 + ,0 + ,8098 + ,65990 + ,55813 + ,0 + ,4787 + ,86572 + ,79215 + ,0 + ,24919 + ,159676 + ,1423 + ,0 + ,603 + ,1929 + ,55461 + ,2 + ,16329 + ,85371 + ,31081 + ,1 + ,12558 + ,58391 + ,22996 + ,0 + ,7784 + ,31580 + ,83122 + ,2 + ,28522 + ,136815 + ,70106 + ,10 + ,22265 + ,120642 + ,60578 + ,6 + ,14459 + ,69107 + ,39992 + ,0 + ,14526 + ,50495 + ,79892 + ,5 + ,22240 + ,108016 + ,49810 + ,4 + ,11802 + ,46341 + ,71570 + ,1 + ,7623 + ,78348 + ,100708 + ,2 + ,11912 + ,79336 + ,33032 + ,2 + ,7935 + ,56968 + ,82875 + ,0 + ,18220 + ,93176 + ,139077 + ,8 + ,19199 + ,161632 + ,71595 + ,3 + ,19918 + ,87850 + ,72260 + ,0 + ,21884 + ,127969 + ,5950 + ,0 + ,2694 + ,15049 + ,115762 + ,8 + ,15808 + ,155135 + ,32551 + ,5 + ,3597 + ,25109 + ,31701 + ,3 + ,5296 + ,45824 + ,80670 + ,1 + ,25239 + ,102996 + ,143558 + ,5 + ,29801 + ,160604 + ,117105 + ,1 + ,18450 + ,158051 + ,23789 + ,1 + ,7132 + ,44547 + ,120733 + ,5 + ,34861 + ,162647 + ,105195 + ,0 + ,35940 + ,174141 + ,73107 + ,12 + ,16688 + ,60622 + ,132068 + ,8 + ,24683 + ,179566 + ,149193 + ,8 + ,46230 + ,184301 + ,46821 + ,8 + ,10387 + ,75661 + ,87011 + ,8 + ,21436 + ,96144 + ,95260 + ,2 + ,30546 + ,129847 + ,55183 + ,0 + ,19746 + ,117286 + ,106671 + ,5 + ,15977 + ,71180 + ,73511 + ,8 + ,22583 + ,109377 + ,92945 + ,2 + ,17274 + ,85298 + ,78664 + ,5 + ,16469 + ,73631 + ,70054 + ,12 + ,14251 + ,86767 + ,22618 + ,6 + ,3007 + ,23824 + ,74011 + ,7 + ,16851 + ,93487 + ,83737 + ,2 + ,21113 + ,82981 + ,69094 + ,0 + ,17401 + ,73815 + ,93133 + ,4 + ,23958 + ,94552 + ,95536 + ,3 + ,23567 + ,132190 + ,225920 + ,6 + ,13065 + ,128754 + ,62133 + ,2 + ,15358 + ,66363 + ,61370 + ,0 + ,14587 + ,67808 + ,43836 + ,1 + ,12770 + ,61724 + ,106117 + ,0 + ,24021 + ,131722 + ,38692 + ,5 + ,9648 + ,68580 + ,84651 + ,2 + ,20537 + ,106175 + ,56622 + ,0 + ,7905 + ,55792 + ,15986 + ,0 + ,4527 + ,25157 + ,95364 + ,5 + ,30495 + ,76669 + ,26706 + ,0 + ,7117 + ,57283 + ,89691 + ,1 + ,17719 + ,105805 + ,67267 + ,0 + ,27056 + ,129484 + ,126846 + ,1 + ,33473 + ,72413 + ,41140 + ,1 + ,9758 + ,87831 + ,102860 + ,2 + ,21115 + ,96971 + ,51715 + ,6 + ,7236 + ,71299 + ,55801 + ,1 + ,13790 + ,77494 + ,111813 + ,4 + ,32902 + ,120336 + ,120293 + ,2 + ,25131 + ,93913 + ,138599 + ,3 + ,30910 + ,136048 + ,161647 + ,0 + ,35947 + ,181248 + ,115929 + ,10 + ,29848 + ,146123 + ,24266 + ,0 + ,6943 + ,32036 + ,162901 + ,9 + ,42705 + ,186646 + ,109825 + ,7 + ,31808 + ,102255 + ,129838 + ,0 + ,26675 + ,168237 + ,37510 + ,0 + ,8435 + ,64219 + ,43750 + ,4 + ,7409 + ,19630 + ,40652 + ,4 + ,14993 + ,76825 + ,87771 + ,0 + ,36867 + ,115338 + ,85872 + ,0 + ,33835 + ,109427 + ,89275 + ,0 + ,24164 + ,118168 + ,44418 + ,1 + ,12607 + ,84845 + ,192565 + ,0 + ,22609 + ,153197 + ,35232 + ,1 + ,5892 + ,29877 + ,40909 + ,0 + ,17014 + ,63506 + ,13294 + ,0 + ,5394 + ,22445 + ,32387 + ,4 + ,9178 + ,47695 + ,140867 + ,0 + ,6440 + ,68370 + ,120662 + ,4 + ,21916 + ,146304 + ,21233 + ,4 + ,4011 + ,38233 + ,44332 + ,3 + ,5818 + ,42071 + ,61056 + ,0 + ,18647 + ,50517 + ,101338 + ,0 + ,20556 + ,103950 + ,1168 + ,0 + ,238 + ,5841 + ,13497 + ,5 + ,70 + ,2341 + ,65567 + ,0 + ,22392 + ,84396 + ,25162 + ,4 + ,3913 + ,24610 + ,32334 + ,0 + ,12237 + ,35753 + ,40735 + ,0 + ,8388 + ,55515 + ,91413 + ,1 + ,22120 + ,209056 + ,855 + ,0 + ,338 + ,6622 + ,97068 + ,5 + ,11727 + ,115814 + ,44339 + ,0 + ,3704 + ,11609 + ,14116 + ,0 + ,3988 + ,13155 + ,10288 + ,0 + ,3030 + ,18274 + ,65622 + ,0 + ,13520 + ,72875 + ,16563 + ,0 + ,1421 + ,10112 + ,76643 + ,2 + ,20923 + ,142775 + ,110681 + ,7 + ,20237 + ,68847 + ,29011 + ,1 + ,3219 + ,17659 + ,92696 + ,8 + ,3769 + ,20112 + ,94785 + ,2 + ,12252 + ,61023 + ,8773 + ,0 + ,1888 + ,13983 + ,83209 + ,2 + ,14497 + ,65176 + ,93815 + ,0 + ,28864 + ,132432 + ,86687 + ,0 + ,21721 + ,112494 + ,34553 + ,1 + ,4821 + ,45109 + ,105547 + ,3 + ,33644 + ,170875 + ,103487 + ,0 + ,15923 + ,180759 + ,213688 + ,3 + ,42935 + ,214921 + ,71220 + ,0 + ,18864 + ,100226 + ,23517 + ,0 + ,4977 + ,32043 + ,56926 + ,0 + ,7785 + ,54454 + ,91721 + ,4 + ,17939 + ,78876 + ,115168 + ,4 + ,23436 + ,170745 + ,111194 + ,11 + ,325 + ,6940 + ,51009 + ,0 + ,13539 + ,49025 + ,135777 + ,0 + ,34538 + ,122037 + ,51513 + ,4 + ,12198 + ,53782 + ,74163 + ,0 + ,26924 + ,127748 + ,51633 + ,1 + ,12716 + ,86839 + ,75345 + ,0 + ,8172 + ,44830 + ,33416 + ,0 + ,10855 + ,77395 + ,83305 + ,0 + ,11932 + ,89324 + ,98952 + ,9 + ,14300 + ,103300 + ,102372 + ,1 + ,25515 + ,112283 + ,37238 + ,3 + ,2805 + ,10901 + ,103772 + ,10 + ,29402 + ,120691 + ,123969 + ,5 + ,16440 + ,58106 + ,27142 + ,0 + ,11221 + ,57140 + ,135400 + ,2 + ,28732 + ,122422 + ,21399 + ,0 + ,5250 + ,25899 + ,130115 + ,1 + ,28608 + ,139296 + ,24874 + ,2 + ,8092 + ,52678 + ,34988 + ,4 + ,4473 + ,23853 + ,45549 + ,0 + ,1572 + ,17306 + ,6023 + ,0 + ,2065 + ,7953 + ,64466 + ,2 + ,14817 + ,89455 + ,54990 + ,1 + ,16714 + ,147866 + ,1644 + ,0 + ,556 + ,4245 + ,6179 + ,0 + ,2089 + ,21509 + ,3926 + ,0 + ,2658 + ,7670 + ,32755 + ,1 + ,10695 + ,66675 + ,34777 + ,0 + ,1669 + ,14336 + ,73224 + ,2 + ,16267 + ,53608 + ,27114 + ,0 + ,7768 + ,30059 + ,20760 + ,3 + ,7252 + ,29668 + ,37636 + ,6 + ,6387 + ,22097 + ,65461 + ,0 + ,18715 + ,96841 + ,30080 + ,2 + ,7936 + ,41907 + ,24094 + ,0 + ,8643 + ,27080) + ,dim=c(4 + ,197) + ,dimnames=list(c('totsize' + ,'shared_compendiums' + ,'totrevisions' + ,'totseconds ') + ,1:197)) > y <- array(NA,dim=c(4,197),dimnames=list(c('totsize','shared_compendiums','totrevisions','totseconds '),1:197)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par4 = 'no' > par3 = '' > par2 = 'none' > par1 = '1' > library(party) Loading required package: survival Loading required package: splines Loading required package: grid Loading required package: modeltools Loading required package: stats4 Loading required package: coin Loading required package: mvtnorm Loading required package: zoo Loading required package: sandwich Loading required package: strucchange Loading required package: vcd Loading required package: MASS Loading required package: colorspace > library(Hmisc) Attaching package: 'Hmisc' The following object(s) are masked from 'package:survival': untangle.specials The following object(s) are masked from 'package:base': format.pval, round.POSIXt, trunc.POSIXt, units > par1 <- as.numeric(par1) > par3 <- as.numeric(par3) > x <- data.frame(t(y)) > is.data.frame(x) [1] TRUE > x <- x[!is.na(x[,par1]),] > k <- length(x[1,]) > n <- length(x[,1]) > colnames(x)[par1] [1] "totsize" > x[,par1] [1] 112285 84786 83123 101193 38361 68504 119182 22807 17140 116174 [11] 57635 66198 71701 57793 80444 53855 97668 133824 101481 99645 [21] 114789 99052 67654 65553 97500 69112 82753 85323 72654 30727 [31] 77873 117478 74007 90183 61542 101494 27570 55813 79215 1423 [41] 55461 31081 22996 83122 70106 60578 39992 79892 49810 71570 [51] 100708 33032 82875 139077 71595 72260 5950 115762 32551 31701 [61] 80670 143558 117105 23789 120733 105195 73107 132068 149193 46821 [71] 87011 95260 55183 106671 73511 92945 78664 70054 22618 74011 [81] 83737 69094 93133 95536 225920 62133 61370 43836 106117 38692 [91] 84651 56622 15986 95364 26706 89691 67267 126846 41140 102860 [101] 51715 55801 111813 120293 138599 161647 115929 24266 162901 109825 [111] 129838 37510 43750 40652 87771 85872 89275 44418 192565 35232 [121] 40909 13294 32387 140867 120662 21233 44332 61056 101338 1168 [131] 13497 65567 25162 32334 40735 91413 855 97068 44339 14116 [141] 10288 65622 16563 76643 110681 29011 92696 94785 8773 83209 [151] 93815 86687 34553 105547 103487 213688 71220 23517 56926 91721 [161] 115168 111194 51009 135777 51513 74163 51633 75345 33416 83305 [171] 98952 102372 37238 103772 123969 27142 135400 21399 130115 24874 [181] 34988 45549 6023 64466 54990 1644 6179 3926 32755 34777 [191] 73224 27114 20760 37636 65461 30080 24094 > if (par2 == 'kmeans') { + cl <- kmeans(x[,par1], par3) + print(cl) + clm <- matrix(cbind(cl$centers,1:par3),ncol=2) + clm <- clm[sort.list(clm[,1]),] + for (i in 1:par3) { + cl$cluster[cl$cluster==clm[i,2]] <- paste('C',i,sep='') + } + cl$cluster <- as.factor(cl$cluster) + print(cl$cluster) + x[,par1] <- cl$cluster + } > if (par2 == 'quantiles') { + x[,par1] <- cut2(x[,par1],g=par3) + } > if (par2 == 'hclust') { + hc <- hclust(dist(x[,par1])^2, 'cen') + print(hc) + memb <- cutree(hc, k = par3) + dum <- c(mean(x[memb==1,par1])) + for (i in 2:par3) { + dum <- c(dum, mean(x[memb==i,par1])) + } + hcm <- matrix(cbind(dum,1:par3),ncol=2) + hcm <- hcm[sort.list(hcm[,1]),] + for (i in 1:par3) { + memb[memb==hcm[i,2]] <- paste('C',i,sep='') + } + memb <- as.factor(memb) + print(memb) + x[,par1] <- memb + } > if (par2=='equal') { + ed <- cut(as.numeric(x[,par1]),par3,labels=paste('C',1:par3,sep='')) + x[,par1] <- as.factor(ed) + } > table(x[,par1]) 855 1168 1423 1644 3926 5950 6023 6179 8773 10288 13294 1 1 1 1 1 1 1 1 1 1 1 13497 14116 15986 16563 17140 20760 21233 21399 22618 22807 22996 1 1 1 1 1 1 1 1 1 1 1 23517 23789 24094 24266 24874 25162 26706 27114 27142 27570 29011 1 1 1 1 1 1 1 1 1 1 1 30080 30727 31081 31701 32334 32387 32551 32755 33032 33416 34553 1 1 1 1 1 1 1 1 1 1 1 34777 34988 35232 37238 37510 37636 38361 38692 39992 40652 40735 1 1 1 1 1 1 1 1 1 1 1 40909 41140 43750 43836 44332 44339 44418 45549 46821 49810 51009 1 1 1 1 1 1 1 1 1 1 1 51513 51633 51715 53855 54990 55183 55461 55801 55813 56622 56926 1 1 1 1 1 1 1 1 1 1 1 57635 57793 60578 61056 61370 61542 62133 64466 65461 65553 65567 1 1 1 1 1 1 1 1 1 1 1 65622 66198 67267 67654 68504 69094 69112 70054 70106 71220 71570 1 1 1 1 1 1 1 1 1 1 1 71595 71701 72260 72654 73107 73224 73511 74007 74011 74163 75345 1 1 1 1 1 1 1 1 1 1 1 76643 77873 78664 79215 79892 80444 80670 82753 82875 83122 83123 1 1 1 1 1 1 1 1 1 1 1 83209 83305 83737 84651 84786 85323 85872 86687 87011 87771 89275 1 1 1 1 1 1 1 1 1 1 1 89691 90183 91413 91721 92696 92945 93133 93815 94785 95260 95364 1 1 1 1 1 1 1 1 1 1 1 95536 97068 97500 97668 98952 99052 99645 100708 101193 101338 101481 1 1 1 1 1 1 1 1 1 1 1 101494 102372 102860 103487 103772 105195 105547 106117 106671 109825 110681 1 1 1 1 1 1 1 1 1 1 1 111194 111813 112285 114789 115168 115762 115929 116174 117105 117478 119182 1 1 1 1 1 1 1 1 1 1 1 120293 120662 120733 123969 126846 129838 130115 132068 133824 135400 135777 1 1 1 1 1 1 1 1 1 1 1 138599 139077 140867 143558 149193 161647 162901 192565 213688 225920 1 1 1 1 1 1 1 1 1 1 > colnames(x) [1] "totsize" "shared_compendiums" "totrevisions" [4] "totseconds." > colnames(x)[par1] [1] "totsize" > x[,par1] [1] 112285 84786 83123 101193 38361 68504 119182 22807 17140 116174 [11] 57635 66198 71701 57793 80444 53855 97668 133824 101481 99645 [21] 114789 99052 67654 65553 97500 69112 82753 85323 72654 30727 [31] 77873 117478 74007 90183 61542 101494 27570 55813 79215 1423 [41] 55461 31081 22996 83122 70106 60578 39992 79892 49810 71570 [51] 100708 33032 82875 139077 71595 72260 5950 115762 32551 31701 [61] 80670 143558 117105 23789 120733 105195 73107 132068 149193 46821 [71] 87011 95260 55183 106671 73511 92945 78664 70054 22618 74011 [81] 83737 69094 93133 95536 225920 62133 61370 43836 106117 38692 [91] 84651 56622 15986 95364 26706 89691 67267 126846 41140 102860 [101] 51715 55801 111813 120293 138599 161647 115929 24266 162901 109825 [111] 129838 37510 43750 40652 87771 85872 89275 44418 192565 35232 [121] 40909 13294 32387 140867 120662 21233 44332 61056 101338 1168 [131] 13497 65567 25162 32334 40735 91413 855 97068 44339 14116 [141] 10288 65622 16563 76643 110681 29011 92696 94785 8773 83209 [151] 93815 86687 34553 105547 103487 213688 71220 23517 56926 91721 [161] 115168 111194 51009 135777 51513 74163 51633 75345 33416 83305 [171] 98952 102372 37238 103772 123969 27142 135400 21399 130115 24874 [181] 34988 45549 6023 64466 54990 1644 6179 3926 32755 34777 [191] 73224 27114 20760 37636 65461 30080 24094 > 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/16rx01324646491.tab") + } + } > m Conditional inference tree with 10 terminal nodes Response: totsize Inputs: shared_compendiums, totrevisions, totseconds. Number of observations: 197 1) totseconds. <= 67808; criterion = 1, statistic = 117.009 2) totrevisions <= 12237; criterion = 1, statistic = 22.137 3) shared_compendiums <= 2; criterion = 1, statistic = 21.516 4) totseconds. <= 27080; criterion = 1, statistic = 15.571 5)* weights = 22 4) totseconds. > 27080 6)* weights = 21 3) shared_compendiums > 2 7) shared_compendiums <= 4; criterion = 0.987, statistic = 8.157 8)* weights = 13 7) shared_compendiums > 4 9)* weights = 7 2) totrevisions > 12237 10)* weights = 13 1) totseconds. > 67808 11) totseconds. <= 120642; criterion = 1, statistic = 36.127 12) totrevisions <= 15849; criterion = 1, statistic = 17.335 13)* weights = 25 12) totrevisions > 15849 14) totrevisions <= 26569; criterion = 0.972, statistic = 6.758 15)* weights = 39 14) totrevisions > 26569 16)* weights = 8 11) totseconds. > 120642 17) shared_compendiums <= 2; criterion = 0.967, statistic = 6.464 18)* weights = 29 17) shared_compendiums > 2 19)* weights = 20 > postscript(file="/var/wessaorg/rcomp/tmp/2dm481324646491.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/3xweo1324646491.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,par1] ~ as.factor(where(m)),main='Response by Terminal Node',xlab='Terminal Node',ylab='Response') > dev.off() null device 1 > if (par2 == 'none') { + forec <- predict(m) + result <- as.data.frame(cbind(x[,par1],forec,x[,par1]-forec)) + colnames(result) <- c('Actuals','Forecasts','Residuals') + print(result) + } Actuals Forecasts Residuals 1 112285 132351.15 -20066.15000 2 84786 84518.51 267.48718 3 83123 65127.60 17995.40000 4 101193 104357.25 -3164.25000 5 38361 65127.60 -26766.60000 6 68504 40224.62 28279.38462 7 119182 99908.69 19273.31034 8 22807 15695.64 7111.36364 9 17140 15695.64 1444.36364 10 116174 104357.25 11816.75000 11 57635 84518.51 -26883.51282 12 66198 99908.69 -33710.68966 13 71701 84518.51 -12817.51282 14 57793 52569.29 5223.71429 15 80444 84518.51 -4074.51282 16 53855 65127.60 -11272.60000 17 97668 99908.69 -2240.68966 18 133824 132351.15 1472.85000 19 101481 84518.51 16962.48718 20 99645 84518.51 15126.48718 21 114789 84518.51 30270.48718 22 99052 99908.69 -856.68966 23 67654 99908.69 -32254.68966 24 65553 65127.60 425.40000 25 97500 84518.51 12981.48718 26 69112 84518.51 -15406.51282 27 82753 84518.51 -1765.51282 28 85323 132351.15 -47028.15000 29 72654 99908.69 -27254.68966 30 30727 34467.86 -3740.85714 31 77873 99908.69 -22035.68966 32 117478 132351.15 -14873.15000 33 74007 65127.60 8879.40000 34 90183 99908.69 -9725.68966 35 61542 40224.62 21317.38462 36 101494 99908.69 1585.31034 37 27570 34467.86 -6897.85714 38 55813 65127.60 -9314.60000 39 79215 99908.69 -20693.68966 40 1423 15695.64 -14272.63636 41 55461 84518.51 -29057.51282 42 31081 64590.77 -33509.76923 43 22996 34467.86 -11471.85714 44 83122 99908.69 -16786.68966 45 70106 84518.51 -14412.51282 46 60578 65127.60 -4549.60000 47 39992 64590.77 -24598.76923 48 79892 84518.51 -4626.51282 49 49810 40224.62 9585.38462 50 71570 65127.60 6442.40000 51 100708 65127.60 35580.40000 52 33032 34467.86 -1435.85714 53 82875 84518.51 -1643.51282 54 139077 132351.15 6725.85000 55 71595 84518.51 -12923.51282 56 72260 99908.69 -27648.68966 57 5950 15695.64 -9745.63636 58 115762 132351.15 -16589.15000 59 32551 52569.29 -20018.28571 60 31701 40224.62 -8523.61538 61 80670 84518.51 -3848.51282 62 143558 132351.15 11206.85000 63 117105 99908.69 17196.31034 64 23789 34467.86 -10678.85714 65 120733 132351.15 -11618.15000 66 105195 99908.69 5286.31034 67 73107 64590.77 8516.23077 68 132068 132351.15 -283.15000 69 149193 132351.15 16841.85000 70 46821 65127.60 -18306.60000 71 87011 84518.51 2492.48718 72 95260 99908.69 -4648.68966 73 55183 84518.51 -29335.51282 74 106671 84518.51 22152.48718 75 73511 84518.51 -11007.51282 76 92945 84518.51 8426.48718 77 78664 84518.51 -5854.51282 78 70054 65127.60 4926.40000 79 22618 52569.29 -29951.28571 80 74011 84518.51 -10507.51282 81 83737 84518.51 -781.51282 82 69094 84518.51 -15424.51282 83 93133 84518.51 8614.48718 84 95536 132351.15 -36815.15000 85 225920 132351.15 93568.85000 86 62133 64590.77 -2457.76923 87 61370 64590.77 -3220.76923 88 43836 64590.77 -20754.76923 89 106117 99908.69 6208.31034 90 38692 65127.60 -26435.60000 91 84651 84518.51 132.48718 92 56622 34467.86 22154.14286 93 15986 15695.64 290.36364 94 95364 104357.25 -8993.25000 95 26706 34467.86 -7761.85714 96 89691 84518.51 5172.48718 97 67267 99908.69 -32641.68966 98 126846 104357.25 22488.75000 99 41140 65127.60 -23987.60000 100 102860 84518.51 18341.48718 101 51715 65127.60 -13412.60000 102 55801 65127.60 -9326.60000 103 111813 104357.25 7455.75000 104 120293 84518.51 35774.48718 105 138599 132351.15 6247.85000 106 161647 99908.69 61738.31034 107 115929 132351.15 -16422.15000 108 24266 34467.86 -10201.85714 109 162901 132351.15 30549.85000 110 109825 104357.25 5467.75000 111 129838 99908.69 29929.31034 112 37510 34467.86 3042.14286 113 43750 40224.62 3525.38462 114 40652 65127.60 -24475.60000 115 87771 104357.25 -16586.25000 116 85872 104357.25 -18485.25000 117 89275 84518.51 4756.48718 118 44418 65127.60 -20709.60000 119 192565 99908.69 92656.31034 120 35232 34467.86 764.14286 121 40909 64590.77 -23681.76923 122 13294 15695.64 -2401.63636 123 32387 40224.62 -7837.61538 124 140867 65127.60 75739.40000 125 120662 132351.15 -11689.15000 126 21233 40224.62 -18991.61538 127 44332 40224.62 4107.38462 128 61056 64590.77 -3534.76923 129 101338 84518.51 16819.48718 130 1168 15695.64 -14527.63636 131 13497 52569.29 -39072.28571 132 65567 84518.51 -18951.51282 133 25162 40224.62 -15062.61538 134 32334 34467.86 -2133.85714 135 40735 34467.86 6267.14286 136 91413 99908.69 -8495.68966 137 855 15695.64 -14840.63636 138 97068 65127.60 31940.40000 139 44339 15695.64 28643.36364 140 14116 15695.64 -1579.63636 141 10288 15695.64 -5407.63636 142 65622 65127.60 494.40000 143 16563 15695.64 867.36364 144 76643 99908.69 -23265.68966 145 110681 84518.51 26162.48718 146 29011 15695.64 13315.36364 147 92696 52569.29 40126.71429 148 94785 64590.77 30194.23077 149 8773 15695.64 -6922.63636 150 83209 64590.77 18618.23077 151 93815 99908.69 -6093.68966 152 86687 84518.51 2168.48718 153 34553 34467.86 85.14286 154 105547 132351.15 -26804.15000 155 103487 99908.69 3578.31034 156 213688 132351.15 81336.85000 157 71220 84518.51 -13298.51282 158 23517 34467.86 -10950.85714 159 56926 34467.86 22458.14286 160 91721 84518.51 7202.48718 161 115168 132351.15 -17183.15000 162 111194 52569.29 58624.71429 163 51009 64590.77 -13581.76923 164 135777 99908.69 35868.31034 165 51513 40224.62 11288.38462 166 74163 99908.69 -25745.68966 167 51633 65127.60 -13494.60000 168 75345 34467.86 40877.14286 169 33416 65127.60 -31711.60000 170 83305 65127.60 18177.40000 171 98952 65127.60 33824.40000 172 102372 84518.51 17853.48718 173 37238 40224.62 -2986.61538 174 103772 132351.15 -28579.15000 175 123969 64590.77 59378.23077 176 27142 34467.86 -7325.85714 177 135400 99908.69 35491.31034 178 21399 15695.64 5703.36364 179 130115 99908.69 30206.31034 180 24874 34467.86 -9593.85714 181 34988 40224.62 -5236.61538 182 45549 15695.64 29853.36364 183 6023 15695.64 -9672.63636 184 64466 65127.60 -661.60000 185 54990 99908.69 -44918.68966 186 1644 15695.64 -14051.63636 187 6179 15695.64 -9516.63636 188 3926 15695.64 -11769.63636 189 32755 34467.86 -1712.85714 190 34777 15695.64 19081.36364 191 73224 64590.77 8633.23077 192 27114 34467.86 -7353.85714 193 20760 40224.62 -19464.61538 194 37636 52569.29 -14933.28571 195 65461 84518.51 -19057.51282 196 30080 34467.86 -4387.85714 197 24094 15695.64 8398.36364 > 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/4ujup1324646491.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/5xnvt1324646491.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/6jidy1324646491.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/78ppj1324646491.tab") + } > > try(system("convert tmp/2dm481324646491.ps tmp/2dm481324646491.png",intern=TRUE)) character(0) > try(system("convert tmp/3xweo1324646491.ps tmp/3xweo1324646491.png",intern=TRUE)) character(0) > try(system("convert tmp/4ujup1324646491.ps tmp/4ujup1324646491.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.950 0.400 4.349