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(67 + ,96 + ,38 + ,116 + ,3 + ,140824 + ,63 + ,67 + ,34 + ,127 + ,4 + ,110459 + ,69 + ,70 + ,42 + ,106 + ,16 + ,105079 + ,103 + ,134 + ,38 + ,133 + ,2 + ,112098 + ,49 + ,59 + ,27 + ,64 + ,1 + ,43929 + ,28 + ,8 + ,35 + ,89 + ,3 + ,76173 + ,113 + ,145 + ,33 + ,122 + ,0 + ,187326 + ,19 + ,1 + ,18 + ,22 + ,0 + ,22807 + ,57 + ,71 + ,34 + ,117 + ,7 + ,144408 + ,43 + ,82 + ,33 + ,82 + ,0 + ,66485 + ,102 + ,92 + ,42 + ,136 + ,0 + ,79089 + ,110 + ,106 + ,55 + ,184 + ,7 + ,81625 + ,65 + ,50 + ,35 + ,106 + ,7 + ,68788 + ,74 + ,113 + ,51 + ,159 + ,4 + ,103297 + ,79 + ,70 + ,42 + ,86 + ,10 + ,69446 + ,174 + ,168 + ,59 + ,199 + ,0 + ,114948 + ,66 + ,111 + ,36 + ,139 + ,4 + ,167949 + ,154 + ,96 + ,39 + ,92 + ,4 + ,125081 + ,52 + ,102 + ,29 + ,85 + ,3 + ,125818 + ,82 + ,135 + ,46 + ,174 + ,8 + ,136588 + ,68 + ,122 + ,45 + ,148 + ,0 + ,112431 + ,102 + ,86 + ,39 + ,144 + ,1 + ,103037 + ,39 + ,50 + ,25 + ,84 + ,5 + ,82317 + ,54 + ,97 + ,52 + ,208 + ,9 + ,118906 + ,110 + ,127 + ,41 + ,144 + ,0 + ,83515 + ,112 + ,86 + ,38 + ,139 + ,0 + ,104581 + ,126 + ,99 + ,41 + ,127 + ,5 + ,103129 + ,84 + ,117 + ,39 + ,136 + ,0 + ,83243 + ,51 + ,57 + ,32 + ,99 + ,0 + ,37110 + ,63 + ,125 + ,41 + ,135 + ,0 + ,113344 + ,73 + ,120 + ,45 + ,165 + ,3 + ,139165 + ,72 + ,44 + ,46 + ,135 + ,5 + ,86652 + ,83 + ,133 + ,48 + ,178 + ,1 + ,112302 + ,35 + ,43 + ,37 + ,137 + ,4 + ,69652 + ,90 + ,117 + ,39 + ,148 + ,3 + ,119442 + ,56 + ,83 + ,42 + ,127 + ,0 + ,69867 + ,118 + ,105 + ,41 + ,141 + ,0 + ,101629 + ,79 + ,79 + ,36 + ,89 + ,2 + ,70168 + ,32 + ,33 + ,17 + ,46 + ,1 + ,31081 + ,180 + ,116 + ,39 + ,143 + ,2 + ,103925 + ,78 + ,121 + ,37 + ,116 + ,10 + ,92622 + ,62 + ,67 + ,38 + ,103 + ,8 + ,79011 + ,72 + ,73 + ,36 + ,108 + ,5 + ,93487 + ,56 + ,68 + ,42 + ,126 + ,6 + ,64520 + ,82 + ,50 + ,45 + ,45 + ,1 + ,93473 + ,146 + ,101 + ,38 + ,122 + ,2 + ,114360 + ,42 + ,20 + ,26 + ,66 + ,2 + ,33032 + ,75 + ,101 + ,52 + ,180 + ,0 + ,96125 + ,113 + ,137 + ,47 + ,165 + ,10 + ,151911 + ,54 + ,99 + ,45 + ,146 + ,3 + ,89256 + ,72 + ,94 + ,40 + ,137 + ,0 + ,95671 + ,24 + ,8 + ,4 + ,7 + ,0 + ,5950 + ,303 + ,85 + ,44 + ,157 + ,8 + ,149695 + ,17 + ,21 + ,18 + ,61 + ,5 + ,32551 + ,64 + ,30 + ,14 + ,41 + ,3 + ,31701 + ,56 + ,96 + ,37 + ,120 + ,1 + ,100087 + ,82 + ,122 + ,56 + ,208 + ,5 + ,169707 + ,171 + ,115 + ,36 + ,127 + ,5 + ,150491 + ,131 + ,139 + ,41 + ,147 + ,0 + ,120192 + ,82 + ,89 + ,36 + ,127 + ,12 + ,95893 + ,136 + ,147 + ,46 + ,161 + ,10 + ,151715 + ,113 + ,135 + ,28 + ,73 + ,12 + ,176225 + ,102 + ,77 + ,42 + ,94 + ,10 + ,59900 + ,86 + ,72 + ,38 + ,129 + ,8 + ,104767 + ,64 + ,47 + ,37 + ,125 + ,2 + ,114799 + ,65 + ,96 + ,30 + ,87 + ,0 + ,72128 + ,125 + ,79 + ,35 + ,128 + ,6 + ,143592 + ,139 + ,85 + ,44 + ,148 + ,9 + ,89626 + ,77 + ,135 + ,36 + ,116 + ,2 + ,131072 + ,66 + ,143 + ,28 + ,89 + ,5 + ,126817 + ,67 + ,99 + ,45 + ,154 + ,13 + ,81351 + ,32 + ,22 + ,23 + ,67 + ,6 + ,22618 + ,80 + ,78 + ,45 + ,171 + ,7 + ,88977 + ,52 + ,77 + ,38 + ,90 + ,2 + ,92059 + ,59 + ,110 + ,38 + ,133 + ,1 + ,81897 + ,76 + ,132 + ,42 + ,137 + ,4 + ,108146 + ,89 + ,112 + ,36 + ,133 + ,3 + ,126372 + ,106 + ,78 + ,41 + ,125 + ,6 + ,249771 + ,60 + ,126 + ,38 + ,134 + ,2 + ,71154 + ,60 + ,73 + ,37 + ,110 + ,0 + ,71571 + ,46 + ,62 + ,28 + ,89 + ,1 + ,55918 + ,111 + ,143 + ,45 + ,138 + ,0 + ,160141 + ,68 + ,30 + ,26 + ,99 + ,5 + ,38692 + ,103 + ,117 + ,44 + ,92 + ,2 + ,102812 + ,25 + ,49 + ,8 + ,27 + ,0 + ,56622 + ,53 + ,26 + ,27 + ,77 + ,0 + ,15986 + ,53 + ,71 + ,35 + ,127 + ,5 + ,123534 + ,175 + ,59 + ,37 + ,137 + ,1 + ,108535 + ,110 + ,114 + ,57 + ,122 + ,0 + ,93879 + ,102 + ,161 + ,41 + ,143 + ,1 + ,144551 + ,88 + ,74 + ,37 + ,85 + ,1 + ,56750 + ,73 + ,151 + ,38 + ,131 + ,3 + ,127654 + ,61 + ,41 + ,31 + ,90 + ,6 + ,65594 + ,72 + ,121 + ,36 + ,135 + ,1 + ,59938 + ,76 + ,66 + ,36 + ,132 + ,4 + ,146975 + ,36 + ,83 + ,36 + ,139 + ,3 + ,143372 + ,50 + ,94 + ,35 + ,127 + ,5 + ,168553 + ,74 + ,154 + ,39 + ,104 + ,0 + ,183500 + ,144 + ,151 + ,58 + ,221 + ,12 + ,165986 + ,105 + ,164 + ,30 + ,106 + ,13 + ,184923 + ,121 + ,116 + ,45 + ,153 + ,8 + ,140358 + ,62 + ,140 + ,41 + ,130 + ,0 + ,149959 + ,175 + ,73 + ,36 + ,59 + ,0 + ,57224 + ,14 + ,13 + ,19 + ,64 + ,4 + ,43750 + ,79 + ,89 + ,23 + ,36 + ,4 + ,48029 + ,130 + ,90 + ,40 + ,88 + ,0 + ,104978 + ,46 + ,128 + ,40 + ,125 + ,0 + ,100046 + ,87 + ,169 + ,40 + ,124 + ,0 + ,101047 + ,64 + ,28 + ,30 + ,83 + ,0 + ,197426 + ,86 + ,116 + ,41 + ,127 + ,0 + ,160902 + ,67 + ,76 + ,40 + ,143 + ,4 + ,147172 + ,85 + ,145 + ,45 + ,115 + ,0 + ,109432 + ,11 + ,12 + ,1 + ,0 + ,0 + ,1168 + ,70 + ,120 + ,36 + ,94 + ,0 + ,83248 + ,25 + ,23 + ,11 + ,30 + ,4 + ,25162 + ,48 + ,83 + ,45 + ,119 + ,0 + ,45724 + ,114 + ,131 + ,38 + ,102 + ,1 + ,110529 + ,16 + ,4 + ,0 + ,0 + ,0 + ,855 + ,52 + ,81 + ,30 + ,77 + ,5 + ,101382 + ,22 + ,18 + ,8 + ,9 + ,0 + ,14116 + ,110 + ,103 + ,39 + ,137 + ,3 + ,89506 + ,63 + ,76 + ,44 + ,150 + ,7 + ,135356 + ,83 + ,55 + ,44 + ,137 + ,13 + ,116066 + ,51 + ,43 + ,29 + ,84 + ,3 + ,144244 + ,34 + ,16 + ,8 + ,21 + ,0 + ,8773 + ,39 + ,66 + ,39 + ,139 + ,2 + ,102153 + ,80 + ,137 + ,47 + ,168 + ,0 + ,117440 + ,57 + ,50 + ,48 + ,155 + ,0 + ,104128 + ,77 + ,134 + ,46 + ,161 + ,4 + ,134238 + ,96 + ,152 + ,48 + ,145 + ,0 + ,134047 + ,121 + ,137 + ,50 + ,175 + ,3 + ,279488 + ,35 + ,71 + ,40 + ,137 + ,0 + ,79756 + ,42 + ,42 + ,36 + ,100 + ,0 + ,66089 + ,319 + ,84 + ,40 + ,150 + ,4 + ,102070 + ,164 + ,103 + ,46 + ,163 + ,4 + ,146760 + ,50 + ,55 + ,39 + ,137 + ,15 + ,154771 + ,127 + ,127 + ,42 + ,149 + ,0 + ,165933 + ,76 + ,55 + ,39 + ,112 + ,4 + ,64593 + ,46 + ,104 + ,41 + ,135 + ,1 + ,92280 + ,87 + ,95 + ,42 + ,114 + ,1 + ,67150 + ,111 + ,35 + ,32 + ,45 + ,0 + ,128692 + ,115 + ,95 + ,39 + ,120 + ,9 + ,124089 + ,83 + ,121 + ,35 + ,111 + ,1 + ,125386 + ,63 + ,41 + ,21 + ,78 + ,3 + ,37238 + ,98 + ,143 + ,45 + ,136 + ,11 + ,140015 + ,57 + ,147 + ,50 + ,179 + ,5 + ,150047 + ,81 + ,97 + ,36 + ,118 + ,2 + ,154451 + ,100 + ,170 + ,44 + ,147 + ,1 + ,156349 + ,0 + ,0 + ,0 + ,0 + ,9 + ,0 + ,10 + ,4 + ,0 + ,0 + ,0 + ,6023 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,82 + ,61 + ,37 + ,88 + ,2 + ,84601 + ,139 + ,130 + ,47 + ,115 + ,3 + ,68946 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,0 + ,0 + ,0 + ,0 + ,5 + ,7 + ,0 + ,0 + ,0 + ,1644 + ,20 + ,12 + ,5 + ,13 + ,0 + ,6179 + ,5 + ,0 + ,1 + ,4 + ,0 + ,3926 + ,42 + ,37 + ,43 + ,76 + ,0 + ,52789 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,63 + ,48 + ,31 + ,63 + ,2 + ,100350) + ,dim=c(6 + ,164) + ,dimnames=list(c('logins' + ,'blogged_computations' + ,'reviewed_compendiums' + ,'long_feedback_messages' + ,'shared_compendiums' + ,'number_characters') + ,1:164)) > y <- array(NA,dim=c(6,164),dimnames=list(c('logins','blogged_computations','reviewed_compendiums','long_feedback_messages','shared_compendiums','number_characters'),1:164)) > 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 = '6' > 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] "number_characters" > x[,par1] [1] 140824 110459 105079 112098 43929 76173 187326 22807 144408 66485 [11] 79089 81625 68788 103297 69446 114948 167949 125081 125818 136588 [21] 112431 103037 82317 118906 83515 104581 103129 83243 37110 113344 [31] 139165 86652 112302 69652 119442 69867 101629 70168 31081 103925 [41] 92622 79011 93487 64520 93473 114360 33032 96125 151911 89256 [51] 95671 5950 149695 32551 31701 100087 169707 150491 120192 95893 [61] 151715 176225 59900 104767 114799 72128 143592 89626 131072 126817 [71] 81351 22618 88977 92059 81897 108146 126372 249771 71154 71571 [81] 55918 160141 38692 102812 56622 15986 123534 108535 93879 144551 [91] 56750 127654 65594 59938 146975 143372 168553 183500 165986 184923 [101] 140358 149959 57224 43750 48029 104978 100046 101047 197426 160902 [111] 147172 109432 1168 83248 25162 45724 110529 855 101382 14116 [121] 89506 135356 116066 144244 8773 102153 117440 104128 134238 134047 [131] 279488 79756 66089 102070 146760 154771 165933 64593 92280 67150 [141] 128692 124089 125386 37238 140015 150047 154451 156349 0 6023 [151] 0 0 0 0 84601 68946 0 0 1644 6179 [161] 3926 52789 0 100350 > 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 855 1168 1644 3926 5950 6023 6179 8773 14116 15986 8 1 1 1 1 1 1 1 1 1 1 22618 22807 25162 31081 31701 32551 33032 37110 37238 38692 43750 1 1 1 1 1 1 1 1 1 1 1 43929 45724 48029 52789 55918 56622 56750 57224 59900 59938 64520 1 1 1 1 1 1 1 1 1 1 1 64593 65594 66089 66485 67150 68788 68946 69446 69652 69867 70168 1 1 1 1 1 1 1 1 1 1 1 71154 71571 72128 76173 79011 79089 79756 81351 81625 81897 82317 1 1 1 1 1 1 1 1 1 1 1 83243 83248 83515 84601 86652 88977 89256 89506 89626 92059 92280 1 1 1 1 1 1 1 1 1 1 1 92622 93473 93487 93879 95671 95893 96125 100046 100087 100350 101047 1 1 1 1 1 1 1 1 1 1 1 101382 101629 102070 102153 102812 103037 103129 103297 103925 104128 104581 1 1 1 1 1 1 1 1 1 1 1 104767 104978 105079 108146 108535 109432 110459 110529 112098 112302 112431 1 1 1 1 1 1 1 1 1 1 1 113344 114360 114799 114948 116066 117440 118906 119442 120192 123534 124089 1 1 1 1 1 1 1 1 1 1 1 125081 125386 125818 126372 126817 127654 128692 131072 134047 134238 135356 1 1 1 1 1 1 1 1 1 1 1 136588 139165 140015 140358 140824 143372 143592 144244 144408 144551 146760 1 1 1 1 1 1 1 1 1 1 1 146975 147172 149695 149959 150047 150491 151715 151911 154451 154771 156349 1 1 1 1 1 1 1 1 1 1 1 160141 160902 165933 165986 167949 168553 169707 176225 183500 184923 187326 1 1 1 1 1 1 1 1 1 1 1 197426 249771 279488 1 1 1 > colnames(x) [1] "logins" "blogged_computations" "reviewed_compendiums" [4] "long_feedback_messages" "shared_compendiums" "number_characters" > colnames(x)[par1] [1] "number_characters" > x[,par1] [1] 140824 110459 105079 112098 43929 76173 187326 22807 144408 66485 [11] 79089 81625 68788 103297 69446 114948 167949 125081 125818 136588 [21] 112431 103037 82317 118906 83515 104581 103129 83243 37110 113344 [31] 139165 86652 112302 69652 119442 69867 101629 70168 31081 103925 [41] 92622 79011 93487 64520 93473 114360 33032 96125 151911 89256 [51] 95671 5950 149695 32551 31701 100087 169707 150491 120192 95893 [61] 151715 176225 59900 104767 114799 72128 143592 89626 131072 126817 [71] 81351 22618 88977 92059 81897 108146 126372 249771 71154 71571 [81] 55918 160141 38692 102812 56622 15986 123534 108535 93879 144551 [91] 56750 127654 65594 59938 146975 143372 168553 183500 165986 184923 [101] 140358 149959 57224 43750 48029 104978 100046 101047 197426 160902 [111] 147172 109432 1168 83248 25162 45724 110529 855 101382 14116 [121] 89506 135356 116066 144244 8773 102153 117440 104128 134238 134047 [131] 279488 79756 66089 102070 146760 154771 165933 64593 92280 67150 [141] 128692 124089 125386 37238 140015 150047 154451 156349 0 6023 [151] 0 0 0 0 84601 68946 0 0 1644 6179 [161] 3926 52789 0 100350 > 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/1vlua1324312085.tab") + } + } > m Conditional inference tree with 6 terminal nodes Response: number_characters Inputs: logins, blogged_computations, reviewed_compendiums, long_feedback_messages, shared_compendiums Number of observations: 164 1) long_feedback_messages <= 67; criterion = 1, statistic = 81.987 2) reviewed_compendiums <= 18; criterion = 1, statistic = 22.953 3) blogged_computations <= 12; criterion = 1, statistic = 17.908 4)* weights = 16 3) blogged_computations > 12 5)* weights = 7 2) reviewed_compendiums > 18 6)* weights = 9 1) long_feedback_messages > 67 7) blogged_computations <= 134; criterion = 1, statistic = 25.976 8) long_feedback_messages <= 115; criterion = 0.999, statistic = 13.177 9)* weights = 36 8) long_feedback_messages > 115 10)* weights = 72 7) blogged_computations > 134 11)* weights = 24 > postscript(file="/var/wessaorg/rcomp/tmp/2yqyt1324312085.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/3zb9f1324312085.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 140824 113666.57 27157.43056 2 110459 113666.57 -3207.56944 3 105079 81638.11 23440.88889 4 112098 113666.57 -1568.56944 5 43929 63455.22 -19526.22222 6 76173 81638.11 -5465.11111 7 187326 150057.21 37268.79167 8 22807 3034.50 19772.50000 9 144408 113666.57 30741.43056 10 66485 81638.11 -15153.11111 11 79089 113666.57 -34577.56944 12 81625 113666.57 -32041.56944 13 68788 81638.11 -12850.11111 14 103297 113666.57 -10369.56944 15 69446 81638.11 -12192.11111 16 114948 150057.21 -35109.20833 17 167949 113666.57 54282.43056 18 125081 81638.11 43442.88889 19 125818 81638.11 44179.88889 20 136588 150057.21 -13469.20833 21 112431 113666.57 -1235.56944 22 103037 113666.57 -10629.56944 23 82317 81638.11 678.88889 24 118906 113666.57 5239.43056 25 83515 113666.57 -30151.56944 26 104581 113666.57 -9085.56944 27 103129 113666.57 -10537.56944 28 83243 113666.57 -30423.56944 29 37110 81638.11 -44528.11111 30 113344 113666.57 -322.56944 31 139165 113666.57 25498.43056 32 86652 113666.57 -27014.56944 33 112302 113666.57 -1364.56944 34 69652 113666.57 -44014.56944 35 119442 113666.57 5775.43056 36 69867 113666.57 -43799.56944 37 101629 113666.57 -12037.56944 38 70168 81638.11 -11470.11111 39 31081 28572.29 2508.71429 40 103925 113666.57 -9741.56944 41 92622 113666.57 -21044.56944 42 79011 81638.11 -2627.11111 43 93487 81638.11 11848.88889 44 64520 113666.57 -49146.56944 45 93473 63455.22 30017.77778 46 114360 113666.57 693.43056 47 33032 63455.22 -30423.22222 48 96125 113666.57 -17541.56944 49 151911 150057.21 1853.79167 50 89256 113666.57 -24410.56944 51 95671 113666.57 -17995.56944 52 5950 3034.50 2915.50000 53 149695 113666.57 36028.43056 54 32551 28572.29 3978.71429 55 31701 28572.29 3128.71429 56 100087 113666.57 -13579.56944 57 169707 113666.57 56040.43056 58 150491 113666.57 36824.43056 59 120192 150057.21 -29865.20833 60 95893 113666.57 -17773.56944 61 151715 150057.21 1657.79167 62 176225 150057.21 26167.79167 63 59900 81638.11 -21738.11111 64 104767 113666.57 -8899.56944 65 114799 113666.57 1132.43056 66 72128 81638.11 -9510.11111 67 143592 113666.57 29925.43056 68 89626 113666.57 -24040.56944 69 131072 150057.21 -18985.20833 70 126817 150057.21 -23240.20833 71 81351 113666.57 -32315.56944 72 22618 63455.22 -40837.22222 73 88977 113666.57 -24689.56944 74 92059 81638.11 10420.88889 75 81897 113666.57 -31769.56944 76 108146 113666.57 -5520.56944 77 126372 113666.57 12705.43056 78 249771 113666.57 136104.43056 79 71154 113666.57 -42512.56944 80 71571 81638.11 -10067.11111 81 55918 81638.11 -25720.11111 82 160141 150057.21 10083.79167 83 38692 81638.11 -42946.11111 84 102812 81638.11 21173.88889 85 56622 28572.29 28049.71429 86 15986 81638.11 -65652.11111 87 123534 113666.57 9867.43056 88 108535 113666.57 -5131.56944 89 93879 113666.57 -19787.56944 90 144551 150057.21 -5506.20833 91 56750 81638.11 -24888.11111 92 127654 150057.21 -22403.20833 93 65594 81638.11 -16044.11111 94 59938 113666.57 -53728.56944 95 146975 113666.57 33308.43056 96 143372 113666.57 29705.43056 97 168553 113666.57 54886.43056 98 183500 150057.21 33442.79167 99 165986 150057.21 15928.79167 100 184923 150057.21 34865.79167 101 140358 113666.57 26691.43056 102 149959 150057.21 -98.20833 103 57224 63455.22 -6231.22222 104 43750 63455.22 -19705.22222 105 48029 63455.22 -15426.22222 106 104978 81638.11 23339.88889 107 100046 113666.57 -13620.56944 108 101047 150057.21 -49010.20833 109 197426 81638.11 115787.88889 110 160902 113666.57 47235.43056 111 147172 113666.57 33505.43056 112 109432 150057.21 -40625.20833 113 1168 3034.50 -1866.50000 114 83248 81638.11 1609.88889 115 25162 28572.29 -3410.28571 116 45724 113666.57 -67942.56944 117 110529 81638.11 28890.88889 118 855 3034.50 -2179.50000 119 101382 81638.11 19743.88889 120 14116 28572.29 -14456.28571 121 89506 113666.57 -24160.56944 122 135356 113666.57 21689.43056 123 116066 113666.57 2399.43056 124 144244 81638.11 62605.88889 125 8773 28572.29 -19799.28571 126 102153 113666.57 -11513.56944 127 117440 150057.21 -32617.20833 128 104128 113666.57 -9538.56944 129 134238 113666.57 20571.43056 130 134047 150057.21 -16010.20833 131 279488 150057.21 129430.79167 132 79756 113666.57 -33910.56944 133 66089 81638.11 -15549.11111 134 102070 113666.57 -11596.56944 135 146760 113666.57 33093.43056 136 154771 113666.57 41104.43056 137 165933 113666.57 52266.43056 138 64593 81638.11 -17045.11111 139 92280 113666.57 -21386.56944 140 67150 81638.11 -14488.11111 141 128692 63455.22 65236.77778 142 124089 113666.57 10422.43056 143 125386 81638.11 43747.88889 144 37238 81638.11 -44400.11111 145 140015 150057.21 -10042.20833 146 150047 150057.21 -10.20833 147 154451 113666.57 40784.43056 148 156349 150057.21 6291.79167 149 0 3034.50 -3034.50000 150 6023 3034.50 2988.50000 151 0 3034.50 -3034.50000 152 0 3034.50 -3034.50000 153 0 3034.50 -3034.50000 154 0 3034.50 -3034.50000 155 84601 81638.11 2962.88889 156 68946 81638.11 -12692.11111 157 0 3034.50 -3034.50000 158 0 3034.50 -3034.50000 159 1644 3034.50 -1390.50000 160 6179 3034.50 3144.50000 161 3926 3034.50 891.50000 162 52789 81638.11 -28849.11111 163 0 3034.50 -3034.50000 164 100350 63455.22 36894.77778 > 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/4xzm71324312085.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/5dfr71324312085.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/6dl8p1324312085.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/73qnm1324312085.tab") + } > > try(system("convert tmp/2yqyt1324312085.ps tmp/2yqyt1324312085.png",intern=TRUE)) character(0) > try(system("convert tmp/3zb9f1324312085.ps tmp/3zb9f1324312085.png",intern=TRUE)) character(0) > try(system("convert tmp/4xzm71324312085.ps tmp/4xzm71324312085.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.500 0.264 3.763