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 = 'COLLES all' > par8 = 'COLLES preferred' > par7 = 'all' > par6 = 'all' > par5 = 'all' > par4 = 'no' > par3 = '3' > par2 = 'none' > par1 = '0' > par9 <- 'COLLES all' > par8 <- 'COLLES preferred' > 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] 177 181 180 161 203 180 167 186 173 167 194 157 205 166 198 176 187 224 [19] 174 169 158 146 143 181 167 178 187 161 172 171 173 193 173 159 159 196 [37] 169 188 175 147 183 195 191 172 158 176 183 151 140 186 173 167 152 212 [55] 140 203 181 163 173 184 164 179 154 174 196 169 189 172 180 187 162 171 [73] 200 176 169 154 150 162 156 195 172 175 139 177 208 164 143 157 165 197 [91] 192 174 162 181 132 140 183 173 174 152 161 156 144 163 159 170 155 129 [109] 151 170 174 142 152 147 181 144 164 165 162 163 172 188 149 184 157 162 [127] 200 166 135 165 161 158 179 192 176 170 180 176 159 162 192 161 158 168 [145] 172 137 216 174 162 180 198 196 124 208 159 178 180 176 163 183 149 185 [163] 161 207 151 188 149 118 168 186 159 163 155 167 174 170 199 129 161 182 [181] 192 155 164 180 147 183 195 199 176 188 209 187 170 189 173 190 188 216 [199] 181 189 147 195 177 181 188 172 163 180 200 160 173 197 182 163 142 179 [217] 200 197 176 190 167 214 180 171 190 176 97 180 194 171 162 163 156 203 [235] 158 202 177 193 155 164 177 184 179 201 159 212 168 190 175 184 149 210 [253] 199 176 186 174 147 169 181 217 174 176 199 195 173 219 207 168 176 169 [271] 121 193 192 177 213 193 154 175 226 202 153 199 174 165 213 187 201 190 [289] 180 161 195 170 208 186 141 160 179 173 160 171 144 163 218 148 181 164 [307] 171 162 184 162 193 160 227 153 193 187 206 194 168 123 144 170 154 181 [325] 172 189 169 170 169 193 170 179 188 193 154 178 160 149 205 144 185 145 [343] 174 184 188 181 169 161 185 197 176 172 184 177 169 178 182 201 179 180 [361] 177 196 168 175 201 171 145 189 179 197 208 167 169 190 199 199 164 144 [379] 176 188 163 172 176 115 222 172 168 203 172 132 193 172 196 196 161 161 [397] 173 176 137 167 178 170 212 163 164 148 208 145 168 164 174 172 158 187 [415] 201 141 144 170 203 189 177 140 159 198 180 170 189 200 204 190 175 140 [433] 186 181 161 134 196 182 184 180 151 188 184 174 168 132 167 164 157 172 [451] 136 154 145 217 139 171 174 203 177 205 174 198 168 167 206 133 183 161 [469] 184 136 184 190 187 220 212 163 190 179 189 173 190 195 188 157 193 162 [487] 144 177 171 191 175 189 181 153 190 175 159 173 220 138 165 176 219 155 [505] 197 167 166 158 169 192 193 169 202 191 194 171 164 179 170 145 160 146 [523] 146 180 181 202 156 183 166 191 179 181 180 158 177 169 182 159 175 178 [541] 142 212 182 177 186 184 156 189 185 181 220 196 190 169 193 175 167 160 [559] 163 202 176 174 181 193 182 190 222 146 157 197 194 202 197 141 185 216 [577] 182 141 206 164 190 176 207 163 175 144 210 196 160 168 193 215 203 130 [595] 177 188 163 154 203 171 196 195 210 175 195 202 135 154 194 181 148 170 [613] 125 167 212 164 188 158 181 191 212 203 205 182 175 183 197 158 202 189 [631] 218 188 178 174 176 165 192 195 179 184 197 185 163 197 175 166 164 186 [649] 190 212 202 177 182 181 153 202 180 221 183 191 184 168 176 167 170 199 [667] 214 180 174 162 192 178 171 215 189 227 168 181 213 200 207 156 177 182 [685] 219 175 161 190 176 164 196 147 158 135 170 172 190 208 200 189 189 140 [703] 193 147 188 191 163 185 168 154 188 189 200 197 215 171 211 166 186 207 [721] 189 214 169 186 189 141 180 99 194 171 205 141 207 170 187 188 174 188 [739] 172 172 163 158 204 163 146 172 214 172 173 188 202 211 185 173 186 192 [757] 219 180 159 210 164 197 164 175 179 137 198 177 214 180 210 157 165 197 [775] 200 146 172 203 141 211 165 169 163 157 176 181 163 143 165 148 167 167 [793] 144 164 202 143 148 173 170 169 191 149 175 207 > 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]) 97 99 115 118 121 123 124 125 129 130 132 133 134 135 136 137 138 139 140 141 1 1 1 1 1 1 1 1 2 1 3 1 1 3 2 3 1 2 6 7 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 3 4 10 5 6 7 5 6 1 4 3 4 9 5 6 8 12 11 8 14 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 12 21 18 9 6 16 14 18 18 14 21 16 19 17 23 17 8 13 21 22 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 11 9 14 8 11 9 19 17 17 8 9 15 7 10 11 14 5 8 9 5 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 12 10 2 5 3 7 6 1 5 3 8 3 5 3 3 2 2 4 3 1 222 224 226 227 2 1 1 2 > colnames(x) [1] "endo" "C2" "C4" "C6" "C8" "C10" "C12" "C14" "C16" "C18" [11] "C20" "C22" "C24" "C26" "C28" "C30" "C32" "C34" "C36" "C38" [21] "C40" "C42" "C44" "C46" "C48" > colnames(x)[par1] [1] "endo" > x[,par1] [1] 177 181 180 161 203 180 167 186 173 167 194 157 205 166 198 176 187 224 [19] 174 169 158 146 143 181 167 178 187 161 172 171 173 193 173 159 159 196 [37] 169 188 175 147 183 195 191 172 158 176 183 151 140 186 173 167 152 212 [55] 140 203 181 163 173 184 164 179 154 174 196 169 189 172 180 187 162 171 [73] 200 176 169 154 150 162 156 195 172 175 139 177 208 164 143 157 165 197 [91] 192 174 162 181 132 140 183 173 174 152 161 156 144 163 159 170 155 129 [109] 151 170 174 142 152 147 181 144 164 165 162 163 172 188 149 184 157 162 [127] 200 166 135 165 161 158 179 192 176 170 180 176 159 162 192 161 158 168 [145] 172 137 216 174 162 180 198 196 124 208 159 178 180 176 163 183 149 185 [163] 161 207 151 188 149 118 168 186 159 163 155 167 174 170 199 129 161 182 [181] 192 155 164 180 147 183 195 199 176 188 209 187 170 189 173 190 188 216 [199] 181 189 147 195 177 181 188 172 163 180 200 160 173 197 182 163 142 179 [217] 200 197 176 190 167 214 180 171 190 176 97 180 194 171 162 163 156 203 [235] 158 202 177 193 155 164 177 184 179 201 159 212 168 190 175 184 149 210 [253] 199 176 186 174 147 169 181 217 174 176 199 195 173 219 207 168 176 169 [271] 121 193 192 177 213 193 154 175 226 202 153 199 174 165 213 187 201 190 [289] 180 161 195 170 208 186 141 160 179 173 160 171 144 163 218 148 181 164 [307] 171 162 184 162 193 160 227 153 193 187 206 194 168 123 144 170 154 181 [325] 172 189 169 170 169 193 170 179 188 193 154 178 160 149 205 144 185 145 [343] 174 184 188 181 169 161 185 197 176 172 184 177 169 178 182 201 179 180 [361] 177 196 168 175 201 171 145 189 179 197 208 167 169 190 199 199 164 144 [379] 176 188 163 172 176 115 222 172 168 203 172 132 193 172 196 196 161 161 [397] 173 176 137 167 178 170 212 163 164 148 208 145 168 164 174 172 158 187 [415] 201 141 144 170 203 189 177 140 159 198 180 170 189 200 204 190 175 140 [433] 186 181 161 134 196 182 184 180 151 188 184 174 168 132 167 164 157 172 [451] 136 154 145 217 139 171 174 203 177 205 174 198 168 167 206 133 183 161 [469] 184 136 184 190 187 220 212 163 190 179 189 173 190 195 188 157 193 162 [487] 144 177 171 191 175 189 181 153 190 175 159 173 220 138 165 176 219 155 [505] 197 167 166 158 169 192 193 169 202 191 194 171 164 179 170 145 160 146 [523] 146 180 181 202 156 183 166 191 179 181 180 158 177 169 182 159 175 178 [541] 142 212 182 177 186 184 156 189 185 181 220 196 190 169 193 175 167 160 [559] 163 202 176 174 181 193 182 190 222 146 157 197 194 202 197 141 185 216 [577] 182 141 206 164 190 176 207 163 175 144 210 196 160 168 193 215 203 130 [595] 177 188 163 154 203 171 196 195 210 175 195 202 135 154 194 181 148 170 [613] 125 167 212 164 188 158 181 191 212 203 205 182 175 183 197 158 202 189 [631] 218 188 178 174 176 165 192 195 179 184 197 185 163 197 175 166 164 186 [649] 190 212 202 177 182 181 153 202 180 221 183 191 184 168 176 167 170 199 [667] 214 180 174 162 192 178 171 215 189 227 168 181 213 200 207 156 177 182 [685] 219 175 161 190 176 164 196 147 158 135 170 172 190 208 200 189 189 140 [703] 193 147 188 191 163 185 168 154 188 189 200 197 215 171 211 166 186 207 [721] 189 214 169 186 189 141 180 99 194 171 205 141 207 170 187 188 174 188 [739] 172 172 163 158 204 163 146 172 214 172 173 188 202 211 185 173 186 192 [757] 219 180 159 210 164 197 164 175 179 137 198 177 214 180 210 157 165 197 [775] 200 146 172 203 141 211 165 169 163 157 176 181 163 143 165 148 167 167 [793] 144 164 202 143 148 173 170 169 191 149 175 207 > 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/1i0971337240219.tab") + } + } > m Conditional inference tree with 35 terminal nodes Response: endo Inputs: C2, C4, C6, C8, C10, C12, C14, C16, C18, C20, C22, C24, C26, C28, C30, C32, C34, C36, C38, C40, C42, C44, C46, C48 Number of observations: 804 1) C26 <= 4; criterion = 1, statistic = 243.461 2) C34 <= 3; criterion = 1, statistic = 145.226 3) C18 <= 3; criterion = 1, statistic = 71.163 4) C42 <= 3; criterion = 1, statistic = 47.836 5) C2 <= 3; criterion = 1, statistic = 24.709 6) C14 <= 2; criterion = 0.998, statistic = 15.339 7)* weights = 14 6) C14 > 2 8) C12 <= 3; criterion = 0.978, statistic = 10.994 9) C4 <= 3; criterion = 0.99, statistic = 12.483 10)* weights = 20 9) C4 > 3 11)* weights = 8 8) C12 > 3 12)* weights = 20 5) C2 > 3 13) C32 <= 3; criterion = 0.973, statistic = 10.611 14)* weights = 36 13) C32 > 3 15)* weights = 24 4) C42 > 3 16) C22 <= 2; criterion = 1, statistic = 21.127 17)* weights = 30 16) C22 > 2 18) C26 <= 3; criterion = 0.988, statistic = 12.08 19)* weights = 28 18) C26 > 3 20)* weights = 32 3) C18 > 3 21) C10 <= 2; criterion = 1, statistic = 26.171 22)* weights = 9 21) C10 > 2 23) C4 <= 4; criterion = 1, statistic = 19.165 24) C32 <= 3; criterion = 0.994, statistic = 13.49 25)* weights = 24 24) C32 > 3 26) C46 <= 3; criterion = 0.961, statistic = 9.885 27)* weights = 18 26) C46 > 3 28)* weights = 43 23) C4 > 4 29)* weights = 20 2) C34 > 3 30) C10 <= 3; criterion = 1, statistic = 67.281 31) C12 <= 3; criterion = 1, statistic = 20.468 32) C32 <= 3; criterion = 0.974, statistic = 10.633 33)* weights = 25 32) C32 > 3 34)* weights = 25 31) C12 > 3 35) C16 <= 3; criterion = 0.997, statistic = 14.785 36) C22 <= 2; criterion = 0.971, statistic = 10.433 37)* weights = 11 36) C22 > 2 38)* weights = 17 35) C16 > 3 39)* weights = 17 30) C10 > 3 40) C48 <= 4; criterion = 1, statistic = 32.098 41) C30 <= 4; criterion = 1, statistic = 20.066 42) C24 <= 4; criterion = 0.999, statistic = 17.695 43) C28 <= 3; criterion = 0.995, statistic = 13.913 44)* weights = 34 43) C28 > 3 45) C44 <= 3; criterion = 0.992, statistic = 12.957 46)* weights = 26 45) C44 > 3 47)* weights = 48 42) C24 > 4 48)* weights = 14 41) C30 > 4 49)* weights = 18 40) C48 > 4 50) C22 <= 4; criterion = 0.997, statistic = 14.811 51) C38 <= 4; criterion = 0.964, statistic = 10.068 52)* weights = 20 51) C38 > 4 53)* weights = 11 50) C22 > 4 54)* weights = 9 1) C26 > 4 55) C22 <= 3; criterion = 1, statistic = 49.018 56) C14 <= 4; criterion = 1, statistic = 20.243 57) C28 <= 4; criterion = 0.966, statistic = 10.134 58)* weights = 30 57) C28 > 4 59)* weights = 20 56) C14 > 4 60) C34 <= 3; criterion = 0.962, statistic = 9.928 61)* weights = 17 60) C34 > 3 62)* weights = 17 55) C22 > 3 63) C34 <= 3; criterion = 1, statistic = 27.175 64)* weights = 24 63) C34 > 3 65) C16 <= 4; criterion = 1, statistic = 22.536 66) C20 <= 3; criterion = 0.976, statistic = 10.835 67)* weights = 15 66) C20 > 3 68)* weights = 46 65) C16 > 4 69)* weights = 34 > postscript(file="/var/wessaorg/rcomp/tmp/2o85s1337240219.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/3iza81337240219.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 177 167.6429 9.35714286 2 181 174.8462 6.15384615 3 180 172.9118 7.08823529 4 161 167.0000 -6.00000000 5 203 189.4286 13.57142857 6 180 172.9118 7.08823529 7 167 170.5000 -3.50000000 8 186 174.8462 11.15384615 9 173 174.8462 -1.84615385 10 167 177.5938 -10.59375000 11 194 177.6744 16.32558140 12 157 177.7647 -20.76470588 13 205 191.2778 13.72222222 14 166 162.8182 3.18181818 15 198 183.0588 14.94117647 16 176 167.0000 9.00000000 17 187 182.2292 4.77083333 18 224 209.6471 14.35294118 19 174 177.6744 -3.67441860 20 169 170.5000 -1.50000000 21 158 158.7500 -0.75000000 22 146 154.2500 -8.25000000 23 143 159.2400 -16.24000000 24 181 172.9118 8.08823529 25 167 171.3200 -4.32000000 26 178 174.1000 3.90000000 27 187 186.6471 0.35294118 28 161 142.2000 18.80000000 29 172 159.2400 12.76000000 30 171 171.3200 -0.32000000 31 173 167.6429 5.35714286 32 193 174.8462 18.15384615 33 173 174.1000 -1.10000000 34 159 167.6429 -8.64285714 35 159 165.8333 -6.83333333 36 196 174.1000 21.90000000 37 169 172.9118 -3.91176471 38 188 186.9167 1.08333333 39 175 159.2400 15.76000000 40 147 154.2500 -7.25000000 41 183 177.6744 5.32558140 42 195 177.6744 17.32558140 43 191 182.2292 8.77083333 44 172 172.9118 -0.91176471 45 158 159.2400 -1.24000000 46 176 157.6000 18.40000000 47 183 172.9118 10.08823529 48 151 165.8333 -14.83333333 49 140 154.2500 -14.25000000 50 186 174.1000 11.90000000 51 173 172.9118 0.08823529 52 167 177.6744 -10.67441860 53 152 154.2500 -2.25000000 54 212 209.6471 2.35294118 55 140 154.2500 -14.25000000 56 203 198.3529 4.64705882 57 181 170.5000 10.50000000 58 163 159.2400 3.76000000 59 173 177.6744 -4.67441860 60 184 177.6744 6.32558140 61 164 165.8333 -1.83333333 62 179 177.5938 1.40625000 63 154 159.2400 -5.24000000 64 174 174.8462 -0.84615385 65 196 177.6744 18.32558140 66 169 165.8333 3.16666667 67 189 177.7647 11.23529412 68 172 155.4444 16.55555556 69 180 182.2292 -2.22916667 70 187 157.6000 29.40000000 71 162 157.6000 4.40000000 72 171 154.2500 16.75000000 73 200 182.2292 17.77083333 74 176 172.9118 3.08823529 75 169 174.8462 -5.84615385 76 154 155.4444 -1.44444444 77 150 162.8182 -12.81818182 78 162 172.9118 -10.91176471 79 156 177.6744 -21.67441860 80 195 185.4500 9.55000000 81 172 172.9118 -0.91176471 82 175 177.5938 -2.59375000 83 139 142.2000 -3.20000000 84 177 158.7500 18.25000000 85 208 189.4286 18.57142857 86 164 154.2500 9.75000000 87 143 130.2857 12.71428571 88 157 167.6429 -10.64285714 89 165 189.4286 -24.42857143 90 197 186.7500 10.25000000 91 192 177.7647 14.23529412 92 174 167.0000 7.00000000 93 162 159.2400 2.76000000 94 181 182.2292 -1.22916667 95 132 130.2857 1.71428571 96 140 170.5000 -30.50000000 97 183 187.8000 -4.80000000 98 173 167.0000 6.00000000 99 174 159.2400 14.76000000 100 152 159.2400 -7.24000000 101 161 142.2000 18.80000000 102 156 142.2000 13.80000000 103 144 130.2857 13.71428571 104 163 171.3200 -8.32000000 105 159 157.6000 1.40000000 106 170 171.3200 -1.32000000 107 155 172.9118 -17.91176471 108 129 142.2000 -13.20000000 109 151 171.3200 -20.32000000 110 170 177.7647 -7.76470588 111 174 177.7647 -3.76470588 112 142 157.6000 -15.60000000 113 152 154.2500 -2.25000000 114 147 157.6000 -10.60000000 115 181 183.0588 -2.05882353 116 144 157.6000 -13.60000000 117 164 167.0000 -3.00000000 118 165 158.7500 6.25000000 119 162 159.2400 2.76000000 120 163 155.4444 7.55555556 121 172 174.8462 -2.84615385 122 188 172.9118 15.08823529 123 149 167.0000 -18.00000000 124 184 182.2292 1.77083333 125 157 157.6000 -0.60000000 126 162 167.0000 -5.00000000 127 200 182.2292 17.77083333 128 166 177.6744 -11.67441860 129 135 130.2857 4.71428571 130 165 159.2500 5.75000000 131 161 177.5938 -16.59375000 132 158 167.0000 -9.00000000 133 179 177.6744 1.32558140 134 192 177.6744 14.32558140 135 176 167.0000 9.00000000 136 170 158.7500 11.25000000 137 180 174.1000 5.90000000 138 176 157.6000 18.40000000 139 159 159.2400 -0.24000000 140 162 159.2500 2.75000000 141 192 182.2292 9.77083333 142 161 165.8333 -4.83333333 143 158 171.3200 -13.32000000 144 168 177.7647 -9.76470588 145 172 159.2500 12.75000000 146 137 158.7500 -21.75000000 147 216 183.0588 32.94117647 148 174 171.3200 2.68000000 149 162 157.6000 4.40000000 150 180 177.5938 2.40625000 151 198 191.2778 6.72222222 152 196 177.6744 18.32558140 153 124 130.2857 -6.28571429 154 208 209.5556 -1.55555556 155 159 167.0000 -8.00000000 156 178 170.5000 7.50000000 157 180 171.3200 8.68000000 158 176 154.2500 21.75000000 159 163 171.3200 -8.32000000 160 183 172.9118 10.08823529 161 149 167.6429 -18.64285714 162 185 183.0588 1.94117647 163 161 154.2500 6.75000000 164 207 186.9167 20.08333333 165 151 158.7500 -7.75000000 166 188 174.8462 13.15384615 167 149 157.6000 -8.60000000 168 118 154.2500 -36.25000000 169 168 177.6744 -9.67441860 170 186 185.6000 0.40000000 171 159 157.6000 1.40000000 172 163 154.2500 8.75000000 173 155 155.4444 -0.44444444 174 167 162.8182 4.18181818 175 174 167.6429 6.35714286 176 170 182.2292 -12.22916667 177 199 165.8333 33.16666667 178 129 130.2857 -1.28571429 179 161 157.6000 3.40000000 180 182 167.6429 14.35714286 181 192 198.8043 -6.80434783 182 155 172.9118 -17.91176471 183 164 159.2500 4.75000000 184 180 177.5938 2.40625000 185 147 159.2400 -12.24000000 186 183 177.7647 5.23529412 187 195 186.7500 8.25000000 188 199 187.8000 11.20000000 189 176 170.5000 5.50000000 190 188 174.8462 13.15384615 191 209 209.6471 -0.64705882 192 187 167.6429 19.35714286 193 170 167.0000 3.00000000 194 189 198.8043 -9.80434783 195 173 165.8333 7.16666667 196 190 177.7647 12.23529412 197 188 185.6000 2.40000000 198 216 186.9167 29.08333333 199 181 170.5000 10.50000000 200 189 182.2292 6.77083333 201 147 159.2500 -12.25000000 202 195 174.1000 20.90000000 203 177 177.5938 -0.59375000 204 181 182.2292 -1.22916667 205 188 182.2292 5.77083333 206 172 157.6000 14.40000000 207 163 165.8333 -2.83333333 208 180 172.9118 7.08823529 209 200 198.8043 1.19565217 210 160 167.0000 -7.00000000 211 173 177.6744 -4.67441860 212 197 165.8333 31.16666667 213 182 177.7647 4.23529412 214 163 159.2400 3.76000000 215 142 142.2000 -0.20000000 216 179 158.7500 20.25000000 217 200 186.9167 13.08333333 218 197 182.2292 14.77083333 219 176 171.3200 4.68000000 220 190 182.2292 7.77083333 221 167 165.8333 1.16666667 222 214 177.6744 36.32558140 223 180 154.2500 25.75000000 224 171 165.8333 5.16666667 225 190 177.6744 12.32558140 226 176 177.7647 -1.76470588 227 97 130.2857 -33.28571429 228 180 171.3200 8.68000000 229 194 186.9167 7.08333333 230 171 167.6429 3.35714286 231 162 157.6000 4.40000000 232 163 155.4444 7.55555556 233 156 157.6000 -1.60000000 234 203 198.8043 4.19565217 235 158 185.6000 -27.60000000 236 202 185.4500 16.55000000 237 177 177.7647 -0.76470588 238 193 186.7500 6.25000000 239 155 159.2400 -4.24000000 240 164 167.0000 -3.00000000 241 177 189.4286 -12.42857143 242 184 171.3200 12.68000000 243 179 177.5938 1.40625000 244 201 191.2778 9.72222222 245 159 158.7500 0.25000000 246 212 191.2778 20.72222222 247 168 172.9118 -4.91176471 248 190 177.5938 12.40625000 249 175 177.5938 -2.59375000 250 184 185.6000 -1.60000000 251 149 155.4444 -6.44444444 252 210 198.8043 11.19565217 253 199 172.9118 26.08823529 254 176 182.2292 -6.22916667 255 186 177.5938 8.40625000 256 174 177.5938 -3.59375000 257 147 142.2000 4.80000000 258 169 158.7500 10.25000000 259 181 177.6744 3.32558140 260 217 198.8043 18.19565217 261 174 167.0000 7.00000000 262 176 186.7500 -10.75000000 263 199 171.3200 27.68000000 264 195 209.6471 -14.64705882 265 173 174.8462 -1.84615385 266 219 185.4500 33.55000000 267 207 209.5556 -2.55555556 268 168 167.6429 0.35714286 269 176 182.2292 -6.22916667 270 169 154.2500 14.75000000 271 121 130.2857 -9.28571429 272 193 174.8462 18.15384615 273 192 177.6744 14.32558140 274 177 177.6744 -0.67441860 275 213 198.8043 14.19565217 276 193 182.2292 10.77083333 277 154 170.5000 -16.50000000 278 175 162.8182 12.18181818 279 226 209.5556 16.44444444 280 202 198.8043 3.19565217 281 153 159.2400 -6.24000000 282 199 186.7500 12.25000000 283 174 177.6744 -3.67441860 284 165 157.6000 7.40000000 285 213 198.8043 14.19565217 286 187 177.7647 9.23529412 287 201 185.6000 15.40000000 288 190 177.5938 12.40625000 289 180 165.8333 14.16666667 290 161 171.3200 -10.32000000 291 195 171.3200 23.68000000 292 170 159.2400 10.76000000 293 208 185.6000 22.40000000 294 186 170.5000 15.50000000 295 141 154.2500 -13.25000000 296 160 154.2500 5.75000000 297 179 177.5938 1.40625000 298 173 165.8333 7.16666667 299 160 167.0000 -7.00000000 300 171 158.7500 12.25000000 301 144 165.8333 -21.83333333 302 163 170.5000 -7.50000000 303 218 209.5556 8.44444444 304 148 167.6429 -19.64285714 305 181 186.6471 -5.64705882 306 164 167.0000 -3.00000000 307 171 170.5000 0.50000000 308 162 159.2500 2.75000000 309 184 174.1000 9.90000000 310 162 172.9118 -10.91176471 311 193 167.6429 25.35714286 312 160 165.8333 -5.83333333 313 227 209.5556 17.44444444 314 153 142.2000 10.80000000 315 193 177.6744 15.32558140 316 187 172.9118 14.08823529 317 206 187.8000 18.20000000 318 194 198.8043 -4.80434783 319 168 167.6429 0.35714286 320 123 130.2857 -7.28571429 321 144 142.2000 1.80000000 322 170 158.7500 11.25000000 323 154 155.4444 -1.44444444 324 181 170.5000 10.50000000 325 172 159.2400 12.76000000 326 189 171.3200 17.68000000 327 169 158.7500 10.25000000 328 170 170.5000 -0.50000000 329 169 154.2500 14.75000000 330 193 191.2778 1.72222222 331 170 183.0588 -13.05882353 332 179 171.3200 7.68000000 333 188 187.8000 0.20000000 334 193 177.7647 15.23529412 335 154 158.7500 -4.75000000 336 178 170.5000 7.50000000 337 160 172.9118 -12.91176471 338 149 158.7500 -9.75000000 339 205 182.2292 22.77083333 340 144 142.2000 1.80000000 341 185 183.0588 1.94117647 342 145 154.2500 -9.25000000 343 174 167.0000 7.00000000 344 184 170.5000 13.50000000 345 188 174.1000 13.90000000 346 181 177.6744 3.32558140 347 169 157.6000 11.40000000 348 161 172.9118 -11.91176471 349 185 186.9167 -1.91666667 350 197 183.0588 13.94117647 351 176 171.3200 4.68000000 352 172 154.2500 17.75000000 353 184 177.6744 6.32558140 354 177 167.0000 10.00000000 355 169 172.9118 -3.91176471 356 178 174.8462 3.15384615 357 182 167.0000 15.00000000 358 201 191.2778 9.72222222 359 179 177.7647 1.23529412 360 180 177.6744 2.32558140 361 177 174.8462 2.15384615 362 196 185.4500 10.55000000 363 168 177.7647 -9.76470588 364 175 154.2500 20.75000000 365 201 185.4500 15.55000000 366 171 171.3200 -0.32000000 367 145 158.7500 -13.75000000 368 189 172.9118 16.08823529 369 179 177.6744 1.32558140 370 197 167.6429 29.35714286 371 208 198.3529 9.64705882 372 167 174.8462 -7.84615385 373 169 172.9118 -3.91176471 374 190 177.5938 12.40625000 375 199 189.4286 9.57142857 376 199 183.0588 15.94117647 377 164 171.3200 -7.32000000 378 144 142.2000 1.80000000 379 176 185.4500 -9.45000000 380 188 177.5938 10.40625000 381 163 159.2400 3.76000000 382 172 157.6000 14.40000000 383 176 186.6471 -10.64705882 384 115 130.2857 -15.28571429 385 222 186.7500 35.25000000 386 172 167.6429 4.35714286 387 168 167.0000 1.00000000 388 203 198.8043 4.19565217 389 172 154.2500 17.75000000 390 132 157.6000 -25.60000000 391 193 198.3529 -5.35294118 392 172 174.1000 -2.10000000 393 196 186.6471 9.35294118 394 196 186.6471 9.35294118 395 161 159.2500 1.75000000 396 161 185.4500 -24.45000000 397 173 167.6429 5.35714286 398 176 198.8043 -22.80434783 399 137 171.3200 -34.32000000 400 167 177.6744 -10.67441860 401 178 182.2292 -4.22916667 402 170 186.6471 -16.64705882 403 212 198.3529 13.64705882 404 163 171.3200 -8.32000000 405 164 185.4500 -21.45000000 406 148 157.6000 -9.60000000 407 208 209.5556 -1.55555556 408 145 142.2000 2.80000000 409 168 167.0000 1.00000000 410 164 186.9167 -22.91666667 411 174 174.8462 -0.84615385 412 172 172.9118 -0.91176471 413 158 177.6744 -19.67441860 414 187 183.0588 3.94117647 415 201 209.6471 -8.64705882 416 141 174.8462 -33.84615385 417 144 154.2500 -10.25000000 418 170 154.2500 15.75000000 419 203 182.2292 20.77083333 420 189 198.3529 -9.35294118 421 177 174.8462 2.15384615 422 140 157.6000 -17.60000000 423 159 185.6000 -26.60000000 424 198 191.2778 6.72222222 425 180 189.4286 -9.42857143 426 170 186.9167 -16.91666667 427 189 186.6471 2.35294118 428 200 209.6471 -9.64705882 429 204 186.9167 17.08333333 430 190 209.6471 -19.64705882 431 175 187.8000 -12.80000000 432 140 159.2400 -19.24000000 433 186 182.2292 3.77083333 434 181 185.4500 -4.45000000 435 161 177.6744 -16.67441860 436 134 170.5000 -36.50000000 437 196 189.4286 6.57142857 438 182 185.4500 -3.45000000 439 184 185.4500 -1.45000000 440 180 182.2292 -2.22916667 441 151 157.6000 -6.60000000 442 188 198.8043 -10.80434783 443 184 186.9167 -2.91666667 444 174 172.9118 1.08823529 445 168 186.6471 -18.64705882 446 132 142.2000 -10.20000000 447 167 167.0000 0.00000000 448 164 159.2400 4.76000000 449 157 174.1000 -17.10000000 450 172 182.2292 -10.22916667 451 136 154.2500 -18.25000000 452 154 165.8333 -11.83333333 453 145 157.6000 -12.60000000 454 217 198.8043 18.19565217 455 139 154.2500 -15.25000000 456 171 191.2778 -20.27777778 457 174 183.0588 -9.05882353 458 203 198.3529 4.64705882 459 177 182.2292 -5.22916667 460 205 189.4286 15.57142857 461 174 182.2292 -8.22916667 462 198 187.8000 10.20000000 463 168 177.6744 -9.67441860 464 167 167.6429 -0.64285714 465 206 174.1000 31.90000000 466 133 130.2857 2.71428571 467 183 177.5938 5.40625000 468 161 154.2500 6.75000000 469 184 187.8000 -3.80000000 470 136 165.8333 -29.83333333 471 184 198.8043 -14.80434783 472 190 174.1000 15.90000000 473 187 186.6471 0.35294118 474 220 209.6471 10.35294118 475 212 198.8043 13.19565217 476 163 167.0000 -4.00000000 477 190 186.9167 3.08333333 478 179 191.2778 -12.27777778 479 189 197.6364 -8.63636364 480 173 171.3200 1.68000000 481 190 191.2778 -1.27777778 482 195 191.2778 3.72222222 483 188 186.7500 1.25000000 484 157 157.6000 -0.60000000 485 193 187.8000 5.20000000 486 162 162.8182 -0.81818182 487 144 159.2400 -15.24000000 488 177 185.6000 -8.60000000 489 171 174.1000 -3.10000000 490 191 182.2292 8.77083333 491 175 185.4500 -10.45000000 492 189 186.9167 2.08333333 493 181 177.5938 3.40625000 494 153 174.1000 -21.10000000 495 190 191.2778 -1.27777778 496 175 185.6000 -10.60000000 497 159 186.9167 -27.91666667 498 173 182.2292 -9.22916667 499 220 198.8043 21.19565217 500 138 142.2000 -4.20000000 501 165 158.7500 6.25000000 502 176 174.8462 1.15384615 503 219 209.6471 9.35294118 504 155 167.6429 -12.64285714 505 197 186.9167 10.08333333 506 167 177.5938 -10.59375000 507 166 177.5938 -11.59375000 508 158 177.5938 -19.59375000 509 169 177.5938 -8.59375000 510 192 177.5938 14.40625000 511 193 191.2778 1.72222222 512 169 177.6744 -8.67441860 513 202 186.9167 15.08333333 514 191 185.6000 5.40000000 515 194 187.8000 6.20000000 516 171 182.2292 -11.22916667 517 164 172.9118 -8.91176471 518 179 174.1000 4.90000000 519 170 189.4286 -19.42857143 520 145 167.6429 -22.64285714 521 160 174.8462 -14.84615385 522 146 155.4444 -9.44444444 523 146 130.2857 15.71428571 524 180 182.2292 -2.22916667 525 181 185.4500 -4.45000000 526 202 186.7500 15.25000000 527 156 174.1000 -18.10000000 528 183 186.7500 -3.75000000 529 166 174.8462 -8.84615385 530 191 209.6471 -18.64705882 531 179 172.9118 6.08823529 532 181 174.8462 6.15384615 533 180 182.2292 -2.22916667 534 158 177.6744 -19.67441860 535 177 186.9167 -9.91666667 536 169 177.5938 -8.59375000 537 182 186.6471 -4.64705882 538 159 159.2400 -0.24000000 539 175 177.5938 -2.59375000 540 178 182.2292 -4.22916667 541 142 162.8182 -20.81818182 542 212 209.6471 2.35294118 543 182 162.8182 19.18181818 544 177 198.8043 -21.80434783 545 186 185.4500 0.55000000 546 184 185.6000 -1.60000000 547 156 154.2500 1.75000000 548 189 198.3529 -9.35294118 549 185 182.2292 2.77083333 550 181 198.8043 -17.80434783 551 220 198.8043 21.19565217 552 196 186.9167 9.08333333 553 190 177.5938 12.40625000 554 169 174.1000 -5.10000000 555 193 186.9167 6.08333333 556 175 182.2292 -7.22916667 557 167 172.9118 -5.91176471 558 160 165.8333 -5.83333333 559 163 174.1000 -11.10000000 560 202 209.6471 -7.64705882 561 176 186.7500 -10.75000000 562 174 187.8000 -13.80000000 563 181 186.9167 -5.91666667 564 193 170.5000 22.50000000 565 182 189.4286 -7.42857143 566 190 209.6471 -19.64705882 567 222 209.6471 12.35294118 568 146 157.6000 -11.60000000 569 157 174.1000 -17.10000000 570 197 185.6000 11.40000000 571 194 197.6364 -3.63636364 572 202 198.8043 3.19565217 573 197 198.8043 -1.80434783 574 141 130.2857 10.71428571 575 185 185.6000 -0.60000000 576 216 198.8043 17.19565217 577 182 172.9118 9.08823529 578 141 158.7500 -17.75000000 579 206 191.2778 14.72222222 580 164 154.2500 9.75000000 581 190 177.5938 12.40625000 582 176 186.9167 -10.91666667 583 207 209.6471 -2.64705882 584 163 177.6744 -14.67441860 585 175 177.6744 -2.67441860 586 144 142.2000 1.80000000 587 210 209.6471 0.35294118 588 196 198.3529 -2.35294118 589 160 186.9167 -26.91666667 590 168 182.2292 -14.22916667 591 193 187.8000 5.20000000 592 215 198.3529 16.64705882 593 203 186.6471 16.35294118 594 130 154.2500 -24.25000000 595 177 177.6744 -0.67441860 596 188 186.6471 1.35294118 597 163 177.6744 -14.67441860 598 154 167.6429 -13.64285714 599 203 198.3529 4.64705882 600 171 182.2292 -11.22916667 601 196 209.5556 -13.55555556 602 195 198.8043 -3.80434783 603 210 209.6471 0.35294118 604 175 186.7500 -11.75000000 605 195 197.6364 -2.63636364 606 202 189.4286 12.57142857 607 135 158.7500 -23.75000000 608 154 172.9118 -18.91176471 609 194 198.8043 -4.80434783 610 181 183.0588 -2.05882353 611 148 142.2000 5.80000000 612 170 167.6429 2.35714286 613 125 142.2000 -17.20000000 614 167 171.3200 -4.32000000 615 212 198.8043 13.19565217 616 164 165.8333 -1.83333333 617 188 185.4500 2.55000000 618 158 174.1000 -16.10000000 619 181 177.6744 3.32558140 620 191 186.7500 4.25000000 621 212 209.6471 2.35294118 622 203 198.8043 4.19565217 623 205 198.8043 6.19565217 624 182 172.9118 9.08823529 625 175 174.8462 0.15384615 626 183 165.8333 17.16666667 627 197 197.6364 -0.63636364 628 158 167.6429 -9.64285714 629 202 198.8043 3.19565217 630 189 198.8043 -9.80434783 631 218 209.6471 8.35294118 632 188 198.3529 -10.35294118 633 178 186.7500 -8.75000000 634 174 165.8333 8.16666667 635 176 177.5938 -1.59375000 636 165 191.2778 -26.27777778 637 192 197.6364 -5.63636364 638 195 185.6000 9.40000000 639 179 174.1000 4.90000000 640 184 191.2778 -7.27777778 641 197 198.8043 -1.80434783 642 185 186.6471 -1.64705882 643 163 172.9118 -9.91176471 644 197 182.2292 14.77083333 645 175 174.1000 0.90000000 646 166 183.0588 -17.05882353 647 164 177.5938 -13.59375000 648 186 186.7500 -0.75000000 649 190 177.6744 12.32558140 650 212 198.8043 13.19565217 651 202 186.9167 15.08333333 652 177 191.2778 -14.27777778 653 182 182.2292 -0.22916667 654 181 182.2292 -1.22916667 655 153 158.7500 -5.75000000 656 202 198.8043 3.19565217 657 180 198.8043 -18.80434783 658 221 209.6471 11.35294118 659 183 182.2292 0.77083333 660 191 185.6000 5.40000000 661 184 182.2292 1.77083333 662 168 167.6429 0.35714286 663 176 177.6744 -1.67441860 664 167 159.2400 7.76000000 665 170 177.7647 -7.76470588 666 199 209.6471 -10.64705882 667 214 197.6364 16.36363636 668 180 157.6000 22.40000000 669 174 185.6000 -11.60000000 670 162 162.8182 -0.81818182 671 192 198.8043 -6.80434783 672 178 167.6429 10.35714286 673 171 177.6744 -6.67441860 674 215 209.6471 5.35294118 675 189 187.8000 1.20000000 676 227 209.6471 17.35294118 677 168 167.6429 0.35714286 678 181 185.4500 -4.45000000 679 213 209.6471 3.35294118 680 200 198.8043 1.19565217 681 207 185.6000 21.40000000 682 156 186.7500 -30.75000000 683 177 198.3529 -21.35294118 684 182 174.8462 7.15384615 685 219 209.6471 9.35294118 686 175 182.2292 -7.22916667 687 161 174.1000 -13.10000000 688 190 189.4286 0.57142857 689 176 186.7500 -10.75000000 690 164 177.5938 -13.59375000 691 196 197.6364 -1.63636364 692 147 142.2000 4.80000000 693 158 158.7500 -0.75000000 694 135 154.2500 -19.25000000 695 170 183.0588 -13.05882353 696 172 183.0588 -11.05882353 697 190 185.6000 4.40000000 698 208 209.6471 -1.64705882 699 200 198.8043 1.19565217 700 189 187.8000 1.20000000 701 189 185.4500 3.55000000 702 140 154.2500 -14.25000000 703 193 198.3529 -5.35294118 704 147 174.1000 -27.10000000 705 188 198.3529 -10.35294118 706 191 186.6471 4.35294118 707 163 186.7500 -23.75000000 708 185 198.8043 -13.80434783 709 168 154.2500 13.75000000 710 154 165.8333 -11.83333333 711 188 182.2292 5.77083333 712 189 198.8043 -9.80434783 713 200 209.6471 -9.64705882 714 197 197.6364 -0.63636364 715 215 209.6471 5.35294118 716 171 198.8043 -27.80434783 717 211 209.6471 1.35294118 718 166 185.4500 -19.45000000 719 186 186.7500 -0.75000000 720 207 174.1000 32.90000000 721 189 177.5938 11.40625000 722 214 198.3529 15.64705882 723 169 159.2400 9.76000000 724 186 197.6364 -11.63636364 725 189 209.5556 -20.55555556 726 141 159.2400 -18.24000000 727 180 174.8462 5.15384615 728 99 142.2000 -43.20000000 729 194 189.4286 4.57142857 730 171 183.0588 -12.05882353 731 205 186.7500 18.25000000 732 141 130.2857 10.71428571 733 207 209.5556 -2.55555556 734 170 182.2292 -12.22916667 735 187 183.0588 3.94117647 736 188 186.9167 1.08333333 737 174 182.2292 -8.22916667 738 188 187.8000 0.20000000 739 172 157.6000 14.40000000 740 172 171.3200 0.68000000 741 163 174.8462 -11.84615385 742 158 154.2500 3.75000000 743 204 197.6364 6.36363636 744 163 162.8182 0.18181818 745 146 154.2500 -8.25000000 746 172 185.4500 -13.45000000 747 214 209.6471 4.35294118 748 172 167.6429 4.35714286 749 173 183.0588 -10.05882353 750 188 186.7500 1.25000000 751 202 198.8043 3.19565217 752 211 198.8043 12.19565217 753 185 191.2778 -6.27777778 754 173 174.1000 -1.10000000 755 186 174.1000 11.90000000 756 192 185.6000 6.40000000 757 219 209.6471 9.35294118 758 180 177.5938 2.40625000 759 159 174.8462 -15.84615385 760 210 185.4500 24.55000000 761 164 174.1000 -10.10000000 762 197 186.6471 10.35294118 763 164 186.9167 -22.91666667 764 175 182.2292 -7.22916667 765 179 198.8043 -19.80434783 766 137 157.6000 -20.60000000 767 198 198.3529 -0.35294118 768 177 186.6471 -9.64705882 769 214 209.6471 4.35294118 770 180 177.6744 2.32558140 771 210 197.6364 12.36363636 772 157 165.8333 -8.83333333 773 165 162.8182 2.18181818 774 197 198.8043 -1.80434783 775 200 186.6471 13.35294118 776 146 142.2000 3.80000000 777 172 174.1000 -2.10000000 778 203 198.3529 4.64705882 779 141 159.2500 -18.25000000 780 211 198.8043 12.19565217 781 165 167.0000 -2.00000000 782 169 172.9118 -3.91176471 783 163 170.5000 -7.50000000 784 157 162.8182 -5.81818182 785 176 182.2292 -6.22916667 786 181 189.4286 -8.42857143 787 163 167.6429 -4.64285714 788 143 155.4444 -12.44444444 789 165 182.2292 -17.22916667 790 148 167.6429 -19.64285714 791 167 165.8333 1.16666667 792 167 177.7647 -10.76470588 793 144 154.2500 -10.25000000 794 164 187.8000 -23.80000000 795 202 209.6471 -7.64705882 796 143 157.6000 -14.60000000 797 148 174.1000 -26.10000000 798 173 177.6744 -4.67441860 799 170 185.6000 -15.60000000 800 169 177.6744 -8.67441860 801 191 198.8043 -7.80434783 802 149 154.2500 -5.25000000 803 175 182.2292 -7.22916667 804 207 209.6471 -2.64705882 > 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/4628z1337240219.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/55nvi1337240219.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/63a0k1337240219.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/7lmsz1337240219.tab") + } > > try(system("convert tmp/2o85s1337240219.ps tmp/2o85s1337240219.png",intern=TRUE)) character(0) > try(system("convert tmp/3iza81337240219.ps tmp/3iza81337240219.png",intern=TRUE)) character(0) > try(system("convert tmp/4628z1337240219.ps tmp/4628z1337240219.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 18.025 0.405 18.619