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(140824 + ,186099 + ,38 + ,165 + ,110459 + ,113854 + ,34 + ,135 + ,105079 + ,99776 + ,42 + ,121 + ,112098 + ,106194 + ,38 + ,148 + ,43929 + ,100792 + ,27 + ,73 + ,76173 + ,47552 + ,35 + ,49 + ,187326 + ,250931 + ,33 + ,185 + ,22807 + ,6853 + ,18 + ,5 + ,144408 + ,115466 + ,34 + ,125 + ,66485 + ,110896 + ,33 + ,93 + ,79089 + ,169351 + ,46 + ,154 + ,81625 + ,94853 + ,55 + ,98 + ,68788 + ,72591 + ,37 + ,70 + ,103297 + ,101345 + ,55 + ,148 + ,69446 + ,113713 + ,44 + ,100 + ,114948 + ,165354 + ,59 + ,150 + ,167949 + ,164263 + ,36 + ,197 + ,125081 + ,135213 + ,39 + ,114 + ,125818 + ,111669 + ,29 + ,169 + ,136588 + ,134163 + ,51 + ,200 + ,112431 + ,140303 + ,49 + ,148 + ,103037 + ,150773 + ,39 + ,140 + ,82317 + ,111848 + ,25 + ,74 + ,118906 + ,102509 + ,52 + ,128 + ,83515 + ,96785 + ,45 + ,140 + ,104581 + ,116136 + ,38 + ,116 + ,103129 + ,158376 + ,41 + ,147 + ,83243 + ,153990 + ,43 + ,132 + ,37110 + ,64057 + ,32 + ,70 + ,113344 + ,230054 + ,41 + ,144 + ,139165 + ,184531 + ,47 + ,155 + ,86652 + ,114198 + ,50 + ,165 + ,112302 + ,198299 + ,48 + ,161 + ,69652 + ,33750 + ,37 + ,31 + ,119442 + ,189723 + ,43 + ,199 + ,69867 + ,100826 + ,42 + ,78 + ,101629 + ,188355 + ,44 + ,121 + ,70168 + ,104470 + ,36 + ,112 + ,31081 + ,58391 + ,17 + ,41 + ,103925 + ,164808 + ,42 + ,158 + ,92622 + ,134097 + ,39 + ,123 + ,79011 + ,80238 + ,41 + ,104 + ,93487 + ,133252 + ,36 + ,94 + ,64520 + ,54518 + ,47 + ,73 + ,93473 + ,121850 + ,45 + ,52 + ,114360 + ,79367 + ,41 + ,71 + ,33032 + ,56968 + ,26 + ,21 + ,96125 + ,106314 + ,52 + ,155 + ,151911 + ,191889 + ,47 + ,174 + ,89256 + ,104864 + ,45 + ,136 + ,95671 + ,160791 + ,40 + ,128 + ,5950 + ,15049 + ,4 + ,7 + ,149695 + ,191179 + ,44 + ,165 + ,32551 + ,25109 + ,18 + ,21 + ,31701 + ,45824 + ,14 + ,35 + ,100087 + ,129711 + ,37 + ,137 + ,169707 + ,210012 + ,61 + ,174 + ,150491 + ,194679 + ,39 + ,257 + ,120192 + ,197680 + ,42 + ,207 + ,95893 + ,81180 + ,36 + ,103 + ,151715 + ,197765 + ,49 + ,171 + ,176225 + ,214738 + ,28 + ,279 + ,59900 + ,96252 + ,43 + ,83 + ,104767 + ,124527 + ,42 + ,130 + ,114799 + ,153242 + ,37 + ,131 + ,72128 + ,145707 + ,30 + ,126 + ,143592 + ,113963 + ,35 + ,158 + ,89626 + ,134904 + ,44 + ,138 + ,131072 + ,114268 + ,36 + ,200 + ,126817 + ,94333 + ,28 + ,104 + ,81351 + ,102204 + ,45 + ,111 + ,22618 + ,23824 + ,23 + ,26 + ,88977 + ,111563 + ,45 + ,115 + ,92059 + ,91313 + ,38 + ,127 + ,81897 + ,89770 + ,38 + ,140 + ,108146 + ,100125 + ,46 + ,121 + ,126372 + ,165278 + ,36 + ,183 + ,249771 + ,181712 + ,41 + ,68 + ,71154 + ,80906 + ,38 + ,112 + ,71571 + ,75881 + ,37 + ,103 + ,55918 + ,83963 + ,28 + ,63 + ,160141 + ,175721 + ,45 + ,166 + ,38692 + ,68580 + ,26 + ,38 + ,102812 + ,136323 + ,44 + ,163 + ,56622 + ,55792 + ,8 + ,59 + ,15986 + ,25157 + ,27 + ,27 + ,123534 + ,100922 + ,38 + ,108 + ,108535 + ,118845 + ,37 + ,88 + ,93879 + ,170492 + ,57 + ,92 + ,144551 + ,81716 + ,45 + ,170 + ,56750 + ,115750 + ,37 + ,98 + ,127654 + ,105590 + ,40 + ,205 + ,65594 + ,92795 + ,31 + ,96 + ,59938 + ,82390 + ,36 + ,107 + ,146975 + ,135599 + ,40 + ,150 + ,143372 + ,111542 + ,36 + ,123 + ,168553 + ,162519 + ,35 + ,176 + ,183500 + ,211381 + ,39 + ,213 + ,165986 + ,189944 + ,65 + ,208 + ,184923 + ,226168 + ,30 + ,307 + ,140358 + ,117495 + ,51 + ,125 + ,149959 + ,195894 + ,41 + ,208 + ,57224 + ,80684 + ,36 + ,73 + ,43750 + ,19630 + ,19 + ,49 + ,48029 + ,88634 + ,23 + ,82 + ,104978 + ,139292 + ,44 + ,206 + ,100046 + ,128602 + ,40 + ,112 + ,101047 + ,135848 + ,40 + ,139 + ,197426 + ,178377 + ,30 + ,60 + ,160902 + ,106330 + ,41 + ,70 + ,147172 + ,178303 + ,40 + ,112 + ,109432 + ,116938 + ,45 + ,142 + ,1168 + ,5841 + ,1 + ,11 + ,83248 + ,106020 + ,40 + ,130 + ,25162 + ,24610 + ,11 + ,31 + ,45724 + ,74151 + ,45 + ,132 + ,110529 + ,232241 + ,38 + ,219 + ,855 + ,6622 + ,0 + ,4 + ,101382 + ,127097 + ,30 + ,102 + ,14116 + ,13155 + ,8 + ,39 + ,89506 + ,160501 + ,39 + ,125 + ,135356 + ,91502 + ,48 + ,121 + ,116066 + ,24469 + ,48 + ,42 + ,144244 + ,88229 + ,29 + ,111 + ,8773 + ,13983 + ,8 + ,16 + ,102153 + ,80716 + ,43 + ,70 + ,117440 + ,157384 + ,52 + ,162 + ,104128 + ,122975 + ,53 + ,173 + ,134238 + ,191469 + ,48 + ,171 + ,134047 + ,231257 + ,48 + ,172 + ,279488 + ,258287 + ,50 + ,254 + ,79756 + ,122531 + ,40 + ,90 + ,66089 + ,61394 + ,36 + ,50 + ,102070 + ,86480 + ,40 + ,113 + ,146760 + ,195791 + ,46 + ,187 + ,154771 + ,18284 + ,42 + ,16 + ,165933 + ,147581 + ,46 + ,175 + ,64593 + ,72558 + ,39 + ,90 + ,92280 + ,147341 + ,41 + ,140 + ,67150 + ,114651 + ,46 + ,145 + ,128692 + ,100187 + ,32 + ,141 + ,124089 + ,130332 + ,39 + ,125 + ,125386 + ,134218 + ,39 + ,241 + ,37238 + ,10901 + ,21 + ,16 + ,140015 + ,145758 + ,45 + ,175 + ,150047 + ,75767 + ,50 + ,132 + ,154451 + ,134969 + ,36 + ,154 + ,156349 + ,169216 + ,44 + ,198 + ,0 + ,0 + ,0 + ,0 + ,6023 + ,7953 + ,0 + ,5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,84601 + ,105406 + ,37 + ,125 + ,68946 + ,174586 + ,52 + ,174 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1644 + ,4245 + ,0 + ,6 + ,6179 + ,21509 + ,5 + ,13 + ,3926 + ,7670 + ,1 + ,3 + ,52789 + ,15673 + ,43 + ,35 + ,0 + ,0 + ,0 + ,0 + ,100350 + ,75882 + ,34 + ,80) + ,dim=c(4 + ,164) + ,dimnames=list(c('Grootte' + ,'Tijd' + ,'Review' + ,'Hyperlinks') + ,1:164)) > y <- array(NA,dim=c(4,164),dimnames=list(c('Grootte','Tijd','Review','Hyperlinks'),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 = '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] "Grootte" > 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]) [0e+00,100350) [1e+05,279488] 82 82 > colnames(x) [1] "Grootte" "Tijd" "Review" "Hyperlinks" > colnames(x)[par1] [1] "Grootte" > x[,par1] [1] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [6] [0e+00,100350) [1e+05,279488] [0e+00,100350) [1e+05,279488] [0e+00,100350) [11] [0e+00,100350) [0e+00,100350) [0e+00,100350) [1e+05,279488] [0e+00,100350) [16] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [21] [1e+05,279488] [1e+05,279488] [0e+00,100350) [1e+05,279488] [0e+00,100350) [26] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [1e+05,279488] [31] [1e+05,279488] [0e+00,100350) [1e+05,279488] [0e+00,100350) [1e+05,279488] [36] [0e+00,100350) [1e+05,279488] [0e+00,100350) [0e+00,100350) [1e+05,279488] [41] [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [46] [1e+05,279488] [0e+00,100350) [0e+00,100350) [1e+05,279488] [0e+00,100350) [51] [0e+00,100350) [0e+00,100350) [1e+05,279488] [0e+00,100350) [0e+00,100350) [56] [0e+00,100350) [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [61] [1e+05,279488] [1e+05,279488] [0e+00,100350) [1e+05,279488] [1e+05,279488] [66] [0e+00,100350) [1e+05,279488] [0e+00,100350) [1e+05,279488] [1e+05,279488] [71] [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [76] [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [81] [0e+00,100350) [1e+05,279488] [0e+00,100350) [1e+05,279488] [0e+00,100350) [86] [0e+00,100350) [1e+05,279488] [1e+05,279488] [0e+00,100350) [1e+05,279488] [91] [0e+00,100350) [1e+05,279488] [0e+00,100350) [0e+00,100350) [1e+05,279488] [96] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [101] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [0e+00,100350) [106] [1e+05,279488] [0e+00,100350) [1e+05,279488] [1e+05,279488] [1e+05,279488] [111] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [0e+00,100350) [116] [0e+00,100350) [1e+05,279488] [0e+00,100350) [1e+05,279488] [0e+00,100350) [121] [0e+00,100350) [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [126] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [131] [1e+05,279488] [0e+00,100350) [0e+00,100350) [1e+05,279488] [1e+05,279488] [136] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [0e+00,100350) [141] [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [1e+05,279488] [146] [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [151] [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [156] [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [161] [0e+00,100350) [0e+00,100350) [0e+00,100350) [1e+05,279488] Levels: [0e+00,100350) [1e+05,279488] > 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/167491324654763.tab") + } + } > m Conditional inference tree with 4 terminal nodes Response: as.factor(Grootte) Inputs: Tijd, Review, Hyperlinks Number of observations: 164 1) Hyperlinks <= 140; criterion = 1, statistic = 61.689 2) Tijd <= 74151; criterion = 1, statistic = 16.23 3) Review <= 36; criterion = 0.953, statistic = 5.82 4)* weights = 32 3) Review > 36 5)* weights = 8 2) Tijd > 74151 6)* weights = 69 1) Hyperlinks > 140 7)* weights = 55 > postscript(file="/var/wessaorg/rcomp/tmp/2uk891324654763.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/3v6zl1324654763.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 1 [3,] 2 1 [4,] 2 2 [5,] 1 1 [6,] 1 1 [7,] 2 2 [8,] 1 1 [9,] 2 1 [10,] 1 1 [11,] 1 2 [12,] 1 1 [13,] 1 1 [14,] 2 2 [15,] 1 1 [16,] 2 2 [17,] 2 2 [18,] 2 1 [19,] 2 2 [20,] 2 2 [21,] 2 2 [22,] 2 1 [23,] 1 1 [24,] 2 1 [25,] 1 1 [26,] 2 1 [27,] 2 2 [28,] 1 1 [29,] 1 1 [30,] 2 2 [31,] 2 2 [32,] 1 2 [33,] 2 2 [34,] 1 1 [35,] 2 2 [36,] 1 1 [37,] 2 1 [38,] 1 1 [39,] 1 1 [40,] 2 2 [41,] 1 1 [42,] 1 1 [43,] 1 1 [44,] 1 1 [45,] 1 1 [46,] 2 1 [47,] 1 1 [48,] 1 2 [49,] 2 2 [50,] 1 1 [51,] 1 1 [52,] 1 1 [53,] 2 2 [54,] 1 1 [55,] 1 1 [56,] 1 1 [57,] 2 2 [58,] 2 2 [59,] 2 2 [60,] 1 1 [61,] 2 2 [62,] 2 2 [63,] 1 1 [64,] 2 1 [65,] 2 1 [66,] 1 1 [67,] 2 2 [68,] 1 1 [69,] 2 2 [70,] 2 1 [71,] 1 1 [72,] 1 1 [73,] 1 1 [74,] 1 1 [75,] 1 1 [76,] 2 1 [77,] 2 2 [78,] 2 1 [79,] 1 1 [80,] 1 1 [81,] 1 1 [82,] 2 2 [83,] 1 1 [84,] 2 2 [85,] 1 1 [86,] 1 1 [87,] 2 1 [88,] 2 1 [89,] 1 1 [90,] 2 2 [91,] 1 1 [92,] 2 2 [93,] 1 1 [94,] 1 1 [95,] 2 2 [96,] 2 1 [97,] 2 2 [98,] 2 2 [99,] 2 2 [100,] 2 2 [101,] 2 1 [102,] 2 2 [103,] 1 1 [104,] 1 1 [105,] 1 1 [106,] 2 2 [107,] 1 1 [108,] 2 1 [109,] 2 1 [110,] 2 1 [111,] 2 1 [112,] 2 2 [113,] 1 1 [114,] 1 1 [115,] 1 1 [116,] 1 1 [117,] 2 2 [118,] 1 1 [119,] 2 1 [120,] 1 1 [121,] 1 1 [122,] 2 1 [123,] 2 1 [124,] 2 1 [125,] 1 1 [126,] 2 1 [127,] 2 2 [128,] 2 2 [129,] 2 2 [130,] 2 2 [131,] 2 2 [132,] 1 1 [133,] 1 1 [134,] 2 1 [135,] 2 2 [136,] 2 1 [137,] 2 2 [138,] 1 1 [139,] 1 1 [140,] 1 2 [141,] 2 2 [142,] 2 1 [143,] 2 2 [144,] 1 1 [145,] 2 2 [146,] 2 1 [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 2 [157,] 1 1 [158,] 1 1 [159,] 1 1 [160,] 1 1 [161,] 1 1 [162,] 1 1 [163,] 1 1 [164,] 2 1 [0e+00,100350) [1e+05,279488] [0e+00,100350) 77 5 [1e+05,279488] 32 50 > postscript(file="/var/wessaorg/rcomp/tmp/4mf661324654763.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/5gaxj1324654763.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/6afix1324654763.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/7qn2w1324654763.tab") + } > > try(system("convert tmp/2uk891324654763.ps tmp/2uk891324654763.png",intern=TRUE)) character(0) > try(system("convert tmp/3v6zl1324654763.ps tmp/3v6zl1324654763.png",intern=TRUE)) character(0) > try(system("convert tmp/4mf661324654763.ps tmp/4mf661324654763.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.555 0.246 2.794