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(1818 + ,279055 + ,73 + ,1433 + ,212408 + ,75 + ,2059 + ,233939 + ,83 + ,2733 + ,222117 + ,106 + ,1399 + ,189911 + ,56 + ,631 + ,70849 + ,28 + ,5460 + ,605767 + ,135 + ,381 + ,33186 + ,19 + ,2150 + ,227332 + ,62 + ,2042 + ,267925 + ,49 + ,2536 + ,371987 + ,122 + ,2429 + ,276291 + ,132 + ,2100 + ,212638 + ,87 + ,3020 + ,368577 + ,85 + ,2265 + ,269455 + ,88 + ,5139 + ,398124 + ,191 + ,2363 + ,335567 + ,77 + ,3564 + ,432711 + ,173 + ,1516 + ,185822 + ,59 + ,2398 + ,267365 + ,89 + ,2546 + ,279428 + ,73 + ,3253 + ,527853 + ,112 + ,1705 + ,220142 + ,49 + ,1787 + ,200004 + ,58 + ,3792 + ,257139 + ,133 + ,3108 + ,270941 + ,138 + ,3230 + ,324969 + ,134 + ,2348 + ,329962 + ,92 + ,1780 + ,190867 + ,60 + ,3218 + ,393860 + ,79 + ,2692 + ,327660 + ,89 + ,2187 + ,269239 + ,83 + ,2577 + ,396136 + ,106 + ,1293 + ,130446 + ,49 + ,3567 + ,430118 + ,104 + ,2764 + ,273950 + ,56 + ,3755 + ,428077 + ,128 + ,2075 + ,254312 + ,93 + ,995 + ,120351 + ,35 + ,3750 + ,395658 + ,212 + ,3413 + ,345875 + ,86 + ,2053 + ,216827 + ,82 + ,1984 + ,224524 + ,83 + ,1825 + ,182485 + ,69 + ,2783 + ,168492 + ,86 + ,5572 + ,459455 + ,157 + ,918 + ,78800 + ,42 + ,2685 + ,255072 + ,85 + ,4145 + ,368086 + ,123 + ,2841 + ,230299 + ,70 + ,2175 + ,244782 + ,81 + ,496 + ,24188 + ,24 + ,2699 + ,400109 + ,334 + ,744 + ,65029 + ,17 + ,1161 + ,101097 + ,64 + ,3333 + ,309810 + ,67 + ,2970 + ,375638 + ,91 + ,3969 + ,367127 + ,205 + ,2919 + ,387748 + ,156 + ,2399 + ,280106 + ,90 + ,4121 + ,400971 + ,153 + ,3323 + ,322755 + ,123 + ,3132 + ,291391 + ,124 + ,2868 + ,295075 + ,93 + ,1778 + ,280018 + ,81 + ,2109 + ,267432 + ,71 + ,2148 + ,217181 + ,141 + ,3009 + ,258166 + ,159 + ,2562 + ,264771 + ,88 + ,1737 + ,182961 + ,73 + ,2680 + ,256967 + ,74 + ,893 + ,73566 + ,32 + ,2389 + ,272362 + ,93 + ,2197 + ,229056 + ,62 + ,2227 + ,229851 + ,70 + ,2370 + ,371391 + ,91 + ,3226 + ,398210 + ,104 + ,1978 + ,220419 + ,111 + ,2516 + ,231884 + ,72 + ,2147 + ,219381 + ,73 + ,2150 + ,206169 + ,54 + ,4229 + ,483074 + ,132 + ,1380 + ,146100 + ,72 + ,2449 + ,295224 + ,109 + ,870 + ,80953 + ,25 + ,2700 + ,217384 + ,63 + ,1574 + ,179344 + ,62 + ,4046 + ,415550 + ,222 + ,3259 + ,389059 + ,129 + ,3098 + ,180679 + ,106 + ,2615 + ,299505 + ,104 + ,2404 + ,292260 + ,84 + ,1932 + ,199481 + ,68 + ,3147 + ,282361 + ,78 + ,2598 + ,329281 + ,89 + ,2108 + ,234577 + ,48 + ,2193 + ,297995 + ,67 + ,2478 + ,342490 + ,90 + ,4198 + ,416463 + ,163 + ,4165 + ,429565 + ,120 + ,2842 + ,297080 + ,142 + ,2562 + ,331792 + ,71 + ,2449 + ,229772 + ,202 + ,602 + ,43287 + ,14 + ,2579 + ,238089 + ,87 + ,2591 + ,263322 + ,160 + ,2957 + ,302082 + ,61 + ,2786 + ,321797 + ,95 + ,1477 + ,193926 + ,96 + ,3350 + ,175138 + ,105 + ,2107 + ,354041 + ,78 + ,2332 + ,303273 + ,91 + ,400 + ,23668 + ,13 + ,2233 + ,196743 + ,79 + ,530 + ,61857 + ,25 + ,2033 + ,217543 + ,54 + ,3246 + ,440711 + ,128 + ,387 + ,21054 + ,16 + ,2137 + ,252805 + ,52 + ,492 + ,31961 + ,22 + ,3838 + ,360436 + ,125 + ,2193 + ,251948 + ,77 + ,1796 + ,187320 + ,97 + ,1907 + ,180842 + ,58 + ,568 + ,38214 + ,34 + ,2602 + ,280392 + ,56 + ,2819 + ,358276 + ,84 + ,1464 + ,211775 + ,67 + ,3946 + ,447335 + ,90 + ,2554 + ,348017 + ,99 + ,3506 + ,441946 + ,133 + ,1552 + ,215177 + ,43 + ,1389 + ,130177 + ,47 + ,3101 + ,318037 + ,365 + ,4541 + ,466139 + ,198 + ,1872 + ,162279 + ,62 + ,4403 + ,416643 + ,140 + ,2113 + ,178322 + ,86 + ,2046 + ,292443 + ,54 + ,2564 + ,283913 + ,100 + ,2145 + ,251070 + ,128 + ,4112 + ,387072 + ,125 + ,2340 + ,246963 + ,93 + ,2035 + ,173260 + ,63 + ,3241 + ,346748 + ,108 + ,1991 + ,178402 + ,60 + ,2864 + ,277892 + ,97 + ,2748 + ,314070 + ,112 + ,2 + ,1 + ,0 + ,207 + ,14688 + ,10 + ,5 + ,98 + ,1 + ,8 + ,455 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,2449 + ,291847 + ,95 + ,3490 + ,415421 + ,168 + ,0 + ,0 + ,0 + ,4 + ,203 + ,4 + ,151 + ,7199 + ,5 + ,475 + ,46660 + ,21 + ,141 + ,17547 + ,5 + ,1145 + ,121550 + ,46 + ,29 + ,969 + ,2 + ,2080 + ,242774 + ,75) + ,dim=c(3 + ,164) + ,dimnames=list(c('A' + ,'B' + ,'C') + ,1:164)) > y <- array(NA,dim=c(3,164),dimnames=list(c('A','B','C'),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] "A" > x[,par1] [1] 1818 1433 2059 2733 1399 631 5460 381 2150 2042 2536 2429 2100 3020 2265 [16] 5139 2363 3564 1516 2398 2546 3253 1705 1787 3792 3108 3230 2348 1780 3218 [31] 2692 2187 2577 1293 3567 2764 3755 2075 995 3750 3413 2053 1984 1825 2783 [46] 5572 918 2685 4145 2841 2175 496 2699 744 1161 3333 2970 3969 2919 2399 [61] 4121 3323 3132 2868 1778 2109 2148 3009 2562 1737 2680 893 2389 2197 2227 [76] 2370 3226 1978 2516 2147 2150 4229 1380 2449 870 2700 1574 4046 3259 3098 [91] 2615 2404 1932 3147 2598 2108 2193 2478 4198 4165 2842 2562 2449 602 2579 [106] 2591 2957 2786 1477 3350 2107 2332 400 2233 530 2033 3246 387 2137 492 [121] 3838 2193 1796 1907 568 2602 2819 1464 3946 2554 3506 1552 1389 3101 4541 [136] 1872 4403 2113 2046 2564 2145 4112 2340 2035 3241 1991 2864 2748 2 207 [151] 5 8 0 0 2449 3490 0 4 151 475 141 1145 29 2080 > 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,2363) [2363,5572] 82 82 > colnames(x) [1] "A" "B" "C" > colnames(x)[par1] [1] "A" > x[,par1] [1] [ 0,2363) [ 0,2363) [ 0,2363) [2363,5572] [ 0,2363) [ 0,2363) [7] [2363,5572] [ 0,2363) [ 0,2363) [ 0,2363) [2363,5572] [2363,5572] [13] [ 0,2363) [2363,5572] [ 0,2363) [2363,5572] [2363,5572] [2363,5572] [19] [ 0,2363) [2363,5572] [2363,5572] [2363,5572] [ 0,2363) [ 0,2363) [25] [2363,5572] [2363,5572] [2363,5572] [ 0,2363) [ 0,2363) [2363,5572] [31] [2363,5572] [ 0,2363) [2363,5572] [ 0,2363) [2363,5572] [2363,5572] [37] [2363,5572] [ 0,2363) [ 0,2363) [2363,5572] [2363,5572] [ 0,2363) [43] [ 0,2363) [ 0,2363) [2363,5572] [2363,5572] [ 0,2363) [2363,5572] [49] [2363,5572] [2363,5572] [ 0,2363) [ 0,2363) [2363,5572] [ 0,2363) [55] [ 0,2363) [2363,5572] [2363,5572] [2363,5572] [2363,5572] [2363,5572] [61] [2363,5572] [2363,5572] [2363,5572] [2363,5572] [ 0,2363) [ 0,2363) [67] [ 0,2363) [2363,5572] [2363,5572] [ 0,2363) [2363,5572] [ 0,2363) [73] [2363,5572] [ 0,2363) [ 0,2363) [2363,5572] [2363,5572] [ 0,2363) [79] [2363,5572] [ 0,2363) [ 0,2363) [2363,5572] [ 0,2363) [2363,5572] [85] [ 0,2363) [2363,5572] [ 0,2363) [2363,5572] [2363,5572] [2363,5572] [91] [2363,5572] [2363,5572] [ 0,2363) [2363,5572] [2363,5572] [ 0,2363) [97] [ 0,2363) [2363,5572] [2363,5572] [2363,5572] [2363,5572] [2363,5572] [103] [2363,5572] [ 0,2363) [2363,5572] [2363,5572] [2363,5572] [2363,5572] [109] [ 0,2363) [2363,5572] [ 0,2363) [ 0,2363) [ 0,2363) [ 0,2363) [115] [ 0,2363) [ 0,2363) [2363,5572] [ 0,2363) [ 0,2363) [ 0,2363) [121] [2363,5572] [ 0,2363) [ 0,2363) [ 0,2363) [ 0,2363) [2363,5572] [127] [2363,5572] [ 0,2363) [2363,5572] [2363,5572] [2363,5572] [ 0,2363) [133] [ 0,2363) [2363,5572] [2363,5572] [ 0,2363) [2363,5572] [ 0,2363) [139] [ 0,2363) [2363,5572] [ 0,2363) [2363,5572] [ 0,2363) [ 0,2363) [145] [2363,5572] [ 0,2363) [2363,5572] [2363,5572] [ 0,2363) [ 0,2363) [151] [ 0,2363) [ 0,2363) [ 0,2363) [ 0,2363) [2363,5572] [2363,5572] [157] [ 0,2363) [ 0,2363) [ 0,2363) [ 0,2363) [ 0,2363) [ 0,2363) [163] [ 0,2363) [ 0,2363) Levels: [ 0,2363) [2363,5572] > 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/1v6f51324656962.tab") + } + } > m Conditional inference tree with 4 terminal nodes Response: as.factor(A) Inputs: B, C Number of observations: 164 1) B <= 254312; criterion = 1, statistic = 80.016 2) C <= 97; criterion = 1, statistic = 13.763 3)* weights = 73 2) C > 97 4)* weights = 7 1) B > 254312 5) C <= 83; criterion = 0.989, statistic = 7.736 6)* weights = 18 5) C > 83 7)* weights = 66 > postscript(file="/var/wessaorg/rcomp/tmp/2hp3n1324656962.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/3cwid1324656962.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 2 [2,] 1 1 [3,] 1 1 [4,] 2 2 [5,] 1 1 [6,] 1 1 [7,] 2 2 [8,] 1 1 [9,] 1 1 [10,] 1 2 [11,] 2 2 [12,] 2 2 [13,] 1 1 [14,] 2 2 [15,] 1 2 [16,] 2 2 [17,] 2 2 [18,] 2 2 [19,] 1 1 [20,] 2 2 [21,] 2 2 [22,] 2 2 [23,] 1 1 [24,] 1 1 [25,] 2 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 1 [35,] 2 2 [36,] 2 2 [37,] 2 2 [38,] 1 1 [39,] 1 1 [40,] 2 2 [41,] 2 2 [42,] 1 1 [43,] 1 1 [44,] 1 1 [45,] 2 1 [46,] 2 2 [47,] 1 1 [48,] 2 2 [49,] 2 2 [50,] 2 1 [51,] 1 1 [52,] 1 1 [53,] 2 2 [54,] 1 1 [55,] 1 1 [56,] 2 2 [57,] 2 2 [58,] 2 2 [59,] 2 2 [60,] 2 2 [61,] 2 2 [62,] 2 2 [63,] 2 2 [64,] 2 2 [65,] 1 2 [66,] 1 2 [67,] 1 2 [68,] 2 2 [69,] 2 2 [70,] 1 1 [71,] 2 2 [72,] 1 1 [73,] 2 2 [74,] 1 1 [75,] 1 1 [76,] 2 2 [77,] 2 2 [78,] 1 2 [79,] 2 1 [80,] 1 1 [81,] 1 1 [82,] 2 2 [83,] 1 1 [84,] 2 2 [85,] 1 1 [86,] 2 1 [87,] 1 1 [88,] 2 2 [89,] 2 2 [90,] 2 2 [91,] 2 2 [92,] 2 2 [93,] 1 1 [94,] 2 2 [95,] 2 2 [96,] 1 1 [97,] 1 2 [98,] 2 2 [99,] 2 2 [100,] 2 2 [101,] 2 2 [102,] 2 2 [103,] 2 2 [104,] 1 1 [105,] 2 1 [106,] 2 2 [107,] 2 2 [108,] 2 2 [109,] 1 1 [110,] 2 2 [111,] 1 2 [112,] 1 2 [113,] 1 1 [114,] 1 1 [115,] 1 1 [116,] 1 1 [117,] 2 2 [118,] 1 1 [119,] 1 1 [120,] 1 1 [121,] 2 2 [122,] 1 1 [123,] 1 1 [124,] 1 1 [125,] 1 1 [126,] 2 2 [127,] 2 2 [128,] 1 1 [129,] 2 2 [130,] 2 2 [131,] 2 2 [132,] 1 1 [133,] 1 1 [134,] 2 2 [135,] 2 2 [136,] 1 1 [137,] 2 2 [138,] 1 1 [139,] 1 2 [140,] 2 2 [141,] 1 2 [142,] 2 2 [143,] 1 1 [144,] 1 1 [145,] 2 2 [146,] 1 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,] 2 2 [156,] 2 2 [157,] 1 1 [158,] 1 1 [159,] 1 1 [160,] 1 1 [161,] 1 1 [162,] 1 1 [163,] 1 1 [164,] 1 1 [ 0,2363) [2363,5572] [ 0,2363) 68 14 [2363,5572] 5 77 > postscript(file="/var/wessaorg/rcomp/tmp/4fjk51324656962.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/5si1s1324656962.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/6dpdm1324656962.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/7fumt1324656962.tab") + } > > try(system("convert tmp/2hp3n1324656962.ps tmp/2hp3n1324656962.png",intern=TRUE)) character(0) > try(system("convert tmp/3cwid1324656962.ps tmp/3cwid1324656962.png",intern=TRUE)) character(0) > try(system("convert tmp/4fjk51324656962.ps tmp/4fjk51324656962.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.636 0.316 2.946