R version 2.12.0 (2010-10-15) Copyright (C) 2010 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 = 'ATTLES connected' > par8 = 'ATTLES connected' > par7 = 'all' > par6 = 'all' > par5 = 'all' > par4 = 'no' > par3 = '3' > par2 = 'none' > par1 = '0' > par9 <- 'ATTLES connected' > par8 <- 'ATTLES connected' > 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] 34 38 38 30 27 37 31 34 38 34 28 38 36 36 40 34 38 36 32 36 37 30 34 32 [25] 35 38 31 32 37 36 32 36 38 38 39 27 39 36 34 35 29 33 35 32 33 32 37 37 [49] 37 39 31 31 33 37 36 32 41 34 38 32 32 32 39 33 34 39 39 37 40 39 32 34 [73] 30 33 41 31 35 33 44 29 34 38 39 37 28 34 41 32 29 39 33 37 38 35 34 37 [97] 35 31 32 33 37 30 29 43 32 31 37 31 33 38 39 32 32 34 30 30 33 35 37 33 [121] 40 36 32 31 29 37 39 37 37 34 35 37 38 33 30 32 33 42 38 35 35 28 32 36 [145] 36 34 31 38 35 36 35 32 33 38 38 35 32 31 28 36 36 37 30 36 32 24 33 21 [169] 16 31 39 36 32 30 30 38 34 34 26 21 35 39 35 32 35 36 34 19 36 27 34 34 [193] 32 37 38 33 37 30 24 22 30 36 36 30 26 33 36 31 34 37 33 37 35 31 35 26 [217] 27 38 36 28 41 33 32 34 35 29 36 32 29 38 40 34 34 38 32 38 33 34 37 34 [241] 32 37 34 33 34 35 32 28 32 31 32 35 33 35 37 35 38 34 35 21 36 24 34 21 [265] 33 41 41 30 34 31 27 34 38 39 22 32 29 33 30 39 39 33 32 32 30 35 31 33 [289] 27 28 33 35 36 34 29 34 31 38 38 31 35 36 40 31 33 37 36 34 33 30 29 38 [313] 39 40 37 43 30 34 36 43 32 36 47 35 37 40 27 40 35 36 33 35 44 37 35 40 [337] 32 43 42 39 36 39 37 39 36 36 26 36 43 36 42 43 35 32 40 36 31 47 34 28 [361] 33 36 39 36 25 32 37 36 34 44 30 37 32 33 41 40 32 39 35 34 41 37 32 41 [385] 36 30 44 40 43 35 33 24 26 39 40 35 40 36 35 37 32 33 31 37 35 37 32 38 [409] 46 43 32 35 34 38 29 38 40 34 36 40 26 39 34 47 40 35 40 41 34 37 36 37 [433] 33 38 36 37 38 32 32 33 38 29 28 39 33 29 37 37 31 40 45 44 42 41 38 39 [457] 29 37 39 38 42 40 30 42 37 35 36 34 39 33 44 39 29 30 40 37 35 33 34 35 [481] 39 37 38 42 34 39 40 36 34 42 41 33 30 34 36 33 35 37 31 35 42 36 39 39 [505] 38 37 37 32 32 43 31 44 35 30 38 32 34 38 33 37 42 49 38 30 35 42 31 40 [529] 30 32 35 35 39 34 34 37 37 34 41 38 37 36 35 40 38 37 38 37 30 33 36 27 [553] 36 38 28 39 41 33 33 31 39 37 36 39 33 41 33 27 30 33 45 38 43 35 36 40 [577] 39 36 37 23 33 40 34 35 48 43 38 30 32 34 36 28 40 36 36 38 34 41 41 27 [601] 41 40 40 38 26 35 34 39 40 40 28 37 39 35 36 36 35 37 34 38 37 33 35 39 [625] 40 36 34 39 36 38 39 40 41 38 44 37 39 35 38 42 31 39 37 35 39 35 27 41 [649] 38 37 39 45 29 35 38 37 35 43 31 39 40 40 31 28 38 40 42 40 26 27 33 38 [673] 43 40 36 39 47 35 35 34 42 31 38 33 40 37 36 37 36 38 41 33 40 30 35 32 [697] 38 43 25 35 38 37 37 33 30 32 37 38 30 38 35 38 32 34 36 28 40 36 36 36 [721] 37 29 40 35 36 41 40 40 36 34 22 39 35 40 38 35 36 35 36 26 35 36 34 33 [745] 35 32 39 49 36 41 38 37 35 35 36 40 42 37 45 42 39 36 32 39 32 38 41 36 [769] 37 35 35 39 39 39 42 25 35 38 42 34 26 34 26 33 41 38 32 32 34 26 44 42 [793] 38 34 37 34 40 37 32 37 35 29 39 35 34 34 24 38 42 38 26 34 37 39 36 39 [817] 29 33 36 32 34 33 36 40 36 35 36 37 27 43 32 36 38 44 34 31 28 39 38 39 [841] 37 39 34 38 29 42 22 40 33 37 39 43 40 33 45 36 41 37 30 40 40 32 36 36 [865] 37 31 48 39 24 42 36 39 43 34 36 42 46 38 36 29 32 43 38 47 34 37 36 37 [889] 36 36 38 39 37 34 35 38 33 38 41 41 39 38 34 29 34 34 45 36 36 38 35 33 [913] 39 32 40 42 38 34 38 37 38 41 37 38 36 33 33 36 35 31 36 33 34 34 30 35 [937] 36 32 41 42 38 38 37 33 30 43 41 30 38 40 35 35 37 33 35 35 42 40 33 37 [961] 38 26 41 42 41 34 32 34 40 36 35 36 32 46 29 44 39 33 34 41 34 36 38 33 [985] 38 32 41 38 41 32 29 31 21 34 30 37 30 18 31 48 33 36 37 37 48 > 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]) 16 18 19 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 1 1 1 5 4 1 6 3 14 13 15 24 38 36 71 71 87 88 102 93 38 39 40 41 42 43 44 45 46 47 48 49 93 69 56 36 27 19 11 6 3 5 4 2 > colnames(x) [1] "endo" "A1" "A2" "A3" "A4" "A5" "A6" "A7" "A8" "A9" [11] "A10" > colnames(x)[par1] [1] "endo" > x[,par1] [1] 34 38 38 30 27 37 31 34 38 34 28 38 36 36 40 34 38 36 32 36 37 30 34 32 [25] 35 38 31 32 37 36 32 36 38 38 39 27 39 36 34 35 29 33 35 32 33 32 37 37 [49] 37 39 31 31 33 37 36 32 41 34 38 32 32 32 39 33 34 39 39 37 40 39 32 34 [73] 30 33 41 31 35 33 44 29 34 38 39 37 28 34 41 32 29 39 33 37 38 35 34 37 [97] 35 31 32 33 37 30 29 43 32 31 37 31 33 38 39 32 32 34 30 30 33 35 37 33 [121] 40 36 32 31 29 37 39 37 37 34 35 37 38 33 30 32 33 42 38 35 35 28 32 36 [145] 36 34 31 38 35 36 35 32 33 38 38 35 32 31 28 36 36 37 30 36 32 24 33 21 [169] 16 31 39 36 32 30 30 38 34 34 26 21 35 39 35 32 35 36 34 19 36 27 34 34 [193] 32 37 38 33 37 30 24 22 30 36 36 30 26 33 36 31 34 37 33 37 35 31 35 26 [217] 27 38 36 28 41 33 32 34 35 29 36 32 29 38 40 34 34 38 32 38 33 34 37 34 [241] 32 37 34 33 34 35 32 28 32 31 32 35 33 35 37 35 38 34 35 21 36 24 34 21 [265] 33 41 41 30 34 31 27 34 38 39 22 32 29 33 30 39 39 33 32 32 30 35 31 33 [289] 27 28 33 35 36 34 29 34 31 38 38 31 35 36 40 31 33 37 36 34 33 30 29 38 [313] 39 40 37 43 30 34 36 43 32 36 47 35 37 40 27 40 35 36 33 35 44 37 35 40 [337] 32 43 42 39 36 39 37 39 36 36 26 36 43 36 42 43 35 32 40 36 31 47 34 28 [361] 33 36 39 36 25 32 37 36 34 44 30 37 32 33 41 40 32 39 35 34 41 37 32 41 [385] 36 30 44 40 43 35 33 24 26 39 40 35 40 36 35 37 32 33 31 37 35 37 32 38 [409] 46 43 32 35 34 38 29 38 40 34 36 40 26 39 34 47 40 35 40 41 34 37 36 37 [433] 33 38 36 37 38 32 32 33 38 29 28 39 33 29 37 37 31 40 45 44 42 41 38 39 [457] 29 37 39 38 42 40 30 42 37 35 36 34 39 33 44 39 29 30 40 37 35 33 34 35 [481] 39 37 38 42 34 39 40 36 34 42 41 33 30 34 36 33 35 37 31 35 42 36 39 39 [505] 38 37 37 32 32 43 31 44 35 30 38 32 34 38 33 37 42 49 38 30 35 42 31 40 [529] 30 32 35 35 39 34 34 37 37 34 41 38 37 36 35 40 38 37 38 37 30 33 36 27 [553] 36 38 28 39 41 33 33 31 39 37 36 39 33 41 33 27 30 33 45 38 43 35 36 40 [577] 39 36 37 23 33 40 34 35 48 43 38 30 32 34 36 28 40 36 36 38 34 41 41 27 [601] 41 40 40 38 26 35 34 39 40 40 28 37 39 35 36 36 35 37 34 38 37 33 35 39 [625] 40 36 34 39 36 38 39 40 41 38 44 37 39 35 38 42 31 39 37 35 39 35 27 41 [649] 38 37 39 45 29 35 38 37 35 43 31 39 40 40 31 28 38 40 42 40 26 27 33 38 [673] 43 40 36 39 47 35 35 34 42 31 38 33 40 37 36 37 36 38 41 33 40 30 35 32 [697] 38 43 25 35 38 37 37 33 30 32 37 38 30 38 35 38 32 34 36 28 40 36 36 36 [721] 37 29 40 35 36 41 40 40 36 34 22 39 35 40 38 35 36 35 36 26 35 36 34 33 [745] 35 32 39 49 36 41 38 37 35 35 36 40 42 37 45 42 39 36 32 39 32 38 41 36 [769] 37 35 35 39 39 39 42 25 35 38 42 34 26 34 26 33 41 38 32 32 34 26 44 42 [793] 38 34 37 34 40 37 32 37 35 29 39 35 34 34 24 38 42 38 26 34 37 39 36 39 [817] 29 33 36 32 34 33 36 40 36 35 36 37 27 43 32 36 38 44 34 31 28 39 38 39 [841] 37 39 34 38 29 42 22 40 33 37 39 43 40 33 45 36 41 37 30 40 40 32 36 36 [865] 37 31 48 39 24 42 36 39 43 34 36 42 46 38 36 29 32 43 38 47 34 37 36 37 [889] 36 36 38 39 37 34 35 38 33 38 41 41 39 38 34 29 34 34 45 36 36 38 35 33 [913] 39 32 40 42 38 34 38 37 38 41 37 38 36 33 33 36 35 31 36 33 34 34 30 35 [937] 36 32 41 42 38 38 37 33 30 43 41 30 38 40 35 35 37 33 35 35 42 40 33 37 [961] 38 26 41 42 41 34 32 34 40 36 35 36 32 46 29 44 39 33 34 41 34 36 38 33 [985] 38 32 41 38 41 32 29 31 21 34 30 37 30 18 31 48 33 36 37 37 48 > if (par2 == 'none') { + m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x) + } > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/1l6ci1335447822.tab") + } + } > m Conditional inference tree with 65 terminal nodes Response: endo Inputs: A1, A2, A3, A4, A5, A6, A7, A8, A9, A10 Number of observations: 1005 1) A8 <= 3; criterion = 1, statistic = 359.893 2) A6 <= 2; criterion = 1, statistic = 77.064 3) A1 <= 2; criterion = 1, statistic = 16.609 4)* weights = 15 3) A1 > 2 5) A7 <= 3; criterion = 0.998, statistic = 13.927 6) A8 <= 2; criterion = 0.97, statistic = 8.763 7)* weights = 11 6) A8 > 2 8)* weights = 9 5) A7 > 3 9)* weights = 9 2) A6 > 2 10) A3 <= 3; criterion = 1, statistic = 44.299 11) A7 <= 3; criterion = 0.999, statistic = 15.527 12) A10 <= 3; criterion = 0.994, statistic = 11.846 13)* weights = 14 12) A10 > 3 14)* weights = 10 11) A7 > 3 15) A4 <= 2; criterion = 1, statistic = 16.92 16)* weights = 20 15) A4 > 2 17)* weights = 18 10) A3 > 3 18) A2 <= 2; criterion = 1, statistic = 31.805 19) A9 <= 1; criterion = 0.992, statistic = 11.157 20)* weights = 11 19) A9 > 1 21)* weights = 27 18) A2 > 2 22) A5 <= 3; criterion = 1, statistic = 24.704 23)* weights = 19 22) A5 > 3 24) A1 <= 3; criterion = 1, statistic = 20.336 25)* weights = 18 24) A1 > 3 26) A7 <= 3; criterion = 1, statistic = 16.536 27)* weights = 11 26) A7 > 3 28) A3 <= 4; criterion = 0.953, statistic = 7.945 29)* weights = 14 28) A3 > 4 30)* weights = 10 1) A8 > 3 31) A7 <= 4; criterion = 1, statistic = 184.876 32) A4 <= 3; criterion = 1, statistic = 137.387 33) A1 <= 4; criterion = 1, statistic = 78.823 34) A6 <= 3; criterion = 1, statistic = 49.467 35) A5 <= 3; criterion = 0.998, statistic = 13.824 36) A10 <= 3; criterion = 0.996, statistic = 12.719 37)* weights = 14 36) A10 > 3 38)* weights = 15 35) A5 > 3 39) A9 <= 2; criterion = 0.997, statistic = 13.026 40)* weights = 24 39) A9 > 2 41)* weights = 12 34) A6 > 3 42) A3 <= 3; criterion = 1, statistic = 42.871 43) A9 <= 1; criterion = 0.999, statistic = 14.819 44)* weights = 9 43) A9 > 1 45) A1 <= 2; criterion = 0.997, statistic = 13.386 46)* weights = 13 45) A1 > 2 47) A7 <= 3; criterion = 0.955, statistic = 8.045 48)* weights = 19 47) A7 > 3 49) A2 <= 3; criterion = 0.963, statistic = 8.38 50)* weights = 12 49) A2 > 3 51)* weights = 11 42) A3 > 3 52) A7 <= 3; criterion = 1, statistic = 37.2 53) A2 <= 2; criterion = 1, statistic = 23.774 54) A10 <= 3; criterion = 0.964, statistic = 8.458 55)* weights = 12 54) A10 > 3 56)* weights = 16 53) A2 > 2 57) A3 <= 4; criterion = 0.991, statistic = 10.982 58)* weights = 26 57) A3 > 4 59)* weights = 14 52) A7 > 3 60) A2 <= 3; criterion = 0.998, statistic = 14.256 61) A5 <= 3; criterion = 0.998, statistic = 14.071 62)* weights = 16 61) A5 > 3 63) A9 <= 2; criterion = 0.999, statistic = 14.906 64)* weights = 10 63) A9 > 2 65)* weights = 21 60) A2 > 3 66) A3 <= 4; criterion = 0.996, statistic = 12.39 67)* weights = 29 66) A3 > 4 68)* weights = 7 33) A1 > 4 69) A7 <= 3; criterion = 1, statistic = 19.42 70) A9 <= 2; criterion = 0.975, statistic = 9.108 71)* weights = 17 70) A9 > 2 72)* weights = 10 69) A7 > 3 73) A9 <= 3; criterion = 0.977, statistic = 9.303 74) A5 <= 3; criterion = 0.967, statistic = 8.586 75)* weights = 14 74) A5 > 3 76)* weights = 25 73) A9 > 3 77)* weights = 9 32) A4 > 3 78) A1 <= 3; criterion = 1, statistic = 75.527 79) A6 <= 3; criterion = 1, statistic = 43.947 80) A1 <= 2; criterion = 0.962, statistic = 8.9 81)* weights = 13 80) A1 > 2 82)* weights = 17 79) A6 > 3 83) A9 <= 3; criterion = 1, statistic = 22.475 84) A2 <= 2; criterion = 0.996, statistic = 12.606 85)* weights = 10 84) A2 > 2 86) A3 <= 3; criterion = 0.999, statistic = 14.392 87)* weights = 19 86) A3 > 3 88) A10 <= 3; criterion = 0.997, statistic = 13.175 89)* weights = 7 88) A10 > 3 90)* weights = 30 83) A9 > 3 91)* weights = 20 78) A1 > 3 92) A2 <= 2; criterion = 1, statistic = 50.809 93) A5 <= 4; criterion = 1, statistic = 21.863 94) A9 <= 2; criterion = 0.996, statistic = 12.402 95)* weights = 19 94) A9 > 2 96)* weights = 11 93) A5 > 4 97)* weights = 17 92) A2 > 2 98) A10 <= 4; criterion = 1, statistic = 33.325 99) A9 <= 2; criterion = 1, statistic = 18.758 100)* weights = 35 99) A9 > 2 101) A3 <= 4; criterion = 1, statistic = 23.775 102) A6 <= 3; criterion = 0.999, statistic = 14.597 103)* weights = 12 102) A6 > 3 104) A3 <= 3; criterion = 0.982, statistic = 9.78 105)* weights = 10 104) A3 > 3 106)* weights = 29 101) A3 > 4 107)* weights = 15 98) A10 > 4 108) A8 <= 4; criterion = 0.991, statistic = 10.972 109)* weights = 16 108) A8 > 4 110)* weights = 19 31) A7 > 4 111) A9 <= 2; criterion = 1, statistic = 53.599 112) A3 <= 3; criterion = 0.997, statistic = 12.949 113)* weights = 7 112) A3 > 3 114) A9 <= 1; criterion = 0.965, statistic = 8.523 115)* weights = 9 114) A9 > 1 116) A8 <= 4; criterion = 0.951, statistic = 7.862 117)* weights = 17 116) A8 > 4 118)* weights = 8 111) A9 > 2 119) A4 <= 4; criterion = 1, statistic = 34.548 120) A3 <= 4; criterion = 1, statistic = 19.244 121) A6 <= 4; criterion = 1, statistic = 17.858 122) A8 <= 4; criterion = 0.987, statistic = 10.281 123)* weights = 18 122) A8 > 4 124)* weights = 14 121) A6 > 4 125)* weights = 21 120) A3 > 4 126) A2 <= 3; criterion = 0.972, statistic = 8.92 127)* weights = 7 126) A2 > 3 128)* weights = 15 119) A4 > 4 129)* weights = 19 > postscript(file="/var/www/rcomp/tmp/2w1jx1335447822.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/www/rcomp/tmp/36c351335447822.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 34 33.93750 0.06250000 2 38 36.21429 1.78571429 3 38 37.43333 0.56666667 4 30 32.59259 -2.59259259 5 27 32.59259 -5.59259259 6 37 36.50000 0.50000000 7 31 28.64286 2.35714286 8 34 32.59259 1.40740741 9 38 38.52941 -0.52941176 10 34 37.25714 -3.25714286 11 28 30.45000 -2.45000000 12 38 38.52941 -0.52941176 13 36 33.72222 2.27777778 14 36 33.93750 2.06250000 15 40 37.43333 2.56666667 16 34 34.30769 -0.30769231 17 38 37.25714 0.74285714 18 36 34.30769 1.69230769 19 32 32.12500 -0.12500000 20 36 34.30769 1.69230769 21 37 40.44444 -3.44444444 22 30 29.77778 0.22222222 23 34 34.20000 -0.20000000 24 32 31.23077 0.76923077 25 35 34.10526 0.89473684 26 38 32.59259 5.40740741 27 31 33.93750 -2.93750000 28 32 29.77778 2.22222222 29 37 36.86207 0.13793103 30 36 32.59259 3.40740741 31 32 32.59259 -0.59259259 32 36 37.64706 -1.64705882 33 38 36.57143 1.42857143 34 38 37.25714 0.74285714 35 39 39.24138 -0.24137931 36 27 28.64286 -1.64285714 37 39 36.86207 2.13793103 38 36 36.10000 -0.10000000 39 34 32.53333 1.46666667 40 35 30.45000 4.55000000 41 29 31.00000 -2.00000000 42 33 32.12500 0.87500000 43 35 36.21429 -1.21428571 44 32 32.59259 -0.59259259 45 33 33.93750 -0.93750000 46 32 32.59259 -0.59259259 47 37 38.00000 -1.00000000 48 37 34.20000 2.80000000 49 37 36.86207 0.13793103 50 39 36.21429 2.78571429 51 31 34.05882 -3.05882353 52 31 32.12500 -1.12500000 53 33 29.77778 3.22222222 54 37 36.21429 0.78571429 55 36 32.59259 3.40740741 56 32 31.00000 1.00000000 57 41 40.44444 0.55555556 58 34 34.05882 -0.05882353 59 38 40.42857 -2.42857143 60 32 33.93750 -1.93750000 61 32 33.66667 -1.66666667 62 32 32.12500 -0.12500000 63 39 36.57143 2.42857143 64 33 33.25000 -0.25000000 65 34 33.93750 0.06250000 66 39 36.50000 2.50000000 67 39 37.64706 1.35294118 68 37 37.55556 -0.55555556 69 40 42.68421 -2.68421053 70 39 38.40000 0.60000000 71 32 32.53333 -0.53333333 72 34 34.10526 -0.10526316 73 30 34.10526 -4.10526316 74 33 32.59259 0.40740741 75 41 40.76190 0.23809524 76 31 32.12500 -1.12500000 77 35 34.10526 0.89473684 78 33 32.53333 0.46666667 79 44 40.93333 3.06666667 80 29 28.64286 0.35714286 81 34 33.00000 1.00000000 82 38 33.72222 4.27777778 83 39 37.00000 2.00000000 84 37 34.30769 2.69230769 85 28 29.45455 -1.45454545 86 34 32.12500 1.87500000 87 41 39.87500 1.12500000 88 32 33.66667 -1.66666667 89 29 31.00000 -2.00000000 90 39 39.75000 -0.75000000 91 33 34.00000 -1.00000000 92 37 38.52941 -1.52941176 93 38 38.40000 -0.40000000 94 35 36.86207 -1.86206897 95 34 33.25000 0.75000000 96 37 37.64706 -0.64705882 97 35 34.20000 0.80000000 98 31 33.00000 -2.00000000 99 32 33.31579 -1.31578947 100 33 33.57143 -0.57142857 101 37 36.50000 0.50000000 102 30 30.45000 -0.45000000 103 29 31.00000 -2.00000000 104 43 44.00000 -1.00000000 105 32 29.77778 2.22222222 106 31 32.53333 -1.53333333 107 37 37.43333 -0.43333333 108 31 31.00000 0.00000000 109 33 33.66667 -0.66666667 110 38 36.10000 1.90000000 111 39 40.44444 -1.44444444 112 32 33.00000 -1.00000000 113 32 33.72222 -1.72222222 114 34 37.25714 -3.25714286 115 30 30.45000 -0.45000000 116 30 32.59259 -2.59259259 117 33 28.64286 4.35714286 118 35 33.93750 1.06250000 119 37 36.10000 0.90000000 120 33 33.00000 0.00000000 121 40 39.24138 0.75862069 122 36 36.86207 -0.86206897 123 32 32.59259 -0.59259259 124 31 32.22222 -1.22222222 125 29 29.45455 -0.45454545 126 37 33.72222 3.27777778 127 39 35.28571 3.71428571 128 37 36.57143 0.42857143 129 37 39.87500 -2.87500000 130 34 37.55556 -3.55555556 131 35 37.00000 -2.00000000 132 37 32.59259 4.40740741 133 38 35.09091 2.90909091 134 33 34.30769 -1.30769231 135 30 32.12500 -2.12500000 136 32 29.45455 2.54545455 137 33 34.30769 -1.30769231 138 42 40.42857 1.57142857 139 38 34.75000 3.25000000 140 35 34.00000 1.00000000 141 35 36.50000 -1.50000000 142 28 30.45000 -2.45000000 143 32 30.45000 1.55000000 144 36 40.93333 -4.93333333 145 36 36.86207 -0.86206897 146 34 34.10000 -0.10000000 147 31 33.00000 -2.00000000 148 38 39.75000 -1.75000000 149 35 33.72222 1.27777778 150 36 36.57143 -0.57142857 151 35 32.22222 2.77777778 152 32 33.00000 -1.00000000 153 33 32.12500 0.87500000 154 38 35.88889 2.11111111 155 38 37.64706 0.35294118 156 35 33.25000 1.75000000 157 32 30.45000 1.55000000 158 31 30.45000 0.55000000 159 28 29.77778 -1.77777778 160 36 34.30769 1.69230769 161 36 34.00000 2.00000000 162 37 35.09091 1.90909091 163 30 29.45455 0.54545455 164 36 37.25714 -1.25714286 165 32 31.00000 1.00000000 166 24 23.66667 0.33333333 167 33 32.12500 0.87500000 168 21 23.66667 -2.66666667 169 16 23.66667 -7.66666667 170 31 31.00000 0.00000000 171 39 39.92857 -0.92857143 172 36 39.24138 -3.24137931 173 32 36.86207 -4.86206897 174 30 32.12500 -2.12500000 175 30 30.45000 -0.45000000 176 38 38.00000 0.00000000 177 34 34.20000 -0.20000000 178 34 35.88889 -1.88888889 179 26 23.66667 2.33333333 180 21 24.63636 -3.63636364 181 35 36.86207 -1.86206897 182 39 38.40000 0.60000000 183 35 36.21429 -1.21428571 184 32 33.25000 -1.25000000 185 35 34.20000 0.80000000 186 36 38.40000 -2.40000000 187 34 32.12500 1.87500000 188 19 23.66667 -4.66666667 189 36 36.21429 -0.21428571 190 27 32.12500 -5.12500000 191 34 34.10526 -0.10526316 192 34 34.00000 0.00000000 193 32 32.12500 -0.12500000 194 37 33.00000 4.00000000 195 38 36.50000 1.50000000 196 33 33.31579 -0.31578947 197 37 37.00000 0.00000000 198 30 30.45000 -0.45000000 199 24 24.63636 -0.63636364 200 22 24.63636 -2.63636364 201 30 32.53333 -2.53333333 202 36 33.25000 2.75000000 203 36 35.09091 0.90909091 204 30 31.00000 -1.00000000 205 26 29.77778 -3.77777778 206 33 32.53333 0.46666667 207 36 34.10526 1.89473684 208 31 33.00000 -2.00000000 209 34 35.09091 -1.09090909 210 37 36.86207 0.13793103 211 33 32.59259 0.40740741 212 37 33.93750 3.06250000 213 35 36.57143 -1.57142857 214 31 33.31579 -2.31578947 215 35 36.57143 -1.57142857 216 26 28.64286 -2.64285714 217 27 30.45000 -3.45000000 218 38 38.00000 0.00000000 219 36 34.10000 1.90000000 220 28 31.23077 -3.23076923 221 41 40.44444 0.55555556 222 33 36.10000 -3.10000000 223 32 34.30769 -2.30769231 224 34 33.66667 0.33333333 225 35 33.31579 1.68421053 226 29 31.23077 -2.23076923 227 36 36.50000 -0.50000000 228 32 31.00000 1.00000000 229 29 33.25000 -4.25000000 230 38 37.00000 1.00000000 231 40 38.00000 2.00000000 232 34 36.21429 -2.21428571 233 34 32.59259 1.40740741 234 38 37.25714 0.74285714 235 32 33.57143 -1.57142857 236 38 39.85714 -1.85714286 237 33 34.20000 -1.20000000 238 34 34.00000 0.00000000 239 37 34.00000 3.00000000 240 34 32.12500 1.87500000 241 32 31.00000 1.00000000 242 37 37.64706 -0.64705882 243 34 33.31579 0.68421053 244 33 34.05882 -1.05882353 245 34 31.23077 2.76923077 246 35 32.59259 2.40740741 247 32 32.12500 -0.12500000 248 28 28.64286 -0.64285714 249 32 32.53333 -0.53333333 250 31 34.20000 -3.20000000 251 32 33.93750 -1.93750000 252 35 33.93750 1.06250000 253 33 33.31579 -0.31578947 254 35 33.72222 1.27777778 255 37 38.00000 -1.00000000 256 35 37.25714 -2.25714286 257 38 40.44444 -2.44444444 258 34 35.63636 -1.63636364 259 35 34.10526 0.89473684 260 21 26.92857 -5.92857143 261 36 37.00000 -1.00000000 262 24 28.64286 -4.64285714 263 34 33.25000 0.75000000 264 21 23.66667 -2.66666667 265 33 33.93750 -0.93750000 266 41 44.00000 -3.00000000 267 41 40.76190 0.23809524 268 30 28.64286 1.35714286 269 34 34.10526 -0.10526316 270 31 29.77778 1.22222222 271 27 28.64286 -1.64285714 272 34 33.00000 1.00000000 273 38 37.64706 0.35294118 274 39 37.43333 1.56666667 275 22 24.63636 -2.63636364 276 32 34.10526 -2.10526316 277 29 30.45000 -1.45000000 278 33 32.59259 0.40740741 279 30 34.00000 -4.00000000 280 39 36.86207 2.13793103 281 39 39.24138 -0.24137931 282 33 33.93750 -0.93750000 283 32 31.23077 0.76923077 284 32 31.00000 1.00000000 285 30 28.64286 1.35714286 286 35 34.10526 0.89473684 287 31 30.45000 0.55000000 288 33 29.45455 3.54545455 289 27 28.88889 -1.88888889 290 28 26.92857 1.07142857 291 33 32.59259 0.40740741 292 35 36.21429 -1.21428571 293 36 36.21429 -0.21428571 294 34 34.30769 -0.30769231 295 29 35.28571 -6.28571429 296 34 32.59259 1.40740741 297 31 30.45000 0.55000000 298 38 37.25714 0.74285714 299 38 37.00000 1.00000000 300 31 32.53333 -1.53333333 301 35 36.86207 -1.86206897 302 36 36.50000 -0.50000000 303 40 37.64706 2.35294118 304 31 32.59259 -1.59259259 305 33 32.53333 0.46666667 306 37 34.30769 2.69230769 307 36 37.00000 -1.00000000 308 34 35.88889 -1.88888889 309 33 32.12500 0.87500000 310 30 33.25000 -3.25000000 311 29 32.59259 -3.59259259 312 38 40.76190 -2.76190476 313 39 39.85714 -0.85714286 314 40 38.52941 1.47058824 315 37 36.81818 0.18181818 316 43 40.44444 2.55555556 317 30 28.88889 1.11111111 318 34 32.22222 1.77777778 319 36 36.81818 -0.81818182 320 43 40.93333 2.06666667 321 32 34.10000 -2.10000000 322 36 38.00000 -2.00000000 323 47 45.21053 1.78947368 324 35 37.25714 -2.25714286 325 37 35.09091 1.90909091 326 40 38.00000 2.00000000 327 27 29.45455 -2.45454545 328 40 37.25714 2.74285714 329 35 36.10000 -1.10000000 330 36 36.21429 -0.21428571 331 33 33.00000 0.00000000 332 35 38.00000 -3.00000000 333 44 44.00000 0.00000000 334 37 37.55556 -0.55555556 335 35 33.00000 2.00000000 336 40 39.24138 0.75862069 337 32 29.45455 2.54545455 338 43 45.21053 -2.21052632 339 42 38.52941 3.47058824 340 39 37.90000 1.10000000 341 36 35.88889 0.11111111 342 39 37.64706 1.35294118 343 37 38.00000 -1.00000000 344 39 38.00000 1.00000000 345 36 37.25714 -1.25714286 346 36 37.00000 -1.00000000 347 26 33.57143 -7.57142857 348 36 35.88889 0.11111111 349 43 38.52941 4.47058824 350 36 33.31579 2.68421053 351 42 38.00000 4.00000000 352 43 44.00000 -1.00000000 353 35 37.55556 -2.55555556 354 32 30.45000 1.55000000 355 40 37.64706 2.35294118 356 36 34.10526 1.89473684 357 31 34.11765 -3.11764706 358 47 42.68421 4.31578947 359 34 32.59259 1.40740741 360 28 28.88889 -0.88888889 361 33 34.30769 -1.30769231 362 36 36.21429 -0.21428571 363 39 36.57143 2.42857143 364 36 36.86207 -0.86206897 365 25 24.63636 0.36363636 366 32 34.30769 -2.30769231 367 37 38.52941 -1.52941176 368 36 37.43333 -1.43333333 369 34 34.05882 -0.05882353 370 44 44.00000 0.00000000 371 30 30.45000 -0.45000000 372 37 34.10526 2.89473684 373 32 33.25000 -1.25000000 374 33 34.05882 -1.05882353 375 41 42.68421 -1.68421053 376 40 40.44444 -0.44444444 377 32 33.66667 -1.66666667 378 39 37.00000 2.00000000 379 35 34.30769 0.69230769 380 34 38.00000 -4.00000000 381 41 39.24138 1.75862069 382 37 38.00000 -1.00000000 383 32 34.30769 -2.30769231 384 41 39.87500 1.12500000 385 36 36.81818 -0.81818182 386 30 28.64286 1.35714286 387 44 42.68421 1.31578947 388 40 38.52941 1.47058824 389 43 40.42857 2.57142857 390 35 34.05882 0.94117647 391 33 36.21429 -3.21428571 392 24 26.92857 -2.92857143 393 26 29.77778 -3.77777778 394 39 38.00000 1.00000000 395 40 36.81818 3.18181818 396 35 37.43333 -2.43333333 397 40 39.24138 0.75862069 398 36 34.05882 1.94117647 399 35 35.28571 -0.28571429 400 37 36.10000 0.90000000 401 32 34.10000 -2.10000000 402 33 31.23077 1.76923077 403 31 32.22222 -1.22222222 404 37 33.25000 3.75000000 405 35 33.25000 1.75000000 406 37 37.00000 0.00000000 407 32 33.72222 -1.72222222 408 38 37.25714 0.74285714 409 46 45.21053 0.78947368 410 43 36.10000 6.90000000 411 32 36.57143 -4.57142857 412 35 37.00000 -2.00000000 413 34 34.10526 -0.10526316 414 38 38.52941 -0.52941176 415 29 31.00000 -2.00000000 416 38 37.00000 1.00000000 417 40 38.00000 2.00000000 418 34 34.05882 -0.05882353 419 36 33.57143 2.42857143 420 40 40.93333 -0.93333333 421 26 29.45455 -3.45454545 422 39 39.24138 -0.24137931 423 34 36.10000 -2.10000000 424 47 45.21053 1.78947368 425 40 35.88889 4.11111111 426 35 34.30769 0.69230769 427 40 39.75000 0.25000000 428 41 39.92857 1.07142857 429 34 32.12500 1.87500000 430 37 36.57143 0.42857143 431 36 34.10526 1.89473684 432 37 38.52941 -1.52941176 433 33 33.25000 -0.25000000 434 38 37.25714 0.74285714 435 36 36.50000 -0.50000000 436 37 38.00000 -1.00000000 437 38 37.55556 0.44444444 438 32 34.05882 -2.05882353 439 32 34.10000 -2.10000000 440 33 34.20000 -1.20000000 441 38 39.24138 -1.24137931 442 29 30.45000 -1.45000000 443 28 31.00000 -3.00000000 444 39 37.25714 1.74285714 445 33 31.00000 2.00000000 446 29 29.45455 -0.45454545 447 37 36.50000 0.50000000 448 37 38.52941 -1.52941176 449 31 29.45455 1.54545455 450 40 40.76190 -0.76190476 451 45 45.21053 -0.21052632 452 44 44.00000 0.00000000 453 42 42.68421 -0.68421053 454 41 40.76190 0.23809524 455 38 38.52941 -0.52941176 456 39 38.52941 0.47058824 457 29 24.63636 4.36363636 458 37 37.55556 -0.55555556 459 39 34.05882 4.94117647 460 38 38.40000 -0.40000000 461 42 40.93333 1.06666667 462 40 40.76190 -0.76190476 463 30 34.05882 -4.05882353 464 42 40.76190 1.23809524 465 37 35.88889 1.11111111 466 35 35.88889 -0.88888889 467 36 34.10000 1.90000000 468 34 35.09091 -1.09090909 469 39 38.00000 1.00000000 470 33 33.25000 -0.25000000 471 44 45.21053 -1.21052632 472 39 38.52941 0.47058824 473 29 33.00000 -4.00000000 474 30 26.92857 3.07142857 475 40 39.24138 0.75862069 476 37 38.52941 -1.52941176 477 35 34.20000 0.80000000 478 33 32.22222 0.77777778 479 34 34.05882 -0.05882353 480 35 33.93750 1.06250000 481 39 40.76190 -1.76190476 482 37 38.00000 -1.00000000 483 38 38.52941 -0.52941176 484 42 40.93333 1.06666667 485 34 34.05882 -0.05882353 486 39 38.40000 0.60000000 487 40 37.25714 2.74285714 488 36 36.57143 -0.57142857 489 34 33.93750 0.06250000 490 42 39.24138 2.75862069 491 41 36.21429 4.78571429 492 33 32.59259 0.40740741 493 30 32.53333 -2.53333333 494 34 34.00000 0.00000000 495 36 31.00000 5.00000000 496 33 34.10526 -1.10526316 497 35 34.20000 0.80000000 498 37 38.52941 -1.52941176 499 31 33.72222 -2.72222222 500 35 38.85000 -3.85000000 501 42 40.76190 1.23809524 502 36 36.81818 -0.81818182 503 39 37.25714 1.74285714 504 39 40.42857 -1.42857143 505 38 36.57143 1.42857143 506 37 36.86207 0.13793103 507 37 34.10526 2.89473684 508 32 33.66667 -1.66666667 509 32 34.10526 -2.10526316 510 43 44.00000 -1.00000000 511 31 30.45000 0.55000000 512 44 44.00000 0.00000000 513 35 36.86207 -1.86206897 514 30 24.63636 5.36363636 515 38 39.85714 -1.85714286 516 32 32.12500 -0.12500000 517 34 36.81818 -2.81818182 518 38 36.10000 1.90000000 519 33 32.12500 0.87500000 520 37 38.00000 -1.00000000 521 42 44.00000 -2.00000000 522 49 42.68421 6.31578947 523 38 37.25714 0.74285714 524 30 31.00000 -1.00000000 525 35 33.25000 1.75000000 526 42 44.00000 -2.00000000 527 31 33.31579 -2.31578947 528 40 40.42857 -0.42857143 529 30 36.10000 -6.10000000 530 32 32.59259 -0.59259259 531 35 34.05882 0.94117647 532 35 31.23077 3.76923077 533 39 39.87500 -0.87500000 534 34 33.25000 0.75000000 535 34 32.12500 1.87500000 536 37 38.00000 -1.00000000 537 37 37.64706 -0.64705882 538 34 35.63636 -1.63636364 539 41 39.87500 1.12500000 540 38 38.00000 0.00000000 541 37 34.00000 3.00000000 542 36 33.66667 2.33333333 543 35 33.00000 2.00000000 544 40 39.24138 0.75862069 545 38 38.40000 -0.40000000 546 37 37.64706 -0.64705882 547 38 37.00000 1.00000000 548 37 34.05882 2.94117647 549 30 26.92857 3.07142857 550 33 34.05882 -1.05882353 551 36 38.85000 -2.85000000 552 27 29.45455 -2.45454545 553 36 38.00000 -2.00000000 554 38 40.93333 -2.93333333 555 28 28.64286 -0.64285714 556 39 39.87500 -0.87500000 557 41 39.75000 1.25000000 558 33 35.10526 -2.10526316 559 33 34.10000 -1.10000000 560 31 31.00000 0.00000000 561 39 37.43333 1.56666667 562 37 37.43333 -0.43333333 563 36 36.81818 -0.81818182 564 39 37.64706 1.35294118 565 33 30.45000 2.55000000 566 41 40.76190 0.23809524 567 33 31.00000 2.00000000 568 27 26.92857 0.07142857 569 30 31.46154 -1.46153846 570 33 34.75000 -1.75000000 571 45 40.76190 4.23809524 572 38 37.25714 0.74285714 573 43 42.68421 0.31578947 574 35 35.10526 -0.10526316 575 36 37.55556 -1.55555556 576 40 37.55556 2.44444444 577 39 37.00000 2.00000000 578 36 36.50000 -0.50000000 579 37 36.91667 0.08333333 580 23 26.92857 -3.92857143 581 33 35.09091 -2.09090909 582 40 37.55556 2.44444444 583 34 34.00000 0.00000000 584 35 37.25714 -2.25714286 585 48 45.21053 2.78947368 586 43 42.68421 0.31578947 587 38 37.43333 0.56666667 588 30 28.88889 1.11111111 589 32 33.00000 -1.00000000 590 34 34.30769 -0.30769231 591 36 37.25714 -1.25714286 592 28 28.88889 -0.88888889 593 40 38.85000 1.15000000 594 36 31.46154 4.53846154 595 36 37.00000 -1.00000000 596 38 37.64706 0.35294118 597 34 33.66667 0.33333333 598 41 42.68421 -1.68421053 599 41 40.93333 0.06666667 600 27 28.64286 -1.64285714 601 41 37.25714 3.74285714 602 40 40.76190 -0.76190476 603 40 38.85000 1.15000000 604 38 37.55556 0.44444444 605 26 31.46154 -5.46153846 606 35 36.91667 -1.91666667 607 34 31.46154 2.53846154 608 39 39.24138 -0.24137931 609 40 38.85000 1.15000000 610 40 37.43333 2.56666667 611 28 28.88889 -0.88888889 612 37 37.64706 -0.64705882 613 39 39.24138 -0.24137931 614 35 34.00000 1.00000000 615 36 36.50000 -0.50000000 616 36 37.43333 -1.43333333 617 35 37.43333 -2.43333333 618 37 38.85000 -1.85000000 619 34 33.93750 0.06250000 620 38 38.85000 -0.85000000 621 37 39.24138 -2.24137931 622 33 33.31579 -0.31578947 623 35 35.10526 -0.10526316 624 39 39.24138 -0.24137931 625 40 38.85000 1.15000000 626 36 36.21429 -0.21428571 627 34 33.66667 0.33333333 628 39 36.86207 2.13793103 629 36 37.90000 -1.90000000 630 38 37.43333 0.56666667 631 39 42.68421 -3.68421053 632 40 39.85714 0.14285714 633 41 40.93333 0.06666667 634 38 34.11765 3.88235294 635 44 40.76190 3.23809524 636 37 37.43333 -0.43333333 637 39 40.93333 -1.93333333 638 35 35.10526 -0.10526316 639 38 39.92857 -1.92857143 640 42 45.21053 -3.21052632 641 31 34.30769 -3.30769231 642 39 39.24138 -0.24137931 643 37 37.25714 -0.25714286 644 35 36.91667 -1.91666667 645 39 39.92857 -0.92857143 646 35 34.75000 0.25000000 647 27 26.92857 0.07142857 648 41 38.85000 2.15000000 649 38 37.00000 1.00000000 650 37 35.10526 1.89473684 651 39 37.55556 1.44444444 652 45 40.44444 4.55555556 653 29 31.00000 -2.00000000 654 35 33.93750 1.06250000 655 38 37.90000 0.10000000 656 37 37.00000 0.00000000 657 35 34.11765 0.88235294 658 43 39.92857 3.07142857 659 31 23.66667 7.33333333 660 39 38.85000 0.15000000 661 40 39.92857 0.07142857 662 40 36.86207 3.13793103 663 31 28.64286 2.35714286 664 28 31.46154 -3.46153846 665 38 38.85000 -0.85000000 666 40 40.93333 -0.93333333 667 42 40.93333 1.06666667 668 40 38.00000 2.00000000 669 26 31.23077 -5.23076923 670 27 26.92857 0.07142857 671 33 31.46154 1.53846154 672 38 39.92857 -1.92857143 673 43 45.21053 -2.21052632 674 40 39.92857 0.07142857 675 36 33.57143 2.42857143 676 39 39.24138 -0.24137931 677 47 44.00000 3.00000000 678 35 33.66667 1.33333333 679 35 34.11765 0.88235294 680 34 35.10526 -1.10526316 681 42 39.92857 2.07142857 682 31 32.53333 -1.53333333 683 38 31.46154 6.53846154 684 33 34.10000 -1.10000000 685 40 37.43333 2.56666667 686 37 34.00000 3.00000000 687 36 35.28571 0.71428571 688 37 37.43333 -0.43333333 689 36 36.81818 -0.81818182 690 38 36.81818 1.18181818 691 41 40.76190 0.23809524 692 33 31.00000 2.00000000 693 40 39.87500 0.12500000 694 30 31.46154 -1.46153846 695 35 34.75000 0.25000000 696 32 34.00000 -2.00000000 697 38 37.25714 0.74285714 698 43 42.68421 0.31578947 699 25 24.63636 0.36363636 700 35 34.75000 0.25000000 701 38 37.43333 0.56666667 702 37 36.91667 0.08333333 703 37 36.86207 0.13793103 704 33 35.09091 -2.09090909 705 30 29.77778 0.22222222 706 32 33.00000 -1.00000000 707 37 37.43333 -0.43333333 708 38 39.92857 -1.92857143 709 30 32.59259 -2.59259259 710 38 37.43333 0.56666667 711 35 32.53333 2.46666667 712 38 37.43333 0.56666667 713 32 33.00000 -1.00000000 714 34 35.10526 -1.10526316 715 36 37.25714 -1.25714286 716 28 28.88889 -0.88888889 717 40 38.85000 1.15000000 718 36 31.46154 4.53846154 719 36 37.00000 -1.00000000 720 36 34.75000 1.25000000 721 37 34.11765 2.88235294 722 29 32.59259 -3.59259259 723 40 39.87500 0.12500000 724 35 34.10000 0.90000000 725 36 36.86207 -0.86206897 726 41 37.25714 3.74285714 727 40 40.76190 -0.76190476 728 40 38.85000 1.15000000 729 36 36.86207 -0.86206897 730 34 34.11765 -0.11764706 731 22 26.92857 -4.92857143 732 39 38.85000 0.15000000 733 35 37.00000 -2.00000000 734 40 40.44444 -0.44444444 735 38 36.91667 1.08333333 736 35 37.55556 -2.55555556 737 36 35.10526 0.89473684 738 35 34.00000 1.00000000 739 36 37.25714 -1.25714286 740 26 23.66667 2.33333333 741 35 37.43333 -2.43333333 742 36 37.25714 -1.25714286 743 34 34.30769 -0.30769231 744 33 33.31579 -0.31578947 745 35 35.10526 -0.10526316 746 32 31.46154 0.53846154 747 39 39.75000 -0.75000000 748 49 45.21053 3.78947368 749 36 36.50000 -0.50000000 750 41 39.85714 1.14285714 751 38 39.24138 -1.24137931 752 37 37.25714 -0.25714286 753 35 38.85000 -3.85000000 754 35 36.91667 -1.91666667 755 36 37.00000 -1.00000000 756 40 40.76190 -0.76190476 757 42 45.21053 -3.21052632 758 37 37.55556 -0.55555556 759 45 40.93333 4.06666667 760 42 40.76190 1.23809524 761 39 38.00000 1.00000000 762 36 33.57143 2.42857143 763 32 34.11765 -2.11764706 764 39 39.87500 -0.87500000 765 32 34.00000 -2.00000000 766 38 36.86207 1.13793103 767 41 39.24138 1.75862069 768 36 33.57143 2.42857143 769 37 35.63636 1.36363636 770 35 35.10526 -0.10526316 771 35 36.91667 -1.91666667 772 39 39.24138 -0.24137931 773 39 37.43333 1.56666667 774 39 42.68421 -3.68421053 775 42 42.68421 -0.68421053 776 25 31.46154 -6.46153846 777 35 34.30769 0.69230769 778 38 36.57143 1.42857143 779 42 39.85714 2.14285714 780 34 35.63636 -1.63636364 781 26 24.63636 1.36363636 782 34 35.63636 -1.63636364 783 26 23.66667 2.33333333 784 33 32.12500 0.87500000 785 41 39.87500 1.12500000 786 38 37.25714 0.74285714 787 32 33.00000 -1.00000000 788 32 28.88889 3.11111111 789 34 35.63636 -1.63636364 790 26 26.92857 -0.92857143 791 44 45.21053 -1.21052632 792 42 38.40000 3.60000000 793 38 36.86207 1.13793103 794 34 34.00000 0.00000000 795 37 36.91667 0.08333333 796 34 34.11765 -0.11764706 797 40 37.43333 2.56666667 798 37 37.43333 -0.43333333 799 32 33.72222 -1.72222222 800 37 35.63636 1.36363636 801 35 33.00000 2.00000000 802 29 31.46154 -2.46153846 803 39 37.55556 1.44444444 804 35 35.63636 -0.63636364 805 34 34.11765 -0.11764706 806 34 34.75000 -0.75000000 807 24 23.66667 0.33333333 808 38 39.24138 -1.24137931 809 42 39.24138 2.75862069 810 38 36.86207 1.13793103 811 26 24.63636 1.36363636 812 34 34.30769 -0.30769231 813 37 35.63636 1.36363636 814 39 39.92857 -0.92857143 815 36 36.57143 -0.57142857 816 39 36.86207 2.13793103 817 29 31.23077 -2.23076923 818 33 31.23077 1.76923077 819 36 36.81818 -0.81818182 820 32 34.10526 -2.10526316 821 34 34.30769 -0.30769231 822 33 33.31579 -0.31578947 823 36 36.50000 -0.50000000 824 40 40.93333 -0.93333333 825 36 37.43333 -1.43333333 826 35 34.05882 0.94117647 827 36 34.11765 1.88235294 828 37 34.30769 2.69230769 829 27 26.92857 0.07142857 830 43 42.68421 0.31578947 831 32 33.72222 -1.72222222 832 36 33.31579 2.68421053 833 38 37.90000 0.10000000 834 44 45.21053 -1.21052632 835 34 33.72222 0.27777778 836 31 32.12500 -1.12500000 837 28 33.31579 -5.31578947 838 39 39.24138 -0.24137931 839 38 37.43333 0.56666667 840 39 38.40000 0.60000000 841 37 36.86207 0.13793103 842 39 39.75000 -0.75000000 843 34 35.09091 -1.09090909 844 38 36.86207 1.13793103 845 29 34.00000 -5.00000000 846 42 38.85000 3.15000000 847 22 23.66667 -1.66666667 848 40 39.24138 0.75862069 849 33 32.12500 0.87500000 850 37 37.43333 -0.43333333 851 39 37.90000 1.10000000 852 43 45.21053 -2.21052632 853 40 40.76190 -0.76190476 854 33 33.31579 -0.31578947 855 45 42.68421 2.31578947 856 36 38.40000 -2.40000000 857 41 38.00000 3.00000000 858 37 36.86207 0.13793103 859 30 33.72222 -3.72222222 860 40 39.24138 0.75862069 861 40 40.76190 -0.76190476 862 32 31.23077 0.76923077 863 36 37.25714 -1.25714286 864 36 36.86207 -0.86206897 865 37 37.25714 -0.25714286 866 31 23.66667 7.33333333 867 48 45.21053 2.78947368 868 39 39.87500 -0.87500000 869 24 23.66667 0.33333333 870 42 42.68421 -0.68421053 871 36 33.66667 2.33333333 872 39 39.24138 -0.24137931 873 43 42.68421 0.31578947 874 34 35.28571 -1.28571429 875 36 37.64706 -1.64705882 876 42 39.87500 2.12500000 877 46 45.21053 0.78947368 878 38 39.24138 -1.24137931 879 36 36.57143 -0.57142857 880 29 34.11765 -5.11764706 881 32 26.92857 5.07142857 882 43 42.68421 0.31578947 883 38 35.28571 2.71428571 884 47 44.00000 3.00000000 885 34 33.31579 0.68421053 886 37 33.00000 4.00000000 887 36 35.09091 0.90909091 888 37 35.63636 1.36363636 889 36 37.43333 -1.43333333 890 36 38.85000 -2.85000000 891 38 36.91667 1.08333333 892 39 35.63636 3.36363636 893 37 37.25714 -0.25714286 894 34 33.31579 0.68421053 895 35 33.31579 1.68421053 896 38 37.90000 0.10000000 897 33 35.88889 -2.88888889 898 38 37.00000 1.00000000 899 41 38.85000 2.15000000 900 41 39.87500 1.12500000 901 39 38.85000 0.15000000 902 38 36.86207 1.13793103 903 34 34.11765 -0.11764706 904 29 31.00000 -2.00000000 905 34 33.31579 0.68421053 906 34 31.23077 2.76923077 907 45 44.00000 1.00000000 908 36 33.72222 2.27777778 909 36 34.30769 1.69230769 910 38 37.25714 0.74285714 911 35 34.30769 0.69230769 912 33 34.11765 -1.11764706 913 39 39.87500 -0.87500000 914 32 34.30769 -2.30769231 915 40 40.42857 -0.42857143 916 42 40.76190 1.23809524 917 38 36.91667 1.08333333 918 34 37.64706 -3.64705882 919 38 37.64706 0.35294118 920 37 36.91667 0.08333333 921 38 37.55556 0.44444444 922 41 39.92857 1.07142857 923 37 40.76190 -3.76190476 924 38 39.24138 -1.24137931 925 36 37.90000 -1.90000000 926 33 34.11765 -1.11764706 927 33 34.75000 -1.75000000 928 36 34.11765 1.88235294 929 35 37.43333 -2.43333333 930 31 33.72222 -2.72222222 931 36 35.28571 0.71428571 932 33 33.72222 -0.72222222 933 34 35.09091 -1.09090909 934 34 33.66667 0.33333333 935 30 30.45000 -0.45000000 936 35 34.30769 0.69230769 937 36 34.11765 1.88235294 938 32 31.00000 1.00000000 939 41 40.42857 0.57142857 940 42 39.87500 2.12500000 941 38 37.55556 0.44444444 942 38 34.10000 3.90000000 943 37 37.43333 -0.43333333 944 33 32.53333 0.46666667 945 30 33.25000 -3.25000000 946 43 44.00000 -1.00000000 947 41 39.85714 1.14285714 948 30 32.12500 -2.12500000 949 38 37.90000 0.10000000 950 40 36.81818 3.18181818 951 35 35.10526 -0.10526316 952 35 34.75000 0.25000000 953 37 34.75000 2.25000000 954 33 32.53333 0.46666667 955 35 37.25714 -2.25714286 956 35 35.10526 -0.10526316 957 42 39.75000 2.25000000 958 40 39.75000 0.25000000 959 33 26.92857 6.07142857 960 37 37.55556 -0.55555556 961 38 37.25714 0.74285714 962 26 23.66667 2.33333333 963 41 40.93333 0.06666667 964 42 42.68421 -0.68421053 965 41 38.85000 2.15000000 966 34 35.10526 -1.10526316 967 32 32.22222 -0.22222222 968 34 34.00000 0.00000000 969 40 39.92857 0.07142857 970 36 35.10526 0.89473684 971 35 33.31579 1.68421053 972 36 33.72222 2.27777778 973 32 32.22222 -0.22222222 974 46 45.21053 0.78947368 975 29 31.23077 -2.23076923 976 44 45.21053 -1.21052632 977 39 37.90000 1.10000000 978 33 34.75000 -1.75000000 979 34 35.10526 -1.10526316 980 41 37.55556 3.44444444 981 34 35.10526 -1.10526316 982 36 36.86207 -0.86206897 983 38 35.10526 2.89473684 984 33 34.11765 -1.11764706 985 38 35.10526 2.89473684 986 32 31.46154 0.53846154 987 41 39.92857 1.07142857 988 38 37.90000 0.10000000 989 41 36.91667 4.08333333 990 32 32.22222 -0.22222222 991 29 28.88889 0.11111111 992 31 32.59259 -1.59259259 993 21 24.63636 -3.63636364 994 34 35.10526 -1.10526316 995 30 33.72222 -3.72222222 996 37 32.53333 4.46666667 997 30 32.22222 -2.22222222 998 18 23.66667 -5.66666667 999 31 34.10526 -3.10526316 1000 48 45.21053 2.78947368 1001 33 34.75000 -1.75000000 1002 36 36.50000 -0.50000000 1003 37 33.72222 3.27777778 1004 37 39.87500 -2.87500000 1005 48 44.00000 4.00000000 > if (par2 != 'none') { + print(cbind(as.factor(x[,par1]),predict(m))) + myt <- table(as.factor(x[,par1]),predict(m)) + print(myt) + } > postscript(file="/var/www/rcomp/tmp/4577x1335447822.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/www/rcomp/tmp/5mdvk1335447822.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/www/rcomp/tmp/6jq0u1335447822.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/www/rcomp/tmp/78hfv1335447822.tab") + } > > try(system("convert tmp/2w1jx1335447822.ps tmp/2w1jx1335447822.png",intern=TRUE)) character(0) > try(system("convert tmp/36c351335447822.ps tmp/36c351335447822.png",intern=TRUE)) character(0) > try(system("convert tmp/4577x1335447822.ps tmp/4577x1335447822.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 18.680 0.950 21.154