R version 2.12.0 (2010-10-15) Copyright (C) 2010 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 = '2' > par2 = 'quantiles' > 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,100350) [100350,279488] 82 82 > 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] [100350,279488] [100350,279488] [100350,279488] [100350,279488] [5] [ 0,100350) [ 0,100350) [100350,279488] [ 0,100350) [9] [100350,279488] [ 0,100350) [ 0,100350) [ 0,100350) [13] [ 0,100350) [100350,279488] [ 0,100350) [100350,279488] [17] [100350,279488] [100350,279488] [100350,279488] [100350,279488] [21] [100350,279488] [100350,279488] [ 0,100350) [100350,279488] [25] [ 0,100350) [100350,279488] [100350,279488] [ 0,100350) [29] [ 0,100350) [100350,279488] [100350,279488] [ 0,100350) [33] [100350,279488] [ 0,100350) [100350,279488] [ 0,100350) [37] [100350,279488] [ 0,100350) [ 0,100350) [100350,279488] [41] [ 0,100350) [ 0,100350) [ 0,100350) [ 0,100350) [45] [ 0,100350) [100350,279488] [ 0,100350) [ 0,100350) [49] [100350,279488] [ 0,100350) [ 0,100350) [ 0,100350) [53] [100350,279488] [ 0,100350) [ 0,100350) [ 0,100350) [57] [100350,279488] [100350,279488] [100350,279488] [ 0,100350) [61] [100350,279488] [100350,279488] [ 0,100350) [100350,279488] [65] [100350,279488] [ 0,100350) [100350,279488] [ 0,100350) [69] [100350,279488] [100350,279488] [ 0,100350) [ 0,100350) [73] [ 0,100350) [ 0,100350) [ 0,100350) [100350,279488] [77] [100350,279488] [100350,279488] [ 0,100350) [ 0,100350) [81] [ 0,100350) [100350,279488] [ 0,100350) [100350,279488] [85] [ 0,100350) [ 0,100350) [100350,279488] [100350,279488] [89] [ 0,100350) [100350,279488] [ 0,100350) [100350,279488] [93] [ 0,100350) [ 0,100350) [100350,279488] [100350,279488] [97] [100350,279488] [100350,279488] [100350,279488] [100350,279488] [101] [100350,279488] [100350,279488] [ 0,100350) [ 0,100350) [105] [ 0,100350) [100350,279488] [ 0,100350) [100350,279488] [109] [100350,279488] [100350,279488] [100350,279488] [100350,279488] [113] [ 0,100350) [ 0,100350) [ 0,100350) [ 0,100350) [117] [100350,279488] [ 0,100350) [100350,279488] [ 0,100350) [121] [ 0,100350) [100350,279488] [100350,279488] [100350,279488] [125] [ 0,100350) [100350,279488] [100350,279488] [100350,279488] [129] [100350,279488] [100350,279488] [100350,279488] [ 0,100350) [133] [ 0,100350) [100350,279488] [100350,279488] [100350,279488] [137] [100350,279488] [ 0,100350) [ 0,100350) [ 0,100350) [141] [100350,279488] [100350,279488] [100350,279488] [ 0,100350) [145] [100350,279488] [100350,279488] [100350,279488] [100350,279488] [149] [ 0,100350) [ 0,100350) [ 0,100350) [ 0,100350) [153] [ 0,100350) [ 0,100350) [ 0,100350) [ 0,100350) [157] [ 0,100350) [ 0,100350) [ 0,100350) [ 0,100350) [161] [ 0,100350) [ 0,100350) [ 0,100350) [100350,279488] Levels: [ 0,100350) [100350,279488] > if (par2 == 'none') { + m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x) + } > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/15d3y1324308974.tab") + } + } > m Conditional inference tree with 4 terminal nodes Response: as.factor(number_characters) Inputs: logins, blogged_computations, reviewed_compendiums, long_feedback_messages, shared_compendiums Number of observations: 164 1) blogged_computations <= 130; criterion = 1, statistic = 50.328 2) long_feedback_messages <= 115; criterion = 1, statistic = 28.013 3) logins <= 49; criterion = 0.991, statistic = 9.7 4)* weights = 32 3) logins > 49 5)* weights = 35 2) long_feedback_messages > 115 6)* weights = 68 1) blogged_computations > 130 7)* weights = 29 > postscript(file="/var/www/rcomp/tmp/2e3ta1324308974.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/www/rcomp/tmp/3m6my1324308974.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) + } > if (par2 != 'none') { + print(cbind(as.factor(x[,par1]),predict(m))) + myt <- table(as.factor(x[,par1]),predict(m)) + print(myt) + } [,1] [,2] [1,] 2 2 [2,] 2 2 [3,] 2 1 [4,] 2 2 [5,] 1 1 [6,] 1 1 [7,] 2 2 [8,] 1 1 [9,] 2 2 [10,] 1 1 [11,] 1 2 [12,] 1 2 [13,] 1 1 [14,] 2 2 [15,] 1 1 [16,] 2 2 [17,] 2 2 [18,] 2 1 [19,] 2 1 [20,] 2 2 [21,] 2 2 [22,] 2 2 [23,] 1 1 [24,] 2 2 [25,] 1 2 [26,] 2 2 [27,] 2 2 [28,] 1 2 [29,] 1 1 [30,] 2 2 [31,] 2 2 [32,] 1 2 [33,] 2 2 [34,] 1 2 [35,] 2 2 [36,] 1 2 [37,] 2 2 [38,] 1 1 [39,] 1 1 [40,] 2 2 [41,] 1 2 [42,] 1 1 [43,] 1 1 [44,] 1 2 [45,] 1 1 [46,] 2 2 [47,] 1 1 [48,] 1 2 [49,] 2 2 [50,] 1 2 [51,] 1 2 [52,] 1 1 [53,] 2 2 [54,] 1 1 [55,] 1 1 [56,] 1 2 [57,] 2 2 [58,] 2 2 [59,] 2 2 [60,] 1 2 [61,] 2 2 [62,] 2 2 [63,] 1 1 [64,] 2 2 [65,] 2 2 [66,] 1 1 [67,] 2 2 [68,] 1 2 [69,] 2 2 [70,] 2 2 [71,] 1 2 [72,] 1 1 [73,] 1 2 [74,] 1 1 [75,] 1 2 [76,] 2 2 [77,] 2 2 [78,] 2 2 [79,] 1 2 [80,] 1 1 [81,] 1 1 [82,] 2 2 [83,] 1 1 [84,] 2 1 [85,] 1 1 [86,] 1 1 [87,] 2 2 [88,] 2 2 [89,] 1 2 [90,] 2 2 [91,] 1 1 [92,] 2 2 [93,] 1 1 [94,] 1 2 [95,] 2 2 [96,] 2 2 [97,] 2 2 [98,] 2 2 [99,] 2 2 [100,] 2 2 [101,] 2 2 [102,] 2 2 [103,] 1 1 [104,] 1 1 [105,] 1 1 [106,] 2 1 [107,] 1 2 [108,] 2 2 [109,] 2 1 [110,] 2 2 [111,] 2 2 [112,] 2 2 [113,] 1 1 [114,] 1 1 [115,] 1 1 [116,] 1 2 [117,] 2 2 [118,] 1 1 [119,] 2 1 [120,] 1 1 [121,] 1 2 [122,] 2 2 [123,] 2 2 [124,] 2 1 [125,] 1 1 [126,] 2 2 [127,] 2 2 [128,] 2 2 [129,] 2 2 [130,] 2 2 [131,] 2 2 [132,] 1 2 [133,] 1 1 [134,] 2 2 [135,] 2 2 [136,] 2 2 [137,] 2 2 [138,] 1 1 [139,] 1 2 [140,] 1 1 [141,] 2 1 [142,] 2 2 [143,] 2 1 [144,] 1 1 [145,] 2 2 [146,] 2 2 [147,] 2 2 [148,] 2 2 [149,] 1 1 [150,] 1 1 [151,] 1 1 [152,] 1 1 [153,] 1 1 [154,] 1 1 [155,] 1 1 [156,] 1 1 [157,] 1 1 [158,] 1 1 [159,] 1 1 [160,] 1 1 [161,] 1 1 [162,] 1 1 [163,] 1 1 [164,] 2 1 [ 0,100350) [100350,279488] [ 0,100350) 56 26 [100350,279488] 11 71 > postscript(file="/var/www/rcomp/tmp/4g46u1324308974.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/www/rcomp/tmp/5ncvn1324308974.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/www/rcomp/tmp/6xyne1324308974.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/www/rcomp/tmp/7kstm1324308974.tab") + } > > try(system("convert tmp/2e3ta1324308974.ps tmp/2e3ta1324308974.png",intern=TRUE)) character(0) > try(system("convert tmp/3m6my1324308974.ps tmp/3m6my1324308974.png",intern=TRUE)) character(0) > try(system("convert tmp/4g46u1324308974.ps tmp/4g46u1324308974.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.920 0.130 2.123