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(129988 + ,81 + ,505 + ,20 + ,18158 + ,130358 + ,47 + ,329 + ,38 + ,30461 + ,7215 + ,18 + ,72 + ,0 + ,1423 + ,112976 + ,87 + ,588 + ,49 + ,25629 + ,220191 + ,127 + ,1103 + ,76 + ,48758 + ,402111 + ,219 + ,1620 + ,104 + ,129230 + ,129230 + ,52 + ,479 + ,39 + ,27376 + ,136284 + ,51 + ,338 + ,57 + ,26706 + ,99738 + ,39 + ,407 + ,42 + ,26505 + ,269166 + ,88 + ,859 + ,67 + ,49801 + ,113066 + ,69 + ,568 + ,50 + ,46580 + ,165392 + ,62 + ,595 + ,66 + ,48352 + ,78240 + ,90 + ,534 + ,38 + ,13899 + ,170854 + ,86 + ,886 + ,55 + ,39342 + ,134368 + ,47 + ,359 + ,42 + ,27465 + ,125769 + ,68 + ,419 + ,47 + ,55211 + ,123467 + ,50 + ,364 + ,71 + ,74098 + ,62020 + ,51 + ,298 + ,0 + ,13497 + ,108458 + ,79 + ,683 + ,50 + ,38338 + ,22762 + ,21 + ,188 + ,12 + ,52505 + ,48633 + ,50 + ,291 + ,16 + ,10663 + ,182081 + ,83 + ,640 + ,77 + ,74484 + ,149507 + ,62 + ,543 + ,32 + ,28895 + ,93773 + ,46 + ,532 + ,38 + ,32827 + ,133428 + ,79 + ,549 + ,50 + ,36188 + ,126660 + ,24 + ,447 + ,33 + ,28173 + ,153851 + ,141 + ,561 + ,49 + ,54926 + ,140711 + ,75 + ,266 + ,59 + ,38900 + ,303952 + ,108 + ,786 + ,55 + ,88530 + ,164481 + ,39 + ,761 + ,45 + ,35482 + ,134521 + ,41 + ,411 + ,47 + ,26730 + ,157753 + ,40 + ,484 + ,51 + ,29806 + ,103274 + ,90 + ,593 + ,45 + ,41799 + ,193525 + ,106 + ,761 + ,73 + ,54289 + ,182027 + ,44 + ,690 + ,51 + ,36805 + ,0 + ,1 + ,0 + ,0 + ,0 + ,181496 + ,56 + ,859 + ,46 + ,33146 + ,92526 + ,48 + ,475 + ,44 + ,23333 + ,115762 + ,42 + ,453 + ,33 + ,47686 + ,179089 + ,51 + ,630 + ,71 + ,77783 + ,146707 + ,60 + ,553 + ,61 + ,36042 + ,120318 + ,51 + ,565 + ,31 + ,34541 + ,86039 + ,26 + ,310 + ,21 + ,75620 + ,125540 + ,67 + ,649 + ,42 + ,60610 + ,95535 + ,42 + ,321 + ,44 + ,55041 + ,129236 + ,79 + ,263 + ,40 + ,32087 + ,61554 + ,26 + ,180 + ,15 + ,16356 + ,170811 + ,83 + ,587 + ,46 + ,40161 + ,161746 + ,76 + ,548 + ,43 + ,55459 + ,144425 + ,53 + ,852 + ,61 + ,36679 + ,48188 + ,28 + ,205 + ,12 + ,22346 + ,97793 + ,57 + ,325 + ,46 + ,27377 + ,249356 + ,65 + ,734 + ,60 + ,50273 + ,196791 + ,69 + ,619 + ,49 + ,32104 + ,161082 + ,51 + ,546 + ,50 + ,27016 + ,111388 + ,47 + ,443 + ,35 + ,19715 + ,172614 + ,58 + ,429 + ,45 + ,33629 + ,68627 + ,20 + ,220 + ,25 + ,27084 + ,109111 + ,57 + ,310 + ,47 + ,32352 + ,142391 + ,76 + ,809 + ,30 + ,51845 + ,125777 + ,51 + ,438 + ,48 + ,26591 + ,90434 + ,67 + ,611 + ,32 + ,29677 + ,95845 + ,50 + ,318 + ,28 + ,54237 + ,89751 + ,30 + ,336 + ,36 + ,20284 + ,101723 + ,25 + ,285 + ,13 + ,22741 + ,94982 + ,37 + ,391 + ,38 + ,34178 + ,145568 + ,62 + ,453 + ,49 + ,69551 + ,113325 + ,63 + ,715 + ,68 + ,29653 + ,92480 + ,34 + ,238 + ,36 + ,38071 + ,31970 + ,15 + ,101 + ,5 + ,4157 + ,196420 + ,104 + ,887 + ,53 + ,28321 + ,98324 + ,56 + ,321 + ,36 + ,40195 + ,80820 + ,56 + ,360 + ,54 + ,48158 + ,91934 + ,62 + ,435 + ,37 + ,13310 + ,118147 + ,55 + ,568 + ,52 + ,78474 + ,59924 + ,33 + ,296 + ,0 + ,6386 + ,120602 + ,53 + ,508 + ,53 + ,31588 + ,118781 + ,80 + ,690 + ,51 + ,61254 + ,60138 + ,23 + ,253 + ,16 + ,21152 + ,73422 + ,66 + ,366 + ,33 + ,41272 + ,70248 + ,60 + ,201 + ,48 + ,34165 + ,225857 + ,54 + ,652 + ,35 + ,37054 + ,51185 + ,24 + ,221 + ,24 + ,12368 + ,97181 + ,32 + ,438 + ,37 + ,23168 + ,45100 + ,40 + ,247 + ,17 + ,16380 + ,115801 + ,43 + ,388 + ,32 + ,41242 + ,191221 + ,194 + ,559 + ,55 + ,48450 + ,71960 + ,86 + ,233 + ,39 + ,20790 + ,81701 + ,49 + ,341 + ,35 + ,34585 + ,111142 + ,44 + ,442 + ,26 + ,35672 + ,98707 + ,34 + ,452 + ,37 + ,52168 + ,136234 + ,67 + ,584 + ,66 + ,53933 + ,136781 + ,53 + ,366 + ,35 + ,34474 + ,116132 + ,54 + ,433 + ,24 + ,43753 + ,49164 + ,33 + ,291 + ,22 + ,36456 + ,189493 + ,93 + ,632 + ,42 + ,51183 + ,169406 + ,50 + ,491 + ,86 + ,52742 + ,19349 + ,12 + ,67 + ,13 + ,3895 + ,160902 + ,88 + ,617 + ,21 + ,37076 + ,110736 + ,54 + ,607 + ,32 + ,24079 + ,43803 + ,25 + ,240 + ,8 + ,2325 + ,47062 + ,19 + ,219 + ,38 + ,29354 + ,110845 + ,44 + ,349 + ,45 + ,30341 + ,92517 + ,52 + ,241 + ,24 + ,18992 + ,58660 + ,36 + ,136 + ,23 + ,15292 + ,27676 + ,22 + ,194 + ,2 + ,5842 + ,106245 + ,34 + ,237 + ,65 + ,28918 + ,43863 + ,25 + ,158 + ,5 + ,3738 + ,0 + ,0 + ,0 + ,0 + ,0 + ,75566 + ,28 + ,281 + ,43 + ,95352 + ,59683 + ,50 + ,248 + ,18 + ,37478 + ,104330 + ,36 + ,358 + ,44 + ,26839 + ,72600 + ,49 + ,303 + ,45 + ,26783 + ,65494 + ,56 + ,267 + ,29 + ,33392 + ,3616 + ,5 + ,14 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,148117 + ,38 + ,290 + ,32 + ,25446 + ,117946 + ,66 + ,476 + ,65 + ,59847 + ,138702 + ,86 + ,524 + ,26 + ,28162 + ,84336 + ,33 + ,243 + ,24 + ,33298 + ,43410 + ,19 + ,292 + ,7 + ,2781 + ,142723 + ,63 + ,450 + ,63 + ,37121 + ,79015 + ,34 + ,217 + ,30 + ,22698 + ,106116 + ,47 + ,466 + ,54 + ,27615 + ,57626 + ,39 + ,160 + ,3 + ,32689 + ,19764 + ,12 + ,75 + ,10 + ,5752 + ,112195 + ,43 + ,442 + ,46 + ,23164 + ,103651 + ,25 + ,332 + ,23 + ,20304 + ,113402 + ,35 + ,417 + ,40 + ,34409 + ,11796 + ,9 + ,79 + ,1 + ,0 + ,7627 + ,9 + ,25 + ,0 + ,0 + ,121085 + ,50 + ,431 + ,29 + ,92538 + ,6836 + ,3 + ,11 + ,0 + ,0 + ,139563 + ,46 + ,564 + ,46 + ,46037 + ,5118 + ,3 + ,6 + ,5 + ,0 + ,40248 + ,16 + ,183 + ,8 + ,5444 + ,0 + ,0 + ,0 + ,0 + ,0 + ,95079 + ,42 + ,295 + ,21 + ,23924 + ,82961 + ,33 + ,232 + ,21 + ,52230 + ,7131 + ,4 + ,27 + ,0 + ,0 + ,4194 + ,11 + ,14 + ,0 + ,0 + ,60378 + ,20 + ,240 + ,15 + ,8019 + ,109214 + ,45 + ,252 + ,47 + ,34542 + ,83484 + ,17 + ,347 + ,17 + ,21157) + ,dim=c(5 + ,144) + ,dimnames=list(c('Total_Time_spent_in_RFC_in_seconds' + ,'Number_of_Logins' + ,'Total_number_of_Course_Compendium_Views' + ,'Total_Number_of_Blogged_Computations' + ,'Compendium_Writing:_total_number_of_characters') + ,1:144)) > y <- array(NA,dim=c(5,144),dimnames=list(c('Total_Time_spent_in_RFC_in_seconds','Number_of_Logins','Total_number_of_Course_Compendium_Views','Total_Number_of_Blogged_Computations','Compendium_Writing:_total_number_of_characters'),1:144)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par4 = 'yes' > par3 = '2' > par2 = 'equal' > par1 = '5' > 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] "Compendium_Writing._total_number_of_characters" > x[,par1] [1] 18158 30461 1423 25629 48758 129230 27376 26706 26505 49801 [11] 46580 48352 13899 39342 27465 55211 74098 13497 38338 52505 [21] 10663 74484 28895 32827 36188 28173 54926 38900 88530 35482 [31] 26730 29806 41799 54289 36805 0 33146 23333 47686 77783 [41] 36042 34541 75620 60610 55041 32087 16356 40161 55459 36679 [51] 22346 27377 50273 32104 27016 19715 33629 27084 32352 51845 [61] 26591 29677 54237 20284 22741 34178 69551 29653 38071 4157 [71] 28321 40195 48158 13310 78474 6386 31588 61254 21152 41272 [81] 34165 37054 12368 23168 16380 41242 48450 20790 34585 35672 [91] 52168 53933 34474 43753 36456 51183 52742 3895 37076 24079 [101] 2325 29354 30341 18992 15292 5842 28918 3738 0 95352 [111] 37478 26839 26783 33392 0 0 25446 59847 28162 33298 [121] 2781 37121 22698 27615 32689 5752 23164 20304 34409 0 [131] 0 92538 0 46037 0 5444 0 23924 52230 0 [141] 0 8019 34542 21157 > 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]) C1 C2 134 10 > colnames(x) [1] "Total_Time_spent_in_RFC_in_seconds" [2] "Number_of_Logins" [3] "Total_number_of_Course_Compendium_Views" [4] "Total_Number_of_Blogged_Computations" [5] "Compendium_Writing._total_number_of_characters" > colnames(x)[par1] [1] "Compendium_Writing._total_number_of_characters" > x[,par1] [1] C1 C1 C1 C1 C1 C2 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C2 C1 C1 C1 C1 C2 C1 C1 C1 [26] C1 C1 C1 C2 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C2 C1 C1 C2 C1 C1 C1 C1 C1 C1 C1 [51] C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C2 C1 C1 C1 C1 C1 C1 C1 C2 [76] C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 [101] C1 C1 C1 C1 C1 C1 C1 C1 C1 C2 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 [126] C1 C1 C1 C1 C1 C1 C2 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 C1 Levels: C1 C2 > 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/1c6sa1324643565.tab") + } + } m.ct.i.pred m.ct.i.actu 1 2 1 1197 3 2 86 4 [1] 0.9975 [1] 0.04444444 [1] 0.9310078 m.ct.x.pred m.ct.x.actu 1 2 1 139 1 2 10 0 [1] 0.9928571 [1] 0 [1] 0.9266667 > m Conditional inference tree with 2 terminal nodes Response: as.factor(Compendium_Writing._total_number_of_characters) Inputs: Total_Time_spent_in_RFC_in_seconds, Number_of_Logins, Total_number_of_Course_Compendium_Views, Total_Number_of_Blogged_Computations Number of observations: 144 1) Total_Time_spent_in_RFC_in_seconds <= 172614; criterion = 0.998, statistic = 12.473 2)* weights = 129 1) Total_Time_spent_in_RFC_in_seconds > 172614 3)* weights = 15 > postscript(file="/var/wessaorg/rcomp/tmp/2yfdt1324643565.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/3ow5z1324643565.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,] 1 1 [2,] 1 1 [3,] 1 1 [4,] 1 1 [5,] 1 1 [6,] 2 1 [7,] 1 1 [8,] 1 1 [9,] 1 1 [10,] 1 1 [11,] 1 1 [12,] 1 1 [13,] 1 1 [14,] 1 1 [15,] 1 1 [16,] 1 1 [17,] 2 1 [18,] 1 1 [19,] 1 1 [20,] 1 1 [21,] 1 1 [22,] 2 1 [23,] 1 1 [24,] 1 1 [25,] 1 1 [26,] 1 1 [27,] 1 1 [28,] 1 1 [29,] 2 1 [30,] 1 1 [31,] 1 1 [32,] 1 1 [33,] 1 1 [34,] 1 1 [35,] 1 1 [36,] 1 1 [37,] 1 1 [38,] 1 1 [39,] 1 1 [40,] 2 1 [41,] 1 1 [42,] 1 1 [43,] 2 1 [44,] 1 1 [45,] 1 1 [46,] 1 1 [47,] 1 1 [48,] 1 1 [49,] 1 1 [50,] 1 1 [51,] 1 1 [52,] 1 1 [53,] 1 1 [54,] 1 1 [55,] 1 1 [56,] 1 1 [57,] 1 1 [58,] 1 1 [59,] 1 1 [60,] 1 1 [61,] 1 1 [62,] 1 1 [63,] 1 1 [64,] 1 1 [65,] 1 1 [66,] 1 1 [67,] 2 1 [68,] 1 1 [69,] 1 1 [70,] 1 1 [71,] 1 1 [72,] 1 1 [73,] 1 1 [74,] 1 1 [75,] 2 1 [76,] 1 1 [77,] 1 1 [78,] 1 1 [79,] 1 1 [80,] 1 1 [81,] 1 1 [82,] 1 1 [83,] 1 1 [84,] 1 1 [85,] 1 1 [86,] 1 1 [87,] 1 1 [88,] 1 1 [89,] 1 1 [90,] 1 1 [91,] 1 1 [92,] 1 1 [93,] 1 1 [94,] 1 1 [95,] 1 1 [96,] 1 1 [97,] 1 1 [98,] 1 1 [99,] 1 1 [100,] 1 1 [101,] 1 1 [102,] 1 1 [103,] 1 1 [104,] 1 1 [105,] 1 1 [106,] 1 1 [107,] 1 1 [108,] 1 1 [109,] 1 1 [110,] 2 1 [111,] 1 1 [112,] 1 1 [113,] 1 1 [114,] 1 1 [115,] 1 1 [116,] 1 1 [117,] 1 1 [118,] 1 1 [119,] 1 1 [120,] 1 1 [121,] 1 1 [122,] 1 1 [123,] 1 1 [124,] 1 1 [125,] 1 1 [126,] 1 1 [127,] 1 1 [128,] 1 1 [129,] 1 1 [130,] 1 1 [131,] 1 1 [132,] 2 1 [133,] 1 1 [134,] 1 1 [135,] 1 1 [136,] 1 1 [137,] 1 1 [138,] 1 1 [139,] 1 1 [140,] 1 1 [141,] 1 1 [142,] 1 1 [143,] 1 1 [144,] 1 1 C1 C2 C1 134 0 C2 10 0 > postscript(file="/var/wessaorg/rcomp/tmp/44edq1324643565.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/55lgy1324643565.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/66eva1324643565.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/7m49i1324643565.tab") + } > > try(system("convert tmp/2yfdt1324643565.ps tmp/2yfdt1324643565.png",intern=TRUE)) character(0) > try(system("convert tmp/3ow5z1324643565.ps tmp/3ow5z1324643565.png",intern=TRUE)) character(0) > try(system("convert tmp/44edq1324643565.ps tmp/44edq1324643565.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.965 0.229 3.201