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. > par9 = 'CSUQ' > par8 = 'Learning Activities' > par7 = 'all' > par6 = 'all' > par5 = 'all' > par4 = 'no' > par3 = '3' > par2 = 'none' > par1 = '0' > par9 <- 'CSUQ' > par8 <- 'Learning Activities' > par7 <- 'all' > par6 <- 'all' > par5 <- 'all' > par4 <- 'no' > par3 <- '3' > par2 <- 'none' > par1 <- '0' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., 2012, Recursive Partitioning (Regression Trees) in Information Management (v1.0.8) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_regression_trees.wasp/ > #Source of accompanying publication: > # > 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 <- as.data.frame(read.table(file='http://www.wessa.net/download/utaut.csv',sep=',',header=T)) > x$U25 <- 6-x$U25 > if(par5 == 'female') x <- x[x$Gender==0,] > if(par5 == 'male') x <- x[x$Gender==1,] > if(par6 == 'prep') x <- x[x$Pop==1,] > if(par6 == 'bachelor') x <- x[x$Pop==0,] > if(par7 != 'all') { + x <- x[x$Year==as.numeric(par7),] + } > cAc <- with(x,cbind( A1, A2, A3, A4, A5, A6, A7, A8, A9,A10)) > cAs <- with(x,cbind(A11,A12,A13,A14,A15,A16,A17,A18,A19,A20)) > cA <- cbind(cAc,cAs) > cCa <- with(x,cbind(C1,C3,C5,C7, C9,C11,C13,C15,C17,C19,C21,C23,C25,C27,C29,C31,C33,C35,C37,C39,C41,C43,C45,C47)) > cCp <- with(x,cbind(C2,C4,C6,C8,C10,C12,C14,C16,C18,C20,C22,C24,C26,C28,C30,C32,C34,C36,C38,C40,C42,C44,C46,C48)) > cC <- cbind(cCa,cCp) > cU <- with(x,cbind(U1,U2,U3,U4,U5,U6,U7,U8,U9,U10,U11,U12,U13,U14,U15,U16,U17,U18,U19,U20,U21,U22,U23,U24,U25,U26,U27,U28,U29,U30,U31,U32,U33)) > cE <- with(x,cbind(BC,NNZFG,MRT,AFL,LPM,LPC,W,WPA)) > cX <- with(x,cbind(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18)) > if (par8=='ATTLES connected') x <- cAc > if (par8=='ATTLES separate') x <- cAs > if (par8=='ATTLES all') x <- cA > if (par8=='COLLES actuals') x <- cCa > if (par8=='COLLES preferred') x <- cCp > if (par8=='COLLES all') x <- cC > if (par8=='CSUQ') x <- cU > if (par8=='Learning Activities') x <- cE > if (par8=='Exam Items') x <- cX > if (par9=='ATTLES connected') y <- cAc > if (par9=='ATTLES separate') y <- cAs > if (par9=='ATTLES all') y <- cA > if (par9=='COLLES actuals') y <- cCa > if (par9=='COLLES preferred') y <- cCp > if (par9=='COLLES all') y <- cC > if (par9=='CSUQ') y <- cU > if (par9=='Learning Activities') y <- cE > if (par9=='Exam Items') y <- cX > if (par1==0) { + nr <- length(y[,1]) + nc <- length(y[1,]) + mysum <- array(0,dim=nr) + for(jjj in 1:nr) { + for(iii in 1:nc) { + mysum[jjj] = mysum[jjj] + y[jjj,iii] + } + } + y <- mysum + } else { + y <- y[,par1] + } > nx <- cbind(y,x) > colnames(nx) <- c('endo',colnames(x)) > x <- nx > par1=1 > ncol <- length(x[1,]) > for (jjj in 1:ncol) { + x <- x[!is.na(x[,jjj]),] + } > x <- as.data.frame(x) > k <- length(x[1,]) > n <- length(x[,1]) > colnames(x)[par1] [1] "endo" > x[,par1] [1] 119 143 141 137 141 109 105 111 153 99 134 122 124 119 91 122 136 131 [19] 129 135 120 119 119 118 123 114 134 97 130 112 126 107 106 110 137 130 [37] 105 106 144 129 140 112 108 113 116 116 135 95 101 122 123 126 121 106 [55] 100 126 132 87 117 100 128 140 117 132 107 133 133 119 132 142 69 141 [73] 125 95 119 136 108 112 115 100 82 122 142 147 132 98 130 91 124 122 [91] 127 124 127 144 134 108 130 151 113 81 101 109 126 134 128 128 125 88 [109] 117 112 97 99 96 105 121 95 131 122 97 106 119 124 126 99 126 100 [127] 110 107 107 93 106 121 112 98 93 107 96 110 84 119 134 139 149 118 [145] 120 120 107 121 61 118 118 109 113 124 93 143 112 100 87 130 106 121 [163] 120 111 110 115 100 126 102 115 126 123 114 76 115 112 81 77 92 114 [181] 99 38 107 92 141 120 124 129 103 118 111 84 84 123 124 112 114 97 [199] 132 104 110 127 131 136 87 87 94 135 124 102 138 90 71 112 105 108 [217] 118 80 112 > 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]) 38 61 69 71 76 77 80 81 82 84 87 88 90 91 92 93 94 95 96 97 1 1 1 1 1 1 1 2 1 3 4 1 1 2 2 3 1 3 2 4 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 2 4 6 2 2 1 1 4 6 7 4 3 5 3 10 3 4 4 2 3 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 6 8 5 5 6 4 8 2 8 3 3 3 5 3 5 2 5 3 3 2 138 139 140 141 142 143 144 147 149 151 153 1 1 2 4 2 2 2 1 1 1 1 > colnames(x) [1] "endo" "BC" "NNZFG" "MRT" "AFL" "LPM" "LPC" "W" "WPA" > colnames(x)[par1] [1] "endo" > x[,par1] [1] 119 143 141 137 141 109 105 111 153 99 134 122 124 119 91 122 136 131 [19] 129 135 120 119 119 118 123 114 134 97 130 112 126 107 106 110 137 130 [37] 105 106 144 129 140 112 108 113 116 116 135 95 101 122 123 126 121 106 [55] 100 126 132 87 117 100 128 140 117 132 107 133 133 119 132 142 69 141 [73] 125 95 119 136 108 112 115 100 82 122 142 147 132 98 130 91 124 122 [91] 127 124 127 144 134 108 130 151 113 81 101 109 126 134 128 128 125 88 [109] 117 112 97 99 96 105 121 95 131 122 97 106 119 124 126 99 126 100 [127] 110 107 107 93 106 121 112 98 93 107 96 110 84 119 134 139 149 118 [145] 120 120 107 121 61 118 118 109 113 124 93 143 112 100 87 130 106 121 [163] 120 111 110 115 100 126 102 115 126 123 114 76 115 112 81 77 92 114 [181] 99 38 107 92 141 120 124 129 103 118 111 84 84 123 124 112 114 97 [199] 132 104 110 127 131 136 87 87 94 135 124 102 138 90 71 112 105 108 [217] 118 80 112 > 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/1mvhz1336497042.tab") + } + } > m Conditional inference tree with 3 terminal nodes Response: endo Inputs: BC, NNZFG, MRT, AFL, LPM, LPC, W, WPA Number of observations: 219 1) BC <= 67; criterion = 1, statistic = 22.084 2) MRT <= 15; criterion = 0.96, statistic = 7.837 3)* weights = 64 2) MRT > 15 4)* weights = 39 1) BC > 67 5)* weights = 116 > postscript(file="/var/wessaorg/rcomp/tmp/2k6081336497042.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/3t8291336497042.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 119 119.8362 -0.8362069 2 143 119.8362 23.1637931 3 141 119.8362 21.1637931 4 137 105.2188 31.7812500 5 141 119.8362 21.1637931 6 109 114.5897 -5.5897436 7 105 119.8362 -14.8362069 8 111 105.2188 5.7812500 9 153 119.8362 33.1637931 10 99 105.2188 -6.2187500 11 134 119.8362 14.1637931 12 122 105.2188 16.7812500 13 124 119.8362 4.1637931 14 119 119.8362 -0.8362069 15 91 105.2188 -14.2187500 16 122 119.8362 2.1637931 17 136 119.8362 16.1637931 18 131 119.8362 11.1637931 19 129 119.8362 9.1637931 20 135 119.8362 15.1637931 21 120 119.8362 0.1637931 22 119 119.8362 -0.8362069 23 119 119.8362 -0.8362069 24 118 119.8362 -1.8362069 25 123 119.8362 3.1637931 26 114 119.8362 -5.8362069 27 134 105.2188 28.7812500 28 97 119.8362 -22.8362069 29 130 119.8362 10.1637931 30 112 119.8362 -7.8362069 31 126 119.8362 6.1637931 32 107 119.8362 -12.8362069 33 106 119.8362 -13.8362069 34 110 119.8362 -9.8362069 35 137 119.8362 17.1637931 36 130 119.8362 10.1637931 37 105 105.2188 -0.2187500 38 106 119.8362 -13.8362069 39 144 105.2188 38.7812500 40 129 119.8362 9.1637931 41 140 119.8362 20.1637931 42 112 105.2188 6.7812500 43 108 119.8362 -11.8362069 44 113 105.2188 7.7812500 45 116 119.8362 -3.8362069 46 116 114.5897 1.4102564 47 135 114.5897 20.4102564 48 95 119.8362 -24.8362069 49 101 119.8362 -18.8362069 50 122 119.8362 2.1637931 51 123 119.8362 3.1637931 52 126 119.8362 6.1637931 53 121 119.8362 1.1637931 54 106 119.8362 -13.8362069 55 100 119.8362 -19.8362069 56 126 119.8362 6.1637931 57 132 119.8362 12.1637931 58 87 119.8362 -32.8362069 59 117 119.8362 -2.8362069 60 100 119.8362 -19.8362069 61 128 119.8362 8.1637931 62 140 119.8362 20.1637931 63 117 114.5897 2.4102564 64 132 119.8362 12.1637931 65 107 119.8362 -12.8362069 66 133 114.5897 18.4102564 67 133 119.8362 13.1637931 68 119 114.5897 4.4102564 69 132 119.8362 12.1637931 70 142 119.8362 22.1637931 71 69 119.8362 -50.8362069 72 141 119.8362 21.1637931 73 125 119.8362 5.1637931 74 95 119.8362 -24.8362069 75 119 105.2188 13.7812500 76 136 105.2188 30.7812500 77 108 119.8362 -11.8362069 78 112 119.8362 -7.8362069 79 115 119.8362 -4.8362069 80 100 119.8362 -19.8362069 81 82 105.2188 -23.2187500 82 122 119.8362 2.1637931 83 142 119.8362 22.1637931 84 147 119.8362 27.1637931 85 132 119.8362 12.1637931 86 98 119.8362 -21.8362069 87 130 119.8362 10.1637931 88 91 119.8362 -28.8362069 89 124 119.8362 4.1637931 90 122 119.8362 2.1637931 91 127 119.8362 7.1637931 92 124 119.8362 4.1637931 93 127 119.8362 7.1637931 94 144 119.8362 24.1637931 95 134 119.8362 14.1637931 96 108 105.2188 2.7812500 97 130 114.5897 15.4102564 98 151 119.8362 31.1637931 99 113 119.8362 -6.8362069 100 81 119.8362 -38.8362069 101 101 105.2188 -4.2187500 102 109 119.8362 -10.8362069 103 126 119.8362 6.1637931 104 134 119.8362 14.1637931 105 128 119.8362 8.1637931 106 128 119.8362 8.1637931 107 125 114.5897 10.4102564 108 88 105.2188 -17.2187500 109 117 119.8362 -2.8362069 110 112 119.8362 -7.8362069 111 97 105.2188 -8.2187500 112 99 119.8362 -20.8362069 113 96 119.8362 -23.8362069 114 105 119.8362 -14.8362069 115 121 114.5897 6.4102564 116 95 119.8362 -24.8362069 117 131 119.8362 11.1637931 118 122 119.8362 2.1637931 119 97 119.8362 -22.8362069 120 106 119.8362 -13.8362069 121 119 119.8362 -0.8362069 122 124 114.5897 9.4102564 123 126 105.2188 20.7812500 124 99 119.8362 -20.8362069 125 126 119.8362 6.1637931 126 100 119.8362 -19.8362069 127 110 105.2188 4.7812500 128 107 114.5897 -7.5897436 129 107 105.2188 1.7812500 130 93 114.5897 -21.5897436 131 106 105.2188 0.7812500 132 121 114.5897 6.4102564 133 112 114.5897 -2.5897436 134 98 105.2188 -7.2187500 135 93 105.2188 -12.2187500 136 107 114.5897 -7.5897436 137 96 105.2188 -9.2187500 138 110 119.8362 -9.8362069 139 84 119.8362 -35.8362069 140 119 105.2188 13.7812500 141 134 114.5897 19.4102564 142 139 119.8362 19.1637931 143 149 114.5897 34.4102564 144 118 105.2188 12.7812500 145 120 119.8362 0.1637931 146 120 105.2188 14.7812500 147 107 119.8362 -12.8362069 148 121 114.5897 6.4102564 149 61 105.2188 -44.2187500 150 118 114.5897 3.4102564 151 118 119.8362 -1.8362069 152 109 114.5897 -5.5897436 153 113 114.5897 -1.5897436 154 124 105.2188 18.7812500 155 93 105.2188 -12.2187500 156 143 119.8362 23.1637931 157 112 105.2188 6.7812500 158 100 105.2188 -5.2187500 159 87 105.2188 -18.2187500 160 130 105.2188 24.7812500 161 106 105.2188 0.7812500 162 121 114.5897 6.4102564 163 120 105.2188 14.7812500 164 111 105.2188 5.7812500 165 110 114.5897 -4.5897436 166 115 114.5897 0.4102564 167 100 114.5897 -14.5897436 168 126 105.2188 20.7812500 169 102 114.5897 -12.5897436 170 115 119.8362 -4.8362069 171 126 119.8362 6.1637931 172 123 114.5897 8.4102564 173 114 105.2188 8.7812500 174 76 105.2188 -29.2187500 175 115 105.2188 9.7812500 176 112 105.2188 6.7812500 177 81 105.2188 -24.2187500 178 77 105.2188 -28.2187500 179 92 105.2188 -13.2187500 180 114 119.8362 -5.8362069 181 99 114.5897 -15.5897436 182 38 105.2188 -67.2187500 183 107 119.8362 -12.8362069 184 92 114.5897 -22.5897436 185 141 119.8362 21.1637931 186 120 114.5897 5.4102564 187 124 105.2188 18.7812500 188 129 119.8362 9.1637931 189 103 105.2188 -2.2187500 190 118 105.2188 12.7812500 191 111 105.2188 5.7812500 192 84 114.5897 -30.5897436 193 84 105.2188 -21.2187500 194 123 105.2188 17.7812500 195 124 114.5897 9.4102564 196 112 105.2188 6.7812500 197 114 105.2188 8.7812500 198 97 114.5897 -17.5897436 199 132 119.8362 12.1637931 200 104 114.5897 -10.5897436 201 110 105.2188 4.7812500 202 127 119.8362 7.1637931 203 131 114.5897 16.4102564 204 136 105.2188 30.7812500 205 87 105.2188 -18.2187500 206 87 105.2188 -18.2187500 207 94 105.2188 -11.2187500 208 135 119.8362 15.1637931 209 124 119.8362 4.1637931 210 102 114.5897 -12.5897436 211 138 119.8362 18.1637931 212 90 105.2188 -15.2187500 213 71 105.2188 -34.2187500 214 112 114.5897 -2.5897436 215 105 105.2188 -0.2187500 216 108 114.5897 -6.5897436 217 118 105.2188 12.7812500 218 80 105.2188 -25.2187500 219 112 114.5897 -2.5897436 > 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/4vpea1336497042.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/5gxo31336497042.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/63y4p1336497042.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/7m1nx1336497042.tab") + } > > try(system("convert tmp/2k6081336497042.ps tmp/2k6081336497042.png",intern=TRUE)) character(0) > try(system("convert tmp/3t8291336497042.ps tmp/3t8291336497042.png",intern=TRUE)) character(0) > try(system("convert tmp/4vpea1336497042.ps tmp/4vpea1336497042.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.303 0.397 4.699