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 preferred' > par8 = 'COLLES preferred' > par7 = 'all' > par6 = 'all' > par5 = 'all' > par4 = 'no' > par3 = '0' > par2 = 'none' > par1 = '0' > par9 <- 'COLLES preferred' > par8 <- 'COLLES preferred' > par7 <- 'all' > par6 <- 'all' > par5 <- 'all' > par4 <- 'no' > par3 <- '0' > 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] 87 86 84 68 101 87 85 88 84 79 92 74 97 80 101 87 84 109 [19] 84 81 77 72 68 88 80 86 92 56 79 81 86 88 81 70 74 96 [37] 86 91 80 74 89 96 92 84 72 87 88 68 68 88 88 83 72 104 [55] 68 93 88 78 78 90 84 86 71 82 90 76 94 76 90 85 69 78 [73] 98 82 84 67 73 79 77 85 82 80 59 82 103 73 74 76 90 99 [91] 91 78 76 90 60 64 88 77 82 75 71 71 63 83 68 81 77 63 [109] 72 79 86 81 75 66 90 69 77 72 77 75 86 95 72 92 77 64 [127] 91 71 60 77 74 74 97 85 82 84 91 81 78 75 93 74 75 80 [145] 83 69 99 86 78 86 89 88 63 101 79 86 86 81 80 91 74 91 [163] 78 97 71 87 68 59 78 92 76 73 73 74 80 86 89 60 64 87 [181] 94 77 75 87 76 92 99 91 83 93 102 85 82 94 79 94 104 96 [199] 106 96 87 94 75 92 88 85 96 82 77 90 101 74 84 89 88 80 [217] 66 77 100 85 87 92 86 98 79 86 86 84 48 86 89 77 77 67 [235] 77 97 79 101 87 94 76 70 89 91 88 94 100 78 96 82 95 84 [253] 89 71 101 90 95 92 87 74 83 88 104 77 91 96 98 87 101 105 [271] 74 85 80 54 89 92 91 104 96 77 87 111 99 69 93 77 78 107 [289] 90 91 88 79 78 91 85 97 82 71 70 87 83 77 72 81 72 80 [307] 98 75 91 71 72 81 77 83 73 85 64 112 74 90 94 99 107 84 [325] 58 72 83 74 89 85 83 82 78 102 77 97 84 85 90 97 75 85 [343] 79 77 96 76 72 89 84 71 86 87 91 89 76 72 87 88 77 73 [361] 86 84 64 90 80 100 89 87 81 96 85 71 74 78 95 85 67 90 [379] 85 94 98 81 82 86 99 88 88 82 72 88 99 85 83 79 72 88 [397] 59 102 86 86 102 83 66 106 85 102 104 86 84 88 92 84 93 89 [415] 87 109 79 95 80 110 73 84 93 87 84 82 95 110 80 78 82 105 [433] 104 95 70 81 99 106 101 99 107 100 103 86 83 95 99 90 71 103 [451] 95 98 97 80 102 103 93 95 68 86 85 81 88 68 85 77 113 69 [469] 90 94 117 92 104 100 105 93 83 106 66 94 78 104 74 107 97 105 [487] 116 111 90 99 101 106 97 101 102 95 81 106 85 77 89 95 100 93 [505] 108 88 86 105 88 94 92 117 69 82 94 117 81 102 92 90 86 85 [523] 93 98 88 104 101 101 90 92 107 95 88 92 76 76 90 94 102 87 [541] 105 91 120 94 93 97 86 92 90 100 80 90 89 72 117 93 105 97 [559] 95 82 99 93 93 107 107 96 93 99 90 88 83 94 114 90 92 97 [577] 97 100 102 111 79 84 92 100 106 100 71 94 106 90 73 102 77 94 [595] 88 112 88 91 72 119 107 93 87 100 109 103 67 93 107 85 78 104 [613] 96 110 103 115 90 100 108 75 92 103 93 75 87 61 92 117 83 96 [631] 77 95 97 119 108 110 95 88 92 106 79 103 100 114 101 92 86 92 [649] 91 107 105 96 96 117 104 86 107 89 83 87 98 92 117 101 102 103 [667] 93 76 109 104 114 94 99 102 84 86 85 94 104 105 90 97 86 109 [685] 92 89 119 97 117 91 95 113 102 106 80 97 96 112 97 92 98 92 [703] 81 107 73 79 83 84 93 95 120 109 109 95 72 104 82 104 103 99 [721] 103 86 79 95 102 110 107 107 105 112 101 93 107 97 114 92 101 109 [739] 72 89 46 103 85 110 75 112 95 97 98 91 96 88 86 91 85 104 [757] 84 75 90 115 87 93 103 104 112 99 100 108 102 116 93 83 108 91 [775] 96 81 95 100 74 102 102 111 91 105 79 85 102 104 75 92 111 74 [793] 114 86 90 80 80 94 102 80 72 82 75 81 90 72 91 120 78 81 [811] 95 100 91 103 80 90 119 > 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]) 46 48 54 56 58 59 60 61 63 64 66 67 68 69 70 71 72 73 74 75 1 1 1 1 1 3 3 1 3 5 4 4 9 6 4 12 20 9 18 15 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 12 26 17 17 20 19 19 18 23 27 34 24 30 18 30 24 30 23 21 23 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 18 21 10 16 16 16 20 14 18 11 10 15 5 8 6 5 6 2 5 2 116 117 119 120 2 8 4 3 > 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] 87 86 84 68 101 87 85 88 84 79 92 74 97 80 101 87 84 109 [19] 84 81 77 72 68 88 80 86 92 56 79 81 86 88 81 70 74 96 [37] 86 91 80 74 89 96 92 84 72 87 88 68 68 88 88 83 72 104 [55] 68 93 88 78 78 90 84 86 71 82 90 76 94 76 90 85 69 78 [73] 98 82 84 67 73 79 77 85 82 80 59 82 103 73 74 76 90 99 [91] 91 78 76 90 60 64 88 77 82 75 71 71 63 83 68 81 77 63 [109] 72 79 86 81 75 66 90 69 77 72 77 75 86 95 72 92 77 64 [127] 91 71 60 77 74 74 97 85 82 84 91 81 78 75 93 74 75 80 [145] 83 69 99 86 78 86 89 88 63 101 79 86 86 81 80 91 74 91 [163] 78 97 71 87 68 59 78 92 76 73 73 74 80 86 89 60 64 87 [181] 94 77 75 87 76 92 99 91 83 93 102 85 82 94 79 94 104 96 [199] 106 96 87 94 75 92 88 85 96 82 77 90 101 74 84 89 88 80 [217] 66 77 100 85 87 92 86 98 79 86 86 84 48 86 89 77 77 67 [235] 77 97 79 101 87 94 76 70 89 91 88 94 100 78 96 82 95 84 [253] 89 71 101 90 95 92 87 74 83 88 104 77 91 96 98 87 101 105 [271] 74 85 80 54 89 92 91 104 96 77 87 111 99 69 93 77 78 107 [289] 90 91 88 79 78 91 85 97 82 71 70 87 83 77 72 81 72 80 [307] 98 75 91 71 72 81 77 83 73 85 64 112 74 90 94 99 107 84 [325] 58 72 83 74 89 85 83 82 78 102 77 97 84 85 90 97 75 85 [343] 79 77 96 76 72 89 84 71 86 87 91 89 76 72 87 88 77 73 [361] 86 84 64 90 80 100 89 87 81 96 85 71 74 78 95 85 67 90 [379] 85 94 98 81 82 86 99 88 88 82 72 88 99 85 83 79 72 88 [397] 59 102 86 86 102 83 66 106 85 102 104 86 84 88 92 84 93 89 [415] 87 109 79 95 80 110 73 84 93 87 84 82 95 110 80 78 82 105 [433] 104 95 70 81 99 106 101 99 107 100 103 86 83 95 99 90 71 103 [451] 95 98 97 80 102 103 93 95 68 86 85 81 88 68 85 77 113 69 [469] 90 94 117 92 104 100 105 93 83 106 66 94 78 104 74 107 97 105 [487] 116 111 90 99 101 106 97 101 102 95 81 106 85 77 89 95 100 93 [505] 108 88 86 105 88 94 92 117 69 82 94 117 81 102 92 90 86 85 [523] 93 98 88 104 101 101 90 92 107 95 88 92 76 76 90 94 102 87 [541] 105 91 120 94 93 97 86 92 90 100 80 90 89 72 117 93 105 97 [559] 95 82 99 93 93 107 107 96 93 99 90 88 83 94 114 90 92 97 [577] 97 100 102 111 79 84 92 100 106 100 71 94 106 90 73 102 77 94 [595] 88 112 88 91 72 119 107 93 87 100 109 103 67 93 107 85 78 104 [613] 96 110 103 115 90 100 108 75 92 103 93 75 87 61 92 117 83 96 [631] 77 95 97 119 108 110 95 88 92 106 79 103 100 114 101 92 86 92 [649] 91 107 105 96 96 117 104 86 107 89 83 87 98 92 117 101 102 103 [667] 93 76 109 104 114 94 99 102 84 86 85 94 104 105 90 97 86 109 [685] 92 89 119 97 117 91 95 113 102 106 80 97 96 112 97 92 98 92 [703] 81 107 73 79 83 84 93 95 120 109 109 95 72 104 82 104 103 99 [721] 103 86 79 95 102 110 107 107 105 112 101 93 107 97 114 92 101 109 [739] 72 89 46 103 85 110 75 112 95 97 98 91 96 88 86 91 85 104 [757] 84 75 90 115 87 93 103 104 112 99 100 108 102 116 93 83 108 91 [775] 96 81 95 100 74 102 102 111 91 105 79 85 102 104 75 92 111 74 [793] 114 86 90 80 80 94 102 80 72 82 75 81 90 72 91 120 78 81 [811] 95 100 91 103 80 90 119 > 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/1f5ia1337869857.tab") + } + } > m Conditional inference tree with 45 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: 817 1) C26 <= 4; criterion = 1, statistic = 366.164 2) C4 <= 3; criterion = 1, statistic = 221.535 3) C34 <= 3; criterion = 1, statistic = 75.658 4) C42 <= 3; criterion = 1, statistic = 41.164 5) C20 <= 3; criterion = 1, statistic = 26.63 6) C34 <= 1; criterion = 1, statistic = 20.642 7)* weights = 9 6) C34 > 1 8) C32 <= 3; criterion = 0.998, statistic = 15.292 9) C18 <= 2; criterion = 0.972, statistic = 10.512 10)* weights = 12 9) C18 > 2 11)* weights = 28 8) C32 > 3 12)* weights = 17 5) C20 > 3 13)* weights = 17 4) C42 > 3 14) C24 <= 2; criterion = 1, statistic = 21.46 15)* weights = 13 14) C24 > 2 16) C30 <= 3; criterion = 0.988, statistic = 12.143 17)* weights = 20 16) C30 > 3 18)* weights = 19 3) C34 > 3 19) C46 <= 3; criterion = 1, statistic = 23.413 20) C26 <= 3; criterion = 0.981, statistic = 11.257 21)* weights = 15 20) C26 > 3 22)* weights = 12 19) C46 > 3 23) C24 <= 3; criterion = 0.994, statistic = 13.459 24)* weights = 18 23) C24 > 3 25)* weights = 24 2) C4 > 3 26) C42 <= 4; criterion = 1, statistic = 126.229 27) C36 <= 2; criterion = 1, statistic = 99.617 28) C12 <= 4; criterion = 1, statistic = 23.376 29) C28 <= 3; criterion = 0.997, statistic = 14.673 30)* weights = 18 29) C28 > 3 31)* weights = 29 28) C12 > 4 32)* weights = 13 27) C36 > 2 33) C32 <= 3; criterion = 1, statistic = 91.592 34) C26 <= 3; criterion = 1, statistic = 23.675 35)* weights = 47 34) C26 > 3 36) C20 <= 3; criterion = 0.981, statistic = 11.234 37)* weights = 20 36) C20 > 3 38)* weights = 25 33) C32 > 3 39) C6 <= 4; criterion = 1, statistic = 55.902 40) C46 <= 3; criterion = 1, statistic = 45.61 41) C30 <= 3; criterion = 0.983, statistic = 11.427 42)* weights = 11 41) C30 > 3 43) C24 <= 3; criterion = 0.982, statistic = 11.353 44)* weights = 16 43) C24 > 3 45)* weights = 9 40) C46 > 3 46) C34 <= 3; criterion = 1, statistic = 40.411 47) C18 <= 2; criterion = 1, statistic = 21.525 48)* weights = 7 47) C18 > 2 49) C18 <= 3; criterion = 0.985, statistic = 11.718 50)* weights = 23 49) C18 > 3 51)* weights = 21 46) C34 > 3 52) C30 <= 4; criterion = 1, statistic = 18.785 53) C18 <= 3; criterion = 0.999, statistic = 16.42 54)* weights = 21 53) C18 > 3 55) C12 <= 3; criterion = 0.98, statistic = 11.124 56)* weights = 7 55) C12 > 3 57)* weights = 24 52) C30 > 4 58)* weights = 11 39) C6 > 4 59) C24 <= 4; criterion = 0.987, statistic = 11.991 60)* weights = 45 59) C24 > 4 61)* weights = 11 26) C42 > 4 62) C48 <= 4; criterion = 1, statistic = 19.632 63) C36 <= 3; criterion = 0.989, statistic = 12.201 64)* weights = 9 63) C36 > 3 65)* weights = 14 62) C48 > 4 66) C14 <= 4; criterion = 0.975, statistic = 10.706 67)* weights = 12 66) C14 > 4 68)* weights = 14 1) C26 > 4 69) C42 <= 4; criterion = 1, statistic = 70.554 70) C4 <= 4; criterion = 1, statistic = 35.007 71) C30 <= 4; criterion = 0.998, statistic = 15.324 72)* weights = 28 71) C30 > 4 73) C6 <= 3; criterion = 0.954, statistic = 9.588 74)* weights = 9 73) C6 > 3 75)* weights = 14 70) C4 > 4 76) C18 <= 3; criterion = 1, statistic = 18.175 77)* weights = 23 76) C18 > 3 78) C44 <= 3; criterion = 0.985, statistic = 11.672 79)* weights = 10 78) C44 > 3 80)* weights = 33 69) C42 > 4 81) C40 <= 4; criterion = 1, statistic = 40.864 82) C20 <= 3; criterion = 1, statistic = 22.366 83)* weights = 16 82) C20 > 3 84) C30 <= 4; criterion = 0.995, statistic = 13.584 85)* weights = 14 84) C30 > 4 86)* weights = 24 81) C40 > 4 87) C24 <= 4; criterion = 0.989, statistic = 12.198 88)* weights = 9 87) C24 > 4 89)* weights = 26 > postscript(file="/var/wessaorg/rcomp/tmp/24naj1337869857.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/35vnw1337869857.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 87 83.84211 3.15789474 2 86 89.11111 -3.11111111 3 84 82.05556 1.94444444 4 68 71.46154 -3.46153846 5 101 101.57143 -0.57142857 6 87 88.37500 -1.37500000 7 85 83.25000 1.75000000 8 88 88.37500 -0.37500000 9 84 75.53333 8.46666667 10 79 71.46154 7.53846154 11 92 90.71429 1.28571429 12 74 82.50000 -8.50000000 13 97 99.18182 -2.18181818 14 80 82.05556 -2.05555556 15 101 99.18182 1.81818182 16 87 83.40000 3.60000000 17 84 75.53333 8.46666667 18 109 104.06061 4.93939394 19 84 83.84211 0.15789474 20 81 77.70000 3.30000000 21 77 80.48936 -3.48936170 22 72 71.21429 0.78571429 23 68 75.53333 -7.53333333 24 88 80.00000 8.00000000 25 80 82.50000 -2.50000000 26 86 97.00000 -11.00000000 27 92 91.55556 0.44444444 28 56 58.11111 -2.11111111 29 79 88.37500 -9.37500000 30 81 82.05556 -1.05555556 31 86 88.17391 -2.17391304 32 88 80.00000 8.00000000 33 81 88.75000 -7.75000000 34 70 72.00000 -2.00000000 35 74 74.35294 -0.35294118 36 96 88.75000 7.25000000 37 86 89.00000 -3.00000000 38 91 88.75000 2.25000000 39 80 82.50000 -2.50000000 40 74 80.48936 -6.48936170 41 89 90.71429 -1.71428571 42 96 90.71429 5.28571429 43 92 88.37500 3.62500000 44 84 89.66667 -5.66666667 45 72 75.53333 -3.53333333 46 87 88.17391 -1.17391304 47 88 83.40000 4.60000000 48 68 74.35294 -6.35294118 49 68 67.08333 0.91666667 50 88 95.78261 -7.78260870 51 88 80.48936 7.51063830 52 83 79.72414 3.27586207 53 72 78.11765 -6.11764706 54 104 102.00000 2.00000000 55 68 58.11111 9.88888889 56 93 97.57143 -4.57142857 57 88 79.72414 8.27586207 58 78 83.40000 -5.40000000 59 78 77.70000 0.30000000 60 90 90.71429 -0.71428571 61 84 83.25000 0.75000000 62 86 80.00000 6.00000000 63 71 75.53333 -4.53333333 64 82 82.05556 -0.05555556 65 90 90.71429 -0.71428571 66 76 74.35294 1.64705882 67 94 88.08000 5.92000000 68 76 80.48936 -4.48936170 69 90 95.16667 -5.16666667 70 85 83.40000 1.60000000 71 69 71.46154 -2.46153846 72 78 72.00000 6.00000000 73 98 94.91111 3.08888889 74 82 80.48936 1.51063830 75 84 88.37500 -4.37500000 76 67 72.00000 -5.00000000 77 73 82.05556 -9.05555556 78 79 82.05556 -3.05555556 79 77 79.72414 -2.72413793 80 85 88.92308 -3.92307692 81 82 88.37500 -6.37500000 82 80 80.00000 0.00000000 83 59 58.11111 0.88888889 84 82 78.11765 3.88235294 85 103 101.57143 1.42857143 86 73 71.21429 1.78571429 87 74 74.35294 -0.35294118 88 76 77.70000 -1.70000000 89 90 88.37500 1.62500000 90 99 101.58333 -2.58333333 91 91 88.37500 2.62500000 92 78 80.48936 -2.48936170 93 76 75.53333 0.46666667 94 90 82.05556 7.94444444 95 60 58.11111 1.88888889 96 64 80.00000 -16.00000000 97 88 88.75000 -0.75000000 98 77 71.21429 5.78571429 99 82 82.50000 -0.50000000 100 75 80.48936 -5.48936170 101 71 74.35294 -3.35294118 102 71 58.11111 12.88888889 103 63 71.21429 -8.21428571 104 83 82.50000 0.50000000 105 68 72.00000 -4.00000000 106 81 82.05556 -1.05555556 107 77 80.48936 -3.48936170 108 63 67.08333 -4.08333333 109 72 82.05556 -10.05555556 110 79 82.05556 -3.05555556 111 86 89.66667 -3.66666667 112 81 83.84211 -2.84210526 113 75 80.48936 -5.48936170 114 66 71.46154 -5.46153846 115 90 80.48936 9.51063830 116 69 71.46154 -2.46153846 117 77 83.84211 -6.84210526 118 72 71.21429 0.78571429 119 77 80.48936 -3.48936170 120 75 83.84211 -8.84210526 121 86 83.25000 2.75000000 122 95 88.37500 6.62500000 123 72 71.46154 0.53846154 124 92 88.37500 3.62500000 125 77 77.70000 -0.70000000 126 64 71.46154 -7.46153846 127 91 88.08000 2.92000000 128 71 74.35294 -3.35294118 129 60 71.21429 -11.21428571 130 77 83.40000 -6.40000000 131 74 77.70000 -3.70000000 132 74 71.21429 2.78571429 133 97 90.71429 6.28571429 134 85 90.71429 -5.71428571 135 82 83.84211 -1.84210526 136 84 78.11765 5.88235294 137 91 98.20000 -7.20000000 138 81 83.40000 -2.40000000 139 78 82.05556 -4.05555556 140 75 88.08000 -13.08000000 141 93 89.00000 4.00000000 142 74 83.25000 -9.25000000 143 75 79.72414 -4.72413793 144 80 83.40000 -3.40000000 145 83 88.17391 -5.17391304 146 69 80.48936 -11.48936170 147 99 94.91111 4.08888889 148 86 89.11111 -3.11111111 149 78 83.25000 -5.25000000 150 86 83.40000 2.60000000 151 89 83.25000 5.75000000 152 88 90.71429 -2.71428571 153 63 71.21429 -8.21428571 154 101 95.16667 5.83333333 155 79 77.70000 1.30000000 156 86 78.11765 7.88235294 157 86 82.50000 3.50000000 158 81 88.92308 -7.92307692 159 80 79.72414 0.27586207 160 91 89.66667 1.33333333 161 74 80.48936 -6.48936170 162 91 89.66667 1.33333333 163 78 80.48936 -2.48936170 164 97 98.20000 -1.20000000 165 71 67.08333 3.91666667 166 87 88.37500 -1.37500000 167 68 71.46154 -3.46153846 168 59 72.00000 -13.00000000 169 78 78.11765 -0.11764706 170 92 91.55556 0.44444444 171 76 71.46154 4.53846154 172 73 78.11765 -5.11764706 173 73 79.72414 -6.72413793 174 74 75.53333 -1.53333333 175 80 77.70000 2.30000000 176 86 80.48936 5.51063830 177 89 88.17391 0.82608696 178 60 67.08333 -7.08333333 179 64 72.00000 -8.00000000 180 87 88.17391 -1.17391304 181 94 97.57143 -3.57142857 182 77 80.48936 -3.48936170 183 75 83.40000 -8.40000000 184 87 88.08000 -1.08000000 185 76 80.48936 -4.48936170 186 92 88.37500 3.62500000 187 99 94.91111 4.08888889 188 91 97.00000 -6.00000000 189 83 77.70000 5.30000000 190 93 94.91111 -1.91111111 191 102 98.20000 3.80000000 192 85 88.17391 -3.17391304 193 82 80.48936 1.51063830 194 94 88.75000 5.25000000 195 79 78.11765 0.88235294 196 94 89.66667 4.33333333 197 104 104.06061 -0.06060606 198 96 97.57143 -1.57142857 199 106 104.06061 1.93939394 200 96 94.91111 1.08888889 201 87 83.25000 3.75000000 202 94 89.66667 4.33333333 203 75 80.48936 -5.48936170 204 92 88.75000 3.25000000 205 88 88.17391 -0.17391304 206 85 88.37500 -3.37500000 207 96 95.16667 0.83333333 208 82 83.84211 -1.84210526 209 77 72.00000 5.00000000 210 90 89.11111 0.88888889 211 101 97.57143 3.42857143 212 74 77.70000 -3.70000000 213 84 90.71429 -6.71428571 214 89 88.17391 0.82608696 215 88 89.66667 -1.66666667 216 80 82.05556 -2.05555556 217 66 67.08333 -1.08333333 218 77 74.35294 2.64705882 219 100 88.75000 11.25000000 220 85 82.50000 2.50000000 221 87 94.91111 -7.91111111 222 92 88.37500 3.62500000 223 86 79.72414 6.27586207 224 98 101.57143 -3.57142857 225 79 80.48936 -1.48936170 226 86 88.17391 -2.17391304 227 86 90.71429 -4.71428571 228 84 88.08000 -4.08000000 229 48 58.11111 -10.11111111 230 86 83.25000 2.75000000 231 89 91.55556 -2.55555556 232 77 77.70000 -0.70000000 233 77 80.48936 -3.48936170 234 67 72.00000 -5.00000000 235 77 77.70000 -0.70000000 236 97 95.78261 1.21739130 237 79 88.75000 -9.75000000 238 101 101.58333 -0.58333333 239 87 89.11111 -2.11111111 240 94 89.66667 4.33333333 241 76 79.72414 -3.72413793 242 70 71.21429 -1.21428571 243 89 88.08000 0.92000000 244 91 91.42857 -0.42857143 245 88 88.17391 -0.17391304 246 94 95.16667 -1.16666667 247 100 101.57143 -1.57142857 248 78 74.35294 3.64705882 249 96 99.18182 -3.18181818 250 82 88.37500 -6.37500000 251 95 100.09091 -5.09090909 252 84 79.72414 4.27586207 253 89 91.55556 -2.55555556 254 71 77.70000 -6.70000000 255 101 102.00000 -1.00000000 256 90 91.42857 -1.42857143 257 95 95.16667 -0.16666667 258 92 88.17391 3.82608696 259 87 88.17391 -1.17391304 260 74 71.21429 2.78571429 261 83 80.48936 2.51063830 262 88 83.84211 4.15789474 263 104 114.88462 -10.88461538 264 77 71.21429 5.78571429 265 91 88.37500 2.62500000 266 96 101.58333 -5.58333333 267 98 97.57143 0.42857143 268 87 83.40000 3.60000000 269 101 90.71429 10.28571429 270 105 106.64286 -1.64285714 271 74 77.70000 -3.70000000 272 85 83.25000 1.75000000 273 80 80.48936 -0.48936170 274 54 58.11111 -4.11111111 275 89 91.42857 -2.42857143 276 92 90.71429 1.28571429 277 91 90.71429 0.28571429 278 104 97.57143 6.42857143 279 96 95.16667 0.83333333 280 77 74.35294 2.64705882 281 87 79.72414 7.27586207 282 111 106.64286 4.35714286 283 99 91.55556 7.44444444 284 69 75.53333 -6.53333333 285 93 95.16667 -2.16666667 286 77 74.35294 2.64705882 287 78 71.46154 6.53846154 288 107 104.06061 2.93939394 289 90 88.08000 1.92000000 290 91 88.75000 2.25000000 291 88 88.92308 -0.92307692 292 79 74.35294 4.64705882 293 78 80.00000 -2.00000000 294 91 91.42857 -0.42857143 295 85 88.08000 -3.08000000 296 97 88.75000 8.25000000 297 82 78.11765 3.88235294 298 71 80.48936 -9.48936170 299 70 67.08333 2.91666667 300 87 88.17391 -1.17391304 301 83 83.25000 -0.25000000 302 77 78.11765 -1.11764706 303 72 71.21429 0.78571429 304 81 80.48936 0.51063830 305 72 78.11765 -6.11764706 306 80 77.70000 2.30000000 307 98 88.37500 9.62500000 308 75 71.46154 3.53846154 309 91 97.57143 -6.57142857 310 71 77.70000 -6.70000000 311 72 78.11765 -6.11764706 312 81 83.25000 -2.25000000 313 77 79.72414 -2.72413793 314 83 88.75000 -5.75000000 315 73 72.00000 1.00000000 316 85 83.84211 1.15789474 317 64 74.35294 -10.35294118 318 112 100.09091 11.90909091 319 74 71.21429 2.78571429 320 90 90.71429 -0.71428571 321 94 95.16667 -1.16666667 322 99 97.57143 1.42857143 323 107 108.44444 -1.44444444 324 84 88.17391 -4.17391304 325 58 67.08333 -9.08333333 326 72 71.21429 0.78571429 327 83 82.57143 0.42857143 328 74 71.46154 2.53846154 329 89 89.11111 -0.11111111 330 85 82.50000 2.50000000 331 83 82.05556 0.94444444 332 82 83.25000 -1.25000000 333 78 80.00000 -2.00000000 334 102 104.06061 -2.06060606 335 77 71.21429 5.78571429 336 97 89.00000 8.00000000 337 84 75.53333 8.46666667 338 85 88.37500 -3.37500000 339 90 91.55556 -1.55555556 340 97 88.37500 8.62500000 341 75 78.11765 -3.11764706 342 85 83.25000 1.75000000 343 79 88.08000 -9.08000000 344 77 74.35294 2.64705882 345 96 94.91111 1.08888889 346 76 75.53333 0.46666667 347 72 71.21429 0.78571429 348 89 88.37500 0.62500000 349 84 83.84211 0.15789474 350 71 71.21429 -0.21428571 351 86 88.08000 -2.08000000 352 87 80.00000 7.00000000 353 91 95.78261 -4.78260870 354 89 83.84211 5.15789474 355 76 79.72414 -3.72413793 356 72 75.53333 -3.53333333 357 87 91.55556 -4.55555556 358 88 82.05556 5.94444444 359 77 80.00000 -3.00000000 360 73 71.21429 1.78571429 361 86 83.84211 2.15789474 362 84 80.48936 3.51063830 363 64 75.53333 -11.53333333 364 90 82.05556 7.94444444 365 80 77.70000 2.30000000 366 100 99.18182 0.81818182 367 89 88.08000 0.92000000 368 87 83.84211 3.15789474 369 81 83.25000 -2.25000000 370 96 94.91111 1.08888889 371 85 80.48936 4.51063830 372 71 67.08333 3.91666667 373 74 71.21429 2.78571429 374 78 88.92308 -10.92307692 375 95 88.92308 6.07692308 376 85 83.25000 1.75000000 377 67 71.21429 -4.21428571 378 90 89.66667 0.33333333 379 85 83.84211 1.15789474 380 94 88.17391 5.82608696 381 98 88.75000 9.25000000 382 81 82.50000 -1.50000000 383 82 88.37500 -6.37500000 384 86 88.17391 -2.17391304 385 99 95.16667 3.83333333 386 88 83.40000 4.60000000 387 88 82.05556 5.94444444 388 82 75.53333 6.46666667 389 72 71.21429 0.78571429 390 88 88.92308 -0.92307692 391 99 102.00000 -3.00000000 392 85 89.00000 -4.00000000 393 83 80.48936 2.51063830 394 79 82.57143 -3.57142857 395 72 71.21429 0.78571429 396 88 97.00000 -9.00000000 397 59 79.72414 -20.72413793 398 102 99.18182 2.81818182 399 86 88.17391 -2.17391304 400 86 88.08000 -2.08000000 401 102 104.06061 -2.06060606 402 83 80.48936 2.51063830 403 66 72.00000 -6.00000000 404 106 114.88462 -8.88461538 405 85 88.75000 -3.75000000 406 102 102.00000 0.00000000 407 104 95.78261 8.21739130 408 86 88.08000 -2.08000000 409 84 79.72414 4.27586207 410 88 88.17391 -0.17391304 411 92 102.00000 -10.00000000 412 84 89.66667 -5.66666667 413 93 90.71429 2.28571429 414 89 94.91111 -5.91111111 415 87 88.75000 -1.75000000 416 109 104.06061 4.93939394 417 79 79.72414 -0.72413793 418 95 88.92308 6.07692308 419 80 83.84211 -3.84210526 420 110 101.58333 8.41666667 421 73 67.08333 5.91666667 422 84 83.84211 0.15789474 423 93 88.75000 4.25000000 424 87 79.72414 7.27586207 425 84 89.66667 -5.66666667 426 82 79.72414 2.27586207 427 95 95.16667 -0.16666667 428 110 114.88462 -4.88461538 429 80 79.72414 0.27586207 430 78 80.48936 -2.48936170 431 82 83.40000 -1.40000000 432 105 101.57143 3.42857143 433 104 104.06061 -0.06060606 434 95 89.66667 5.33333333 435 70 72.00000 -2.00000000 436 81 88.75000 -7.75000000 437 99 99.18182 -0.18181818 438 106 100.09091 5.90909091 439 101 104.06061 -3.06060606 440 99 97.00000 2.00000000 441 107 102.00000 5.00000000 442 100 98.20000 1.80000000 443 103 104.06061 -1.06060606 444 86 88.75000 -2.75000000 445 83 79.72414 3.27586207 446 95 101.57143 -6.57142857 447 99 94.91111 4.08888889 448 90 90.71429 -0.71428571 449 71 71.46154 -0.46153846 450 103 100.09091 2.90909091 451 95 94.91111 0.08888889 452 98 94.91111 3.08888889 453 97 94.91111 2.08888889 454 80 80.48936 -0.48936170 455 102 104.06061 -2.06060606 456 103 107.62500 -4.62500000 457 93 94.91111 -1.91111111 458 95 97.57143 -2.57142857 459 68 71.21429 -3.21428571 460 86 80.48936 5.51063830 461 85 83.40000 1.60000000 462 81 88.75000 -7.75000000 463 88 95.16667 -7.16666667 464 68 71.21429 -3.21428571 465 85 94.91111 -9.91111111 466 77 72.00000 5.00000000 467 113 114.88462 -1.88461538 468 69 67.08333 1.91666667 469 90 88.08000 1.92000000 470 94 95.16667 -1.16666667 471 117 114.88462 2.11538462 472 92 95.16667 -3.16666667 473 104 101.57143 2.42857143 474 100 94.91111 5.08888889 475 105 97.00000 8.00000000 476 93 90.71429 2.28571429 477 83 80.48936 2.51063830 478 106 108.44444 -2.44444444 479 66 71.21429 -5.21428571 480 94 88.17391 5.82608696 481 78 79.72414 -1.72413793 482 104 97.00000 7.00000000 483 74 78.11765 -4.11764706 484 107 104.06061 2.93939394 485 97 95.78261 1.21739130 486 105 97.00000 8.00000000 487 116 114.88462 1.11538462 488 111 114.88462 -3.88461538 489 90 88.08000 1.92000000 490 99 104.06061 -5.06060606 491 101 99.18182 1.81818182 492 106 106.64286 -0.64285714 493 97 101.57143 -4.57142857 494 101 101.57143 -0.57142857 495 102 94.91111 7.08888889 496 95 94.91111 0.08888889 497 81 77.70000 3.30000000 498 106 97.00000 9.00000000 499 85 89.00000 -4.00000000 500 77 80.48936 -3.48936170 501 89 95.78261 -6.78260870 502 95 95.78261 -0.78260870 503 100 94.91111 5.08888889 504 93 94.91111 -1.91111111 505 108 114.88462 -6.88461538 506 88 79.72414 8.27586207 507 86 88.75000 -2.75000000 508 105 94.91111 10.08888889 509 88 88.75000 -0.75000000 510 94 97.00000 -3.00000000 511 92 91.42857 0.57142857 512 117 114.88462 2.11538462 513 69 67.08333 1.91666667 514 82 78.11765 3.88235294 515 94 91.42857 2.57142857 516 117 114.88462 2.11538462 517 81 83.84211 -2.84210526 518 102 95.78261 6.21739130 519 92 88.17391 3.82608696 520 90 83.40000 6.60000000 521 86 88.08000 -2.08000000 522 85 83.84211 1.15789474 523 93 88.17391 4.82608696 524 98 99.18182 -1.18181818 525 88 77.70000 10.30000000 526 104 104.06061 -0.06060606 527 101 107.62500 -6.62500000 528 101 97.00000 4.00000000 529 90 80.48936 9.51063830 530 92 88.08000 3.92000000 531 107 108.44444 -1.44444444 532 95 95.16667 -0.16666667 533 88 94.91111 -6.91111111 534 92 89.11111 2.88888889 535 76 71.21429 4.78571429 536 76 83.40000 -7.40000000 537 90 80.48936 9.51063830 538 94 88.92308 5.07692308 539 102 94.91111 7.08888889 540 87 95.78261 -8.78260870 541 105 106.64286 -1.64285714 542 91 89.66667 1.33333333 543 120 114.88462 5.11538462 544 94 94.91111 -0.91111111 545 93 94.91111 -1.91111111 546 97 94.91111 2.08888889 547 86 90.71429 -4.71428571 548 92 95.78261 -3.78260870 549 90 88.92308 1.07692308 550 100 104.06061 -4.06060606 551 80 80.48936 -0.48936170 552 90 88.17391 1.82608696 553 89 89.66667 -0.66666667 554 72 75.53333 -3.53333333 555 117 108.44444 8.55555556 556 93 94.91111 -1.91111111 557 105 104.06061 0.93939394 558 97 94.91111 2.08888889 559 95 95.78261 -0.78260870 560 82 83.40000 -1.40000000 561 99 95.78261 3.21739130 562 93 91.42857 1.57142857 563 93 88.75000 4.25000000 564 107 104.06061 2.93939394 565 107 107.62500 -0.62500000 566 96 94.91111 1.08888889 567 93 102.00000 -9.00000000 568 99 98.20000 0.80000000 569 90 89.66667 0.33333333 570 88 89.66667 -1.66666667 571 83 79.72414 3.27586207 572 94 88.75000 5.25000000 573 114 108.44444 5.55555556 574 90 95.16667 -5.16666667 575 92 95.78261 -3.78260870 576 97 95.78261 1.21739130 577 97 100.09091 -3.09090909 578 100 100.09091 -0.09090909 579 102 104.06061 -2.06060606 580 111 108.44444 2.55555556 581 79 82.57143 -3.57142857 582 84 97.57143 -13.57142857 583 92 88.75000 3.25000000 584 100 100.09091 -0.09090909 585 106 108.44444 -2.44444444 586 100 97.57143 2.42857143 587 71 74.35294 -3.35294118 588 94 95.78261 -1.78260870 589 106 107.62500 -1.62500000 590 90 94.91111 -4.91111111 591 73 72.00000 1.00000000 592 102 99.18182 2.81818182 593 77 72.00000 5.00000000 594 94 101.58333 -7.58333333 595 88 98.20000 -10.20000000 596 112 107.62500 4.37500000 597 88 90.71429 -2.71428571 598 91 83.84211 7.15789474 599 72 71.21429 0.78571429 600 119 114.88462 4.11538462 601 107 104.06061 2.93939394 602 93 95.78261 -2.78260870 603 87 89.66667 -2.66666667 604 100 88.75000 11.25000000 605 109 95.78261 13.21739130 606 103 95.78261 7.21739130 607 67 67.08333 -0.08333333 608 93 88.92308 4.07692308 609 107 107.62500 -0.62500000 610 85 79.72414 5.27586207 611 78 82.57143 -4.57142857 612 104 107.62500 -3.62500000 613 96 95.16667 0.83333333 614 110 101.58333 8.41666667 615 103 104.06061 -1.06060606 616 115 114.88462 0.11538462 617 90 89.66667 0.33333333 618 100 95.16667 4.83333333 619 108 101.57143 6.42857143 620 75 74.35294 0.64705882 621 92 95.16667 -3.16666667 622 103 97.57143 5.42857143 623 93 88.08000 4.92000000 624 75 74.35294 0.64705882 625 87 88.92308 -1.92307692 626 61 58.11111 2.88888889 627 92 94.91111 -2.91111111 628 117 114.88462 2.11538462 629 83 82.57143 0.42857143 630 96 100.09091 -4.09090909 631 77 88.75000 -11.75000000 632 95 90.71429 4.28571429 633 97 94.91111 2.08888889 634 119 114.88462 4.11538462 635 108 107.62500 0.37500000 636 110 107.62500 2.37500000 637 95 80.48936 14.51063830 638 88 88.08000 -0.08000000 639 92 94.91111 -2.91111111 640 106 106.64286 -0.64285714 641 79 77.70000 1.30000000 642 103 102.00000 1.00000000 643 100 95.78261 4.21739130 644 114 102.00000 12.00000000 645 101 104.06061 -3.06060606 646 92 94.91111 -2.91111111 647 86 82.57143 3.42857143 648 92 94.91111 -2.91111111 649 91 89.11111 1.88888889 650 107 101.58333 5.41666667 651 105 97.00000 8.00000000 652 96 104.06061 -8.06060606 653 96 99.18182 -3.18181818 654 117 114.88462 2.11538462 655 104 107.62500 -3.62500000 656 86 80.48936 5.51063830 657 107 101.57143 5.42857143 658 89 88.75000 0.25000000 659 83 82.50000 0.50000000 660 87 88.17391 -1.17391304 661 98 101.58333 -3.58333333 662 92 88.92308 3.07692308 663 117 114.88462 2.11538462 664 101 104.06061 -3.06060606 665 102 94.91111 7.08888889 666 103 101.57143 1.42857143 667 93 89.66667 3.33333333 668 76 79.72414 -3.72413793 669 109 107.62500 1.37500000 670 104 107.62500 -3.62500000 671 114 114.88462 -0.88461538 672 94 94.91111 -0.91111111 673 99 97.57143 1.42857143 674 102 95.16667 6.83333333 675 84 80.48936 3.51063830 676 86 78.11765 7.88235294 677 85 80.48936 4.51063830 678 94 95.16667 -1.16666667 679 104 107.62500 -3.62500000 680 105 106.64286 -1.64285714 681 90 82.57143 7.42857143 682 97 95.78261 1.21739130 683 86 89.11111 -3.11111111 684 109 107.62500 1.37500000 685 92 94.91111 -2.91111111 686 89 90.71429 -1.71428571 687 119 114.88462 4.11538462 688 97 98.20000 -1.20000000 689 117 107.62500 9.37500000 690 91 94.91111 -3.91111111 691 95 94.91111 0.08888889 692 113 104.06061 8.93939394 693 102 104.06061 -2.06060606 694 106 102.00000 4.00000000 695 80 79.72414 0.27586207 696 97 97.00000 0.00000000 697 96 95.16667 0.83333333 698 112 104.06061 7.93939394 699 97 101.57143 -4.57142857 700 92 97.00000 -5.00000000 701 98 88.08000 9.92000000 702 92 94.91111 -2.91111111 703 81 89.00000 -8.00000000 704 107 106.64286 0.35714286 705 73 71.21429 1.78571429 706 79 78.11765 0.88235294 707 83 83.40000 -0.40000000 708 84 88.37500 -4.37500000 709 93 95.16667 -2.16666667 710 95 91.55556 3.44444444 711 120 114.88462 5.11538462 712 109 114.88462 -5.88461538 713 109 97.57143 11.42857143 714 95 89.11111 5.88888889 715 72 72.00000 0.00000000 716 104 98.20000 5.80000000 717 82 88.75000 -6.75000000 718 104 98.20000 5.80000000 719 103 95.78261 7.21739130 720 99 101.58333 -2.58333333 721 103 104.06061 -1.06060606 722 86 88.08000 -2.08000000 723 79 80.00000 -1.00000000 724 95 89.66667 5.33333333 725 102 104.06061 -2.06060606 726 110 107.62500 2.37500000 727 107 101.58333 5.41666667 728 107 104.06061 2.93939394 729 105 104.06061 0.93939394 730 112 107.62500 4.37500000 731 101 106.64286 -5.64285714 732 93 88.37500 4.62500000 733 107 107.62500 -0.62500000 734 97 101.58333 -4.58333333 735 114 114.88462 -0.88461538 736 92 88.08000 3.92000000 737 101 101.58333 -0.58333333 738 109 106.64286 2.35714286 739 72 80.48936 -8.48936170 740 89 82.50000 6.50000000 741 46 58.11111 -12.11111111 742 103 101.57143 1.42857143 743 85 75.53333 9.46666667 744 110 106.64286 3.35714286 745 75 80.00000 -5.00000000 746 112 106.64286 5.35714286 747 95 95.16667 -0.16666667 748 97 100.09091 -3.09090909 749 98 95.78261 2.21739130 750 91 88.08000 2.92000000 751 96 97.00000 -1.00000000 752 88 83.40000 4.60000000 753 86 82.05556 3.94444444 754 91 94.91111 -3.91111111 755 85 88.08000 -3.08000000 756 104 95.16667 8.83333333 757 84 88.37500 -4.37500000 758 75 72.00000 3.00000000 759 90 88.92308 1.07692308 760 115 114.88462 0.11538462 761 87 80.48936 6.51063830 762 93 89.00000 4.00000000 763 103 106.64286 -3.64285714 764 104 107.62500 -3.62500000 765 112 107.62500 4.37500000 766 99 99.18182 -0.18181818 767 100 98.20000 1.80000000 768 108 108.44444 -0.44444444 769 102 102.00000 0.00000000 770 116 107.62500 8.37500000 771 93 100.09091 -7.09090909 772 83 82.05556 0.94444444 773 108 106.64286 1.35714286 774 91 97.00000 -6.00000000 775 96 104.06061 -8.06060606 776 81 88.75000 -7.75000000 777 95 94.91111 0.08888889 778 100 102.00000 -2.00000000 779 74 77.70000 -3.70000000 780 102 107.62500 -5.62500000 781 102 102.00000 0.00000000 782 111 107.62500 3.37500000 783 91 72.00000 19.00000000 784 105 106.64286 -1.64285714 785 79 79.72414 -0.72413793 786 85 89.66667 -4.66666667 787 102 104.06061 -2.06060606 788 104 107.62500 -3.62500000 789 75 78.11765 -3.11764706 790 92 97.00000 -5.00000000 791 111 104.06061 6.93939394 792 74 79.72414 -5.72413793 793 114 114.88462 -0.88461538 794 86 80.48936 5.51063830 795 90 89.00000 1.00000000 796 80 74.35294 5.64705882 797 80 80.48936 -0.48936170 798 94 94.91111 -0.91111111 799 102 100.09091 1.90909091 800 80 80.48936 -0.48936170 801 72 80.48936 -8.48936170 802 82 82.50000 -0.50000000 803 75 79.72414 -4.72413793 804 81 83.25000 -2.25000000 805 90 83.40000 6.60000000 806 72 72.00000 0.00000000 807 91 91.55556 -0.55555556 808 120 114.88462 5.11538462 809 78 79.72414 -1.72413793 810 81 95.78261 -14.78260870 811 95 94.91111 0.08888889 812 100 108.44444 -8.44444444 813 91 89.00000 2.00000000 814 103 102.00000 1.00000000 815 80 83.40000 -3.40000000 816 90 88.08000 1.92000000 817 119 114.88462 4.11538462 > 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/4a6mf1337869857.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/5hnni1337869857.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/6qkxs1337869857.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/7ezv21337869857.tab") + } > > try(system("convert tmp/24naj1337869857.ps tmp/24naj1337869857.png",intern=TRUE)) character(0) > try(system("convert tmp/35vnw1337869857.ps tmp/35vnw1337869857.png",intern=TRUE)) character(0) > try(system("convert tmp/4a6mf1337869857.ps tmp/4a6mf1337869857.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 18.527 0.542 19.068