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 actuals' > par8 = 'COLLES actuals' > par7 = 'all' > par6 = 'all' > par5 = 'all' > par4 = 'no' > par3 = '3' > par2 = 'none' > par1 = '0' > par9 <- 'COLLES actuals' > par8 <- 'COLLES actuals' > 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] 90 95 96 93 102 93 82 98 89 88 102 83 108 86 97 89 103 115 [19] 90 88 81 74 75 93 87 92 95 105 93 90 87 105 92 89 85 100 [37] 83 97 95 73 94 99 99 88 86 89 95 83 72 98 85 84 80 108 [55] 72 110 93 85 95 94 80 93 83 92 106 93 95 96 90 102 93 93 [73] 102 94 85 87 77 83 79 110 90 95 80 95 105 91 69 81 75 98 [91] 101 96 86 91 72 76 95 96 92 77 90 85 81 80 91 89 78 66 [109] 79 91 88 61 77 81 91 75 87 93 85 88 86 93 77 92 80 98 [127] 109 95 75 88 87 84 82 107 94 86 89 95 81 87 99 87 83 88 [145] 89 68 117 88 84 94 109 108 61 107 80 92 94 95 83 92 75 94 [163] 83 110 80 101 81 59 90 94 83 90 82 93 94 84 110 69 97 95 [181] 98 78 89 93 106 71 91 96 108 93 95 89 72 107 102 88 95 94 [199] 96 92 110 94 95 72 103 89 96 92 90 86 90 99 86 89 108 94 [217] 83 76 102 100 90 112 89 98 81 116 101 85 104 92 49 94 105 94 [235] 85 96 79 106 79 101 90 114 99 79 94 88 93 91 77 101 81 116 [253] 86 95 91 95 78 70 109 109 81 94 87 73 86 93 113 97 85 103 [271] 105 97 86 118 102 77 94 91 89 67 104 100 86 109 97 77 88 88 [289] 115 103 84 106 97 87 106 103 97 110 102 78 101 93 83 104 85 111 [307] 104 70 90 92 90 83 71 90 72 83 120 73 90 93 90 98 85 101 [325] 89 108 96 86 115 79 103 93 107 87 84 65 72 87 80 92 87 106 [343] 87 92 88 92 96 86 94 98 96 79 93 81 72 109 72 96 74 88 [361] 97 97 92 93 89 98 109 99 99 98 93 105 88 102 101 90 93 96 [379] 100 83 97 68 106 86 78 99 94 103 110 86 87 104 96 100 111 82 [397] 72 88 103 80 93 88 56 120 86 82 101 89 66 87 87 94 92 75 [415] 77 85 84 53 74 89 83 103 84 69 68 98 72 84 71 87 88 76 [433] 92 91 61 66 88 98 85 82 70 78 99 74 69 90 93 104 87 89 [451] 57 91 82 71 63 93 87 86 83 71 86 81 81 73 64 81 79 76 [469] 84 68 69 68 104 70 81 80 86 85 101 74 93 75 84 100 67 89 [487] 83 80 62 77 93 82 104 101 73 91 78 83 76 89 93 93 76 87 [505] 77 67 88 76 91 82 81 93 67 85 87 65 81 103 69 83 82 102 [523] 74 95 75 76 72 84 99 95 81 98 90 93 81 72 72 75 57 68 [541] 70 70 90 87 100 69 78 75 71 85 88 83 72 85 79 82 79 85 [559] 89 70 95 89 72 89 89 74 90 92 88 113 89 94 76 94 85 79 [577] 77 69 88 86 82 84 96 82 88 111 67 73 105 94 96 97 70 91 [595] 110 92 68 104 87 96 88 95 75 84 72 91 89 67 81 93 106 100 [613] 63 84 81 78 76 99 75 86 92 95 85 95 94 60 62 91 88 73 [631] 83 64 75 95 81 92 81 86 94 93 95 95 87 87 91 91 79 99 [649] 89 104 87 86 88 84 74 85 90 83 88 80 81 77 90 86 83 77 [667] 88 98 95 101 75 79 88 77 93 76 107 89 92 82 84 90 82 76 [685] 95 109 90 77 76 83 86 82 96 92 110 77 86 100 98 101 76 80 [703] 86 107 78 69 92 84 83 89 74 79 52 86 79 95 88 91 80 94 [721] 68 89 65 84 88 64 82 82 75 93 87 90 90 108 66 99 65 93 [739] 100 92 100 77 85 80 69 91 53 91 86 95 66 95 75 90 90 83 [757] 92 84 86 72 73 100 79 71 82 99 85 80 85 98 99 86 73 78 [775] 90 103 87 76 102 73 101 83 80 79 63 96 75 103 89 105 78 80 [793] 95 96 71 80 92 67 97 79 79 83 77 82 79 83 71 83 73 86 [811] 77 72 73 82 65 67 78 70 78 88 69 85 88 > 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]) 49 52 53 56 57 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 1 1 2 1 2 1 1 3 2 3 3 5 5 8 8 11 9 9 19 12 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 9 17 15 19 14 20 19 23 21 30 20 25 32 28 34 31 31 21 27 37 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 26 33 20 13 16 15 12 14 11 12 10 8 8 6 7 8 9 3 1 2 114 115 116 117 118 120 1 3 2 1 1 2 > colnames(x) [1] "endo" "C1" "C3" "C5" "C7" "C9" "C11" "C13" "C15" "C17" [11] "C19" "C21" "C23" "C25" "C27" "C29" "C31" "C33" "C35" "C37" [21] "C39" "C41" "C43" "C45" "C47" > colnames(x)[par1] [1] "endo" > x[,par1] [1] 90 95 96 93 102 93 82 98 89 88 102 83 108 86 97 89 103 115 [19] 90 88 81 74 75 93 87 92 95 105 93 90 87 105 92 89 85 100 [37] 83 97 95 73 94 99 99 88 86 89 95 83 72 98 85 84 80 108 [55] 72 110 93 85 95 94 80 93 83 92 106 93 95 96 90 102 93 93 [73] 102 94 85 87 77 83 79 110 90 95 80 95 105 91 69 81 75 98 [91] 101 96 86 91 72 76 95 96 92 77 90 85 81 80 91 89 78 66 [109] 79 91 88 61 77 81 91 75 87 93 85 88 86 93 77 92 80 98 [127] 109 95 75 88 87 84 82 107 94 86 89 95 81 87 99 87 83 88 [145] 89 68 117 88 84 94 109 108 61 107 80 92 94 95 83 92 75 94 [163] 83 110 80 101 81 59 90 94 83 90 82 93 94 84 110 69 97 95 [181] 98 78 89 93 106 71 91 96 108 93 95 89 72 107 102 88 95 94 [199] 96 92 110 94 95 72 103 89 96 92 90 86 90 99 86 89 108 94 [217] 83 76 102 100 90 112 89 98 81 116 101 85 104 92 49 94 105 94 [235] 85 96 79 106 79 101 90 114 99 79 94 88 93 91 77 101 81 116 [253] 86 95 91 95 78 70 109 109 81 94 87 73 86 93 113 97 85 103 [271] 105 97 86 118 102 77 94 91 89 67 104 100 86 109 97 77 88 88 [289] 115 103 84 106 97 87 106 103 97 110 102 78 101 93 83 104 85 111 [307] 104 70 90 92 90 83 71 90 72 83 120 73 90 93 90 98 85 101 [325] 89 108 96 86 115 79 103 93 107 87 84 65 72 87 80 92 87 106 [343] 87 92 88 92 96 86 94 98 96 79 93 81 72 109 72 96 74 88 [361] 97 97 92 93 89 98 109 99 99 98 93 105 88 102 101 90 93 96 [379] 100 83 97 68 106 86 78 99 94 103 110 86 87 104 96 100 111 82 [397] 72 88 103 80 93 88 56 120 86 82 101 89 66 87 87 94 92 75 [415] 77 85 84 53 74 89 83 103 84 69 68 98 72 84 71 87 88 76 [433] 92 91 61 66 88 98 85 82 70 78 99 74 69 90 93 104 87 89 [451] 57 91 82 71 63 93 87 86 83 71 86 81 81 73 64 81 79 76 [469] 84 68 69 68 104 70 81 80 86 85 101 74 93 75 84 100 67 89 [487] 83 80 62 77 93 82 104 101 73 91 78 83 76 89 93 93 76 87 [505] 77 67 88 76 91 82 81 93 67 85 87 65 81 103 69 83 82 102 [523] 74 95 75 76 72 84 99 95 81 98 90 93 81 72 72 75 57 68 [541] 70 70 90 87 100 69 78 75 71 85 88 83 72 85 79 82 79 85 [559] 89 70 95 89 72 89 89 74 90 92 88 113 89 94 76 94 85 79 [577] 77 69 88 86 82 84 96 82 88 111 67 73 105 94 96 97 70 91 [595] 110 92 68 104 87 96 88 95 75 84 72 91 89 67 81 93 106 100 [613] 63 84 81 78 76 99 75 86 92 95 85 95 94 60 62 91 88 73 [631] 83 64 75 95 81 92 81 86 94 93 95 95 87 87 91 91 79 99 [649] 89 104 87 86 88 84 74 85 90 83 88 80 81 77 90 86 83 77 [667] 88 98 95 101 75 79 88 77 93 76 107 89 92 82 84 90 82 76 [685] 95 109 90 77 76 83 86 82 96 92 110 77 86 100 98 101 76 80 [703] 86 107 78 69 92 84 83 89 74 79 52 86 79 95 88 91 80 94 [721] 68 89 65 84 88 64 82 82 75 93 87 90 90 108 66 99 65 93 [739] 100 92 100 77 85 80 69 91 53 91 86 95 66 95 75 90 90 83 [757] 92 84 86 72 73 100 79 71 82 99 85 80 85 98 99 86 73 78 [775] 90 103 87 76 102 73 101 83 80 79 63 96 75 103 89 105 78 80 [793] 95 96 71 80 92 67 97 79 79 83 77 82 79 83 71 83 73 86 [811] 77 72 73 82 65 67 78 70 78 88 69 85 88 > 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/1gnt41337953510.tab") + } + } > m Conditional inference tree with 49 terminal nodes Response: endo Inputs: C1, C3, C5, C7, C9, C11, C13, C15, C17, C19, C21, C23, C25, C27, C29, C31, C33, C35, C37, C39, C41, C43, C45, C47 Number of observations: 823 1) C25 <= 3; criterion = 1, statistic = 323.057 2) C37 <= 3; criterion = 1, statistic = 87.559 3) C47 <= 2; criterion = 1, statistic = 45.282 4) C23 <= 2; criterion = 0.955, statistic = 9.611 5)* weights = 9 4) C23 > 2 6)* weights = 11 3) C47 > 2 7) C33 <= 3; criterion = 1, statistic = 34.356 8) C13 <= 3; criterion = 1, statistic = 23.126 9) C21 <= 2; criterion = 0.988, statistic = 12.098 10)* weights = 19 9) C21 > 2 11)* weights = 31 8) C13 > 3 12) C33 <= 2; criterion = 0.988, statistic = 12.137 13)* weights = 16 12) C33 > 2 14)* weights = 23 7) C33 > 3 15) C43 <= 3; criterion = 0.992, statistic = 12.963 16)* weights = 13 15) C43 > 3 17)* weights = 13 2) C37 > 3 18) C45 <= 3; criterion = 1, statistic = 46.812 19) C17 <= 3; criterion = 0.966, statistic = 10.142 20)* weights = 16 19) C17 > 3 21)* weights = 12 18) C45 > 3 22) C31 <= 3; criterion = 1, statistic = 24.155 23)* weights = 35 22) C31 > 3 24) C3 <= 4; criterion = 0.993, statistic = 13.089 25)* weights = 28 24) C3 > 4 26)* weights = 7 1) C25 > 3 27) C33 <= 4; criterion = 1, statistic = 199.261 28) C5 <= 3; criterion = 1, statistic = 160.463 29) C33 <= 3; criterion = 1, statistic = 44.596 30) C47 <= 3; criterion = 1, statistic = 21.315 31) C17 <= 3; criterion = 0.997, statistic = 14.676 32)* weights = 20 31) C17 > 3 33)* weights = 13 30) C47 > 3 34) C35 <= 2; criterion = 0.993, statistic = 13.22 35)* weights = 15 34) C35 > 2 36) C19 <= 3; criterion = 0.99, statistic = 12.536 37)* weights = 14 36) C19 > 3 38)* weights = 18 29) C33 > 3 39) C45 <= 3; criterion = 0.998, statistic = 15.226 40)* weights = 9 39) C45 > 3 41) C47 <= 3; criterion = 0.997, statistic = 14.682 42)* weights = 12 41) C47 > 3 43) C13 <= 3; criterion = 0.985, statistic = 11.63 44)* weights = 13 43) C13 > 3 45) C23 <= 3; criterion = 0.979, statistic = 11.05 46)* weights = 10 45) C23 > 3 47)* weights = 18 28) C5 > 3 48) C23 <= 3; criterion = 1, statistic = 88.82 49) C9 <= 3; criterion = 1, statistic = 36.762 50) C41 <= 3; criterion = 0.994, statistic = 13.472 51)* weights = 13 50) C41 > 3 52) C35 <= 3; criterion = 0.976, statistic = 10.817 53)* weights = 19 52) C35 > 3 54)* weights = 8 49) C9 > 3 55) C29 <= 4; criterion = 1, statistic = 23.026 56) C39 <= 2; criterion = 0.998, statistic = 15.97 57)* weights = 16 56) C39 > 2 58) C11 <= 4; criterion = 0.993, statistic = 13.14 59)* weights = 40 58) C11 > 4 60)* weights = 10 55) C29 > 4 61) C3 <= 4; criterion = 0.992, statistic = 12.939 62)* weights = 20 61) C3 > 4 63)* weights = 9 48) C23 > 3 64) C37 <= 4; criterion = 1, statistic = 49.957 65) C9 <= 4; criterion = 1, statistic = 45.483 66) C17 <= 3; criterion = 1, statistic = 32.833 67) C47 <= 3; criterion = 0.997, statistic = 14.806 68)* weights = 10 67) C47 > 3 69) C17 <= 2; criterion = 0.983, statistic = 11.452 70)* weights = 14 69) C17 > 2 71)* weights = 27 66) C17 > 3 72) C35 <= 3; criterion = 1, statistic = 23.119 73) C7 <= 3; criterion = 0.977, statistic = 10.905 74)* weights = 13 73) C7 > 3 75)* weights = 26 72) C35 > 3 76) C11 <= 3; criterion = 1, statistic = 22.253 77)* weights = 11 76) C11 > 3 78) C17 <= 4; criterion = 0.996, statistic = 14.169 79)* weights = 42 78) C17 > 4 80)* weights = 7 65) C9 > 4 81) C41 <= 4; criterion = 0.985, statistic = 11.697 82) C35 <= 3; criterion = 0.961, statistic = 9.894 83)* weights = 11 82) C35 > 3 84)* weights = 14 81) C41 > 4 85)* weights = 7 64) C37 > 4 86) C23 <= 4; criterion = 0.98, statistic = 11.185 87)* weights = 17 86) C23 > 4 88)* weights = 18 27) C33 > 4 89) C15 <= 3; criterion = 1, statistic = 40.888 90)* weights = 23 89) C15 > 3 91) C23 <= 4; criterion = 1, statistic = 24.746 92) C9 <= 4; criterion = 1, statistic = 18.229 93)* weights = 20 92) C9 > 4 94)* weights = 24 91) C23 > 4 95) C15 <= 4; criterion = 0.996, statistic = 14.187 96)* weights = 17 95) C15 > 4 97)* weights = 12 > postscript(file="/var/wessaorg/rcomp/tmp/241wt1337953510.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/3l3sq1337953510.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 90 91.37037 -1.37037037 2 95 94.95238 0.04761905 3 96 94.95238 1.04761905 4 93 90.36364 2.63636364 5 102 98.14286 3.85714286 6 93 92.34615 0.65384615 7 82 84.66667 -2.66666667 8 98 94.95238 3.04761905 9 89 84.20000 4.80000000 10 88 92.34615 -4.34615385 11 102 99.00000 3.00000000 12 83 84.20000 -1.20000000 13 108 106.75000 1.25000000 14 86 87.75000 -1.75000000 15 97 99.00000 -2.00000000 16 89 91.37037 -2.37037037 17 103 104.27778 -1.27777778 18 115 106.75000 8.25000000 19 90 91.95000 -1.95000000 20 88 91.37037 -3.37037037 21 81 83.48571 -2.48571429 22 74 72.50000 1.50000000 23 75 76.61538 -1.61538462 24 93 90.50000 2.50000000 25 87 92.34615 -5.34615385 26 92 99.00000 -7.00000000 27 95 86.94444 8.05555556 28 105 103.42857 1.57142857 29 93 94.95238 -1.95238095 30 90 98.15000 -8.15000000 31 87 87.75000 -0.75000000 32 105 106.75000 -1.75000000 33 92 91.95000 0.05000000 34 89 92.34615 -3.34615385 35 85 87.75000 -2.75000000 36 100 103.42857 -3.42857143 37 83 87.07143 -4.07142857 38 97 97.88235 -0.88235294 39 95 91.37037 3.62962963 40 73 68.31579 4.68421053 41 94 97.88235 -3.88235294 42 99 98.78571 0.21428571 43 99 103.42857 -4.42857143 44 88 84.37500 3.62500000 45 86 83.48571 2.51428571 46 89 84.37500 4.62500000 47 95 87.75000 7.25000000 48 83 87.69231 -4.69230769 49 72 73.56250 -1.56250000 50 98 97.88235 0.11764706 51 85 79.34783 5.65217391 52 84 84.37500 -0.37500000 53 80 86.94444 -6.94444444 54 108 106.88235 1.11764706 55 72 68.31579 3.68421053 56 110 106.75000 3.25000000 57 93 91.95000 1.05000000 58 85 82.21053 2.78947368 59 95 97.88235 -2.88235294 60 94 92.34615 1.65384615 61 80 79.23077 0.76923077 62 93 92.34615 0.65384615 63 83 87.69231 -4.69230769 64 92 95.40000 -3.40000000 65 106 106.88235 -0.88235294 66 93 89.14286 3.85714286 67 95 92.73913 2.26086957 68 96 94.95238 1.04761905 69 90 87.75000 2.25000000 70 102 98.15000 3.85000000 71 93 98.15000 -5.15000000 72 93 99.00000 -6.00000000 73 102 97.88235 4.11764706 74 94 94.95238 -0.95238095 75 85 91.37037 -6.37037037 76 87 92.73913 -5.73913043 77 77 85.30769 -8.30769231 78 83 87.75000 -4.75000000 79 79 79.34783 -0.34782609 80 110 114.16667 -4.16666667 81 90 88.20000 1.80000000 82 95 97.88235 -2.88235294 83 80 82.21053 -2.21052632 84 95 94.95238 0.04761905 85 105 104.27778 0.72222222 86 91 91.95000 -0.95000000 87 69 79.23077 -10.23076923 88 81 76.61538 4.38461538 89 75 80.50000 -5.50000000 90 98 87.69231 10.30769231 91 101 92.73913 8.26086957 92 96 98.78571 -2.78571429 93 86 87.07143 -1.07142857 94 91 88.20000 2.80000000 95 72 68.31579 3.68421053 96 76 73.56250 2.43750000 97 95 92.61111 2.38888889 98 96 94.95238 1.04761905 99 92 92.34615 -0.34615385 100 77 83.48571 -6.48571429 101 90 91.95000 -1.95000000 102 85 84.37500 0.62500000 103 81 83.48571 -2.48571429 104 80 76.61538 3.38461538 105 91 94.95238 -3.95238095 106 89 90.36364 -1.36363636 107 78 83.48571 -5.48571429 108 66 72.50000 -6.50000000 109 79 90.36364 -11.36363636 110 91 87.07143 3.92857143 111 88 88.20000 -0.20000000 112 61 58.11111 2.88888889 113 77 79.34783 -2.34782609 114 81 83.48571 -2.48571429 115 91 91.37037 -0.37037037 116 75 83.48571 -8.48571429 117 87 91.95000 -4.95000000 118 93 97.88235 -4.88235294 119 85 84.20000 0.80000000 120 88 89.14286 -1.14285714 121 86 87.75000 -1.75000000 122 93 98.15000 -5.15000000 123 77 82.21053 -5.21052632 124 92 91.37037 0.62962963 125 80 90.50000 -10.50000000 126 98 94.95238 3.04761905 127 109 106.88235 2.11764706 128 95 92.34615 2.65384615 129 75 70.62500 4.37500000 130 88 87.69231 0.30769231 131 87 93.00000 -6.00000000 132 84 90.36364 -6.36363636 133 82 73.56250 8.43750000 134 107 100.42857 6.57142857 135 94 92.34615 1.65384615 136 86 83.48571 2.51428571 137 89 87.07143 1.92857143 138 95 92.73913 2.26086957 139 81 87.75000 -6.75000000 140 87 83.48571 3.51428571 141 99 106.75000 -7.75000000 142 87 91.37037 -4.37037037 143 83 87.07143 -4.07142857 144 88 87.75000 0.25000000 145 89 91.37037 -2.37037037 146 68 77.15385 -9.15384615 147 117 106.75000 10.25000000 148 88 92.34615 -4.34615385 149 84 87.07143 -3.07142857 150 94 97.88235 -3.88235294 151 109 106.75000 2.25000000 152 108 106.75000 1.25000000 153 61 72.83871 -11.83870968 154 107 98.15000 8.85000000 155 80 82.21053 -2.21052632 156 92 91.37037 0.62962963 157 94 92.61111 1.38888889 158 95 91.37037 3.62962963 159 83 84.37500 -1.37500000 160 92 94.95238 -2.95238095 161 75 72.83871 2.16129032 162 94 89.14286 4.85714286 163 83 83.48571 -0.48571429 164 110 106.75000 3.25000000 165 80 82.21053 -2.21052632 166 101 104.27778 -3.27777778 167 81 92.73913 -11.73913043 168 59 58.11111 0.88888889 169 90 90.50000 -0.50000000 170 94 87.69231 6.30769231 171 83 82.21053 0.78947368 172 90 87.75000 2.25000000 173 82 82.21053 -0.21052632 174 93 93.00000 0.00000000 175 94 98.14286 -4.14285714 176 84 87.75000 -3.75000000 177 110 114.16667 -4.16666667 178 69 70.62500 -1.62500000 179 97 97.88235 -0.88235294 180 95 87.75000 7.25000000 181 98 104.27778 -6.27777778 182 78 83.48571 -5.48571429 183 89 98.14286 -9.14285714 184 93 89.14286 3.85714286 185 106 92.73913 13.26086957 186 71 70.62500 0.37500000 187 91 92.73913 -1.73913043 188 96 98.14286 -2.14285714 189 108 104.27778 3.72222222 190 93 94.95238 -1.95238095 191 95 95.40000 -0.40000000 192 89 87.69231 1.30769231 193 72 72.83871 -0.83870968 194 107 106.75000 0.25000000 195 102 93.00000 9.00000000 196 88 89.14286 -1.14285714 197 95 95.40000 -0.40000000 198 94 94.95238 -0.95238095 199 96 92.73913 3.26086957 200 92 87.07143 4.92857143 201 110 106.75000 3.25000000 202 94 94.95238 -0.95238095 203 95 98.15000 -3.15000000 204 72 68.31579 3.68421053 205 103 92.34615 10.65384615 206 89 87.61538 1.38461538 207 96 92.34615 3.65384615 208 92 92.34615 -0.34615385 209 90 87.75000 2.25000000 210 86 89.14286 -3.14285714 211 90 92.34615 -2.34615385 212 99 98.78571 0.21428571 213 86 83.48571 2.51428571 214 89 90.36364 -1.36363636 215 108 92.73913 15.26086957 216 94 91.37037 2.62962963 217 83 80.50000 2.50000000 218 76 79.23077 -3.23076923 219 102 99.00000 3.00000000 220 100 98.78571 1.21428571 221 90 93.00000 -3.00000000 222 112 103.42857 8.57142857 223 89 92.34615 -3.34615385 224 98 98.14286 -0.14285714 225 81 78.08333 2.91666667 226 116 104.27778 11.72222222 227 101 89.14286 11.85714286 228 85 79.23077 5.76923077 229 104 106.88235 -2.88235294 230 92 91.37037 0.62962963 231 49 58.11111 -9.11111111 232 94 97.88235 -3.88235294 233 105 104.27778 0.72222222 234 94 89.14286 4.85714286 235 85 83.48571 1.51428571 236 96 90.50000 5.50000000 237 79 82.21053 -3.21052632 238 106 104.27778 1.72222222 239 79 72.50000 6.50000000 240 101 97.88235 3.11764706 241 90 84.66667 5.33333333 242 114 114.16667 -0.16666667 243 99 106.75000 -7.75000000 244 79 85.30769 -6.30769231 245 94 83.48571 10.51428571 246 88 87.07143 0.92857143 247 93 94.95238 -1.95238095 248 91 91.95000 -0.95000000 249 77 84.20000 -7.20000000 250 101 106.75000 -5.75000000 251 81 79.34783 1.65217391 252 116 114.16667 1.83333333 253 86 87.69231 -1.69230769 254 95 91.37037 3.62962963 255 91 91.37037 -0.37037037 256 95 91.95000 3.05000000 257 78 72.83871 5.16129032 258 70 72.83871 -2.83870968 259 109 106.75000 2.25000000 260 109 104.27778 4.72222222 261 81 83.48571 -2.48571429 262 94 94.95238 -0.95238095 263 87 87.75000 -0.75000000 264 73 76.61538 -3.61538462 265 86 83.48571 2.51428571 266 93 87.07143 5.92857143 267 113 106.88235 6.11764706 268 97 94.95238 2.04761905 269 85 86.94444 -1.94444444 270 103 98.15000 4.85000000 271 105 106.88235 -1.88235294 272 97 95.40000 1.60000000 273 86 87.75000 -1.75000000 274 118 114.16667 3.83333333 275 102 106.88235 -4.88235294 276 77 84.37500 -7.37500000 277 94 91.37037 2.62962963 278 91 92.73913 -1.73913043 279 89 85.30769 3.69230769 280 67 68.31579 -1.31578947 281 104 106.75000 -2.75000000 282 100 94.95238 5.04761905 283 86 89.14286 -3.14285714 284 109 106.75000 2.25000000 285 97 94.95238 2.04761905 286 77 84.37500 -7.37500000 287 88 83.48571 4.51428571 288 88 85.30769 2.69230769 289 115 114.16667 0.83333333 290 103 92.61111 10.38888889 291 84 82.21053 1.78947368 292 106 98.15000 7.85000000 293 97 91.95000 5.05000000 294 87 87.75000 -0.75000000 295 106 104.27778 1.72222222 296 103 99.00000 4.00000000 297 97 92.73913 4.26086957 298 110 114.16667 -4.16666667 299 102 98.78571 3.21428571 300 78 82.21053 -4.21052632 301 101 95.40000 5.60000000 302 93 94.95238 -1.95238095 303 83 83.48571 -0.48571429 304 104 99.00000 5.00000000 305 85 92.73913 -7.73913043 306 111 106.88235 4.11764706 307 104 104.27778 -0.27777778 308 70 67.90909 2.09090909 309 90 89.14286 0.85714286 310 92 98.78571 -6.78571429 311 90 87.75000 2.25000000 312 83 83.48571 -0.48571429 313 71 84.20000 -13.20000000 314 90 94.95238 -4.95238095 315 72 70.62500 1.37500000 316 83 78.08333 4.91666667 317 120 114.16667 5.83333333 318 73 72.83871 0.16129032 319 90 84.37500 5.62500000 320 93 92.73913 0.26086957 321 90 87.75000 2.25000000 322 98 87.75000 10.25000000 323 85 87.07143 -2.07142857 324 101 106.75000 -5.75000000 325 89 87.75000 1.25000000 326 108 98.78571 9.21428571 327 96 92.61111 3.38888889 328 86 87.61538 -1.61538462 329 115 114.16667 0.83333333 330 79 89.14286 -10.14285714 331 103 98.15000 4.85000000 332 93 94.95238 -1.95238095 333 107 106.75000 0.25000000 334 87 79.23077 7.76923077 335 84 79.34783 4.65217391 336 65 58.11111 6.88888889 337 72 72.83871 -0.83870968 338 87 91.95000 -4.95000000 339 80 88.20000 -8.20000000 340 92 90.50000 1.50000000 341 87 90.36364 -3.36363636 342 106 106.88235 -0.88235294 343 87 89.14286 -2.14285714 344 92 87.75000 4.25000000 345 88 83.48571 4.51428571 346 92 92.34615 -0.34615385 347 96 95.40000 0.60000000 348 86 83.48571 2.51428571 349 94 90.36364 3.63636364 350 98 98.78571 -0.78571429 351 96 85.30769 10.69230769 352 79 73.56250 5.43750000 353 93 93.00000 0.00000000 354 81 89.14286 -8.14285714 355 72 79.34783 -7.34782609 356 109 114.16667 -5.16666667 357 72 72.83871 -0.83870968 358 96 94.95238 1.04761905 359 74 78.08333 -4.08333333 360 88 87.75000 0.25000000 361 97 92.73913 4.26086957 362 97 97.88235 -0.88235294 363 92 89.14286 2.85714286 364 93 87.07143 5.92857143 365 89 84.37500 4.62500000 366 98 97.88235 0.11764706 367 109 106.88235 2.11764706 368 99 98.15000 0.85000000 369 99 94.95238 4.04761905 370 98 94.95238 3.04761905 371 93 94.95238 -1.95238095 372 105 98.15000 6.85000000 373 88 83.48571 4.51428571 374 102 106.88235 -4.88235294 375 101 94.95238 6.04761905 376 90 92.73913 -2.73913043 377 93 94.95238 -1.95238095 378 96 94.95238 1.04761905 379 100 98.78571 1.21428571 380 83 85.30769 -2.30769231 381 97 91.95000 5.05000000 382 68 73.56250 -5.56250000 383 106 97.88235 8.11764706 384 86 84.20000 1.80000000 385 78 79.34783 -1.34782609 386 99 98.14286 0.85714286 387 94 94.95238 -0.95238095 388 103 98.15000 4.85000000 389 110 104.27778 5.72222222 390 86 87.75000 -1.75000000 391 87 89.14286 -2.14285714 392 104 94.95238 9.04761905 393 96 94.95238 1.04761905 394 100 100.42857 -0.42857143 395 111 106.88235 4.11764706 396 82 82.66667 -0.66666667 397 72 72.83871 -0.83870968 398 88 87.75000 0.25000000 399 103 103.42857 -0.42857143 400 80 85.30769 -5.30769231 401 93 94.95238 -1.95238095 402 88 92.34615 -4.34615385 403 56 68.31579 -12.31578947 404 120 114.16667 5.83333333 405 86 89.14286 -3.14285714 406 82 87.75000 -5.75000000 407 101 92.34615 8.65384615 408 89 89.14286 -0.14285714 409 66 78.08333 -12.08333333 410 87 84.66667 2.33333333 411 87 87.75000 -0.75000000 412 94 94.95238 -0.95238095 413 92 91.95000 0.05000000 414 75 70.62500 4.37500000 415 77 77.15385 -0.15384615 416 85 85.30769 -0.30769231 417 84 87.61538 -3.61538462 418 53 67.90909 -14.90909091 419 74 78.08333 -4.08333333 420 89 84.20000 4.80000000 421 83 80.50000 2.50000000 422 103 106.88235 -3.88235294 423 84 79.34783 4.65217391 424 69 72.50000 -3.50000000 425 68 67.90909 0.09090909 426 98 99.00000 -1.00000000 427 72 76.61538 -4.61538462 428 84 76.93333 7.06666667 429 71 76.93333 -5.93333333 430 87 87.75000 -0.75000000 431 88 92.34615 -4.34615385 432 76 82.21053 -6.21052632 433 92 97.88235 -5.88235294 434 91 94.95238 -3.95238095 435 61 58.11111 2.88888889 436 66 68.31579 -2.31578947 437 88 76.61538 11.38461538 438 98 92.73913 5.26086957 439 85 79.34783 5.65217391 440 82 84.20000 -2.20000000 441 70 79.23077 -9.23076923 442 78 79.34783 -1.34782609 443 99 98.78571 0.21428571 444 74 73.56250 0.43750000 445 69 70.62500 -1.62500000 446 90 93.00000 -3.00000000 447 93 91.37037 1.62962963 448 104 103.42857 0.57142857 449 87 87.61538 -0.61538462 450 89 88.20000 0.80000000 451 57 58.11111 -1.11111111 452 91 92.61111 -1.61111111 453 82 79.34783 2.65217391 454 71 72.50000 -1.50000000 455 63 68.31579 -5.31578947 456 93 84.20000 8.80000000 457 87 86.94444 0.05555556 458 86 84.37500 1.62500000 459 83 87.75000 -4.75000000 460 71 70.62500 0.37500000 461 86 92.61111 -6.61111111 462 81 78.08333 2.91666667 463 81 79.34783 1.65217391 464 73 76.93333 -3.93333333 465 64 72.83871 -8.83870968 466 81 78.08333 2.91666667 467 79 67.90909 11.09090909 468 76 76.93333 -0.93333333 469 84 89.14286 -5.14285714 470 68 72.83871 -4.83870968 471 69 72.50000 -3.50000000 472 68 68.31579 -0.31578947 473 104 89.14286 14.85714286 474 70 76.61538 -6.61538462 475 81 72.50000 8.50000000 476 80 83.48571 -3.48571429 477 86 79.23077 6.76923077 478 85 92.34615 -7.34615385 479 101 103.42857 -2.42857143 480 74 72.83871 1.16129032 481 93 92.61111 0.38888889 482 75 72.83871 2.16129032 483 84 90.50000 -6.50000000 484 100 99.00000 1.00000000 485 67 70.62500 -3.62500000 486 89 86.94444 2.05555556 487 83 78.08333 4.91666667 488 80 84.37500 -4.37500000 489 62 58.11111 3.88888889 490 77 76.93333 0.06666667 491 93 91.37037 1.62962963 492 82 80.50000 1.50000000 493 104 106.75000 -2.75000000 494 101 104.27778 -3.27777778 495 73 77.15385 -4.15384615 496 91 92.34615 -1.34615385 497 78 84.37500 -6.37500000 498 83 76.93333 6.06666667 499 76 72.83871 3.16129032 500 89 82.66667 6.33333333 501 93 94.95238 -1.95238095 502 93 90.50000 2.50000000 503 76 89.14286 -13.14285714 504 87 89.14286 -2.14285714 505 77 72.83871 4.16129032 506 67 67.90909 -0.90909091 507 88 84.37500 3.62500000 508 76 78.08333 -2.08333333 509 91 87.75000 3.25000000 510 82 80.50000 1.50000000 511 81 76.93333 4.06666667 512 93 86.94444 6.05555556 513 67 68.31579 -1.31578947 514 85 86.94444 -1.94444444 515 87 91.37037 -4.37037037 516 65 70.62500 -5.62500000 517 81 86.94444 -5.94444444 518 103 92.73913 10.26086957 519 69 70.62500 -1.62500000 520 83 88.20000 -5.20000000 521 82 82.66667 -0.66666667 522 102 104.27778 -2.27777778 523 74 72.83871 1.16129032 524 95 84.66667 10.33333333 525 75 80.50000 -5.50000000 526 76 72.50000 3.50000000 527 72 72.50000 -0.50000000 528 84 86.94444 -2.94444444 529 99 90.36364 8.63636364 530 95 91.95000 3.05000000 531 81 86.94444 -5.94444444 532 98 91.37037 6.62962963 533 90 87.61538 2.38461538 534 93 98.78571 -5.78571429 535 81 85.30769 -4.30769231 536 72 76.61538 -4.61538462 537 72 73.56250 -1.56250000 538 75 79.34783 -4.34782609 539 57 58.11111 -1.11111111 540 68 72.83871 -4.83870968 541 70 73.56250 -3.56250000 542 70 68.31579 1.68421053 543 90 92.61111 -2.61111111 544 87 87.61538 -0.61538462 545 100 104.27778 -4.27777778 546 69 72.50000 -3.50000000 547 78 79.23077 -1.23076923 548 75 79.34783 -4.34782609 549 71 77.15385 -6.15384615 550 85 87.75000 -2.75000000 551 88 82.21053 5.78947368 552 83 79.23077 3.76923077 553 72 73.56250 -1.56250000 554 85 86.94444 -1.94444444 555 79 72.50000 6.50000000 556 82 83.48571 -1.48571429 557 79 70.62500 8.37500000 558 85 87.75000 -2.75000000 559 89 87.75000 1.25000000 560 70 72.83871 -2.83870968 561 95 90.36364 4.63636364 562 89 89.14286 -0.14285714 563 72 67.90909 4.09090909 564 89 77.15385 11.84615385 565 89 92.61111 -3.61111111 566 74 76.93333 -2.93333333 567 90 91.95000 -1.95000000 568 92 94.95238 -2.95238095 569 88 82.21053 5.78947368 570 113 114.16667 -1.16666667 571 89 91.37037 -2.37037037 572 94 86.94444 7.05555556 573 76 72.83871 3.16129032 574 94 94.95238 -0.95238095 575 85 91.37037 -6.37037037 576 79 76.61538 2.38461538 577 77 76.93333 0.06666667 578 69 76.61538 -7.61538462 579 88 91.95000 -3.95000000 580 86 92.61111 -6.61111111 581 82 73.56250 8.43750000 582 84 86.94444 -2.94444444 583 96 104.27778 -8.27777778 584 82 87.07143 -5.07142857 585 88 82.21053 5.78947368 586 111 106.75000 4.25000000 587 67 68.31579 -1.31578947 588 73 70.62500 2.37500000 589 105 106.88235 -1.88235294 590 94 98.78571 -4.78571429 591 96 98.15000 -2.15000000 592 97 92.73913 4.26086957 593 70 70.62500 -0.62500000 594 91 87.61538 3.38461538 595 110 106.88235 3.11764706 596 92 98.15000 -6.15000000 597 68 76.93333 -8.93333333 598 104 98.78571 5.21428571 599 87 84.20000 2.80000000 600 96 91.37037 4.62962963 601 88 87.61538 0.38461538 602 95 90.36364 4.63636364 603 75 72.83871 2.16129032 604 84 87.61538 -3.61538462 605 72 72.83871 -0.83870968 606 91 93.00000 -2.00000000 607 89 88.20000 0.80000000 608 67 76.93333 -9.93333333 609 81 72.50000 8.50000000 610 93 92.34615 0.65384615 611 106 106.75000 -0.75000000 612 100 95.40000 4.60000000 613 63 67.90909 -4.90909091 614 84 76.93333 7.06666667 615 81 73.56250 7.43750000 616 78 83.48571 -5.48571429 617 76 72.83871 3.16129032 618 99 91.95000 7.05000000 619 75 80.50000 -5.50000000 620 86 87.69231 -1.69230769 621 92 92.73913 -0.73913043 622 95 94.95238 0.04761905 623 85 87.69231 -2.69230769 624 95 98.15000 -3.15000000 625 94 85.30769 8.69230769 626 60 67.90909 -7.90909091 627 62 68.31579 -6.31578947 628 91 92.61111 -1.61111111 629 88 98.15000 -10.15000000 630 73 72.83871 0.16129032 631 83 83.48571 -0.48571429 632 64 72.50000 -8.50000000 633 75 77.15385 -2.15384615 634 95 92.61111 2.38888889 635 81 83.48571 -2.48571429 636 92 87.61538 4.38461538 637 81 80.50000 0.50000000 638 86 83.48571 2.51428571 639 94 92.61111 1.38888889 640 93 98.15000 -5.15000000 641 95 86.94444 8.05555556 642 95 86.94444 8.05555556 643 87 83.48571 3.51428571 644 87 91.37037 -4.37037037 645 91 94.95238 -3.95238095 646 91 93.00000 -2.00000000 647 79 83.48571 -4.48571429 648 99 98.15000 0.85000000 649 89 87.75000 1.25000000 650 104 97.88235 6.11764706 651 87 87.07143 -0.07142857 652 86 91.95000 -5.95000000 653 88 80.50000 7.50000000 654 84 87.69231 -3.69230769 655 74 73.56250 0.43750000 656 85 78.08333 6.91666667 657 90 92.61111 -2.61111111 658 83 87.75000 -4.75000000 659 88 82.21053 5.78947368 660 80 79.34783 0.65217391 661 81 82.21053 -1.21052632 662 77 84.66667 -7.66666667 663 90 89.14286 0.85714286 664 86 87.69231 -1.69230769 665 83 82.66667 0.33333333 666 77 76.93333 0.06666667 667 88 89.14286 -1.14285714 668 98 94.95238 3.04761905 669 95 87.75000 7.25000000 670 101 92.61111 8.38888889 671 75 72.83871 2.16129032 672 79 72.50000 6.50000000 673 88 82.66667 5.33333333 674 77 79.23077 -2.23076923 675 93 92.61111 0.38888889 676 76 72.83871 3.16129032 677 107 104.27778 2.72222222 678 89 89.14286 -0.14285714 679 92 79.23077 12.76923077 680 82 83.48571 -1.48571429 681 84 79.34783 4.65217391 682 90 87.61538 2.38461538 683 82 92.73913 -10.73913043 684 76 78.08333 -2.08333333 685 95 92.34615 2.65384615 686 109 98.14286 10.85714286 687 90 95.40000 -5.40000000 688 77 84.37500 -7.37500000 689 76 82.66667 -6.66666667 690 83 83.48571 -0.48571429 691 86 88.20000 -2.20000000 692 82 68.31579 13.68421053 693 96 88.20000 7.80000000 694 92 93.00000 -1.00000000 695 110 106.88235 3.11764706 696 77 80.50000 -3.50000000 697 86 85.30769 0.69230769 698 100 104.27778 -4.27777778 699 98 100.42857 -2.42857143 700 101 98.15000 2.85000000 701 76 92.73913 -16.73913043 702 80 79.34783 0.65217391 703 86 84.66667 1.33333333 704 107 97.88235 9.11764706 705 78 77.15385 0.84615385 706 69 72.83871 -3.83870968 707 92 85.30769 6.69230769 708 84 91.95000 -7.95000000 709 83 86.94444 -3.94444444 710 89 84.37500 4.62500000 711 74 76.61538 -2.61538462 712 79 72.50000 6.50000000 713 52 58.11111 -6.11111111 714 86 84.66667 1.33333333 715 79 72.83871 6.16129032 716 95 92.73913 2.26086957 717 88 87.69231 0.30769231 718 91 95.40000 -4.40000000 719 80 82.21053 -2.21052632 720 94 92.34615 1.65384615 721 68 72.50000 -4.50000000 722 89 87.61538 1.38461538 723 65 67.90909 -2.90909091 724 84 86.94444 -2.94444444 725 88 89.14286 -1.14285714 726 64 68.31579 -4.31578947 727 82 82.66667 -0.66666667 728 82 77.15385 4.84615385 729 75 77.15385 -2.15384615 730 93 91.37037 1.62962963 731 87 89.14286 -2.14285714 732 90 88.20000 1.80000000 733 90 87.69231 2.30769231 734 108 106.75000 1.25000000 735 66 73.56250 -7.56250000 736 99 91.95000 7.05000000 737 65 68.31579 -3.31578947 738 93 92.34615 0.65384615 739 100 98.15000 1.85000000 740 92 91.37037 0.62962963 741 100 106.75000 -6.75000000 742 77 82.21053 -5.21052632 743 85 86.94444 -1.94444444 744 80 76.93333 3.06666667 745 69 72.83871 -3.83870968 746 91 92.61111 -1.61111111 747 53 70.62500 -17.62500000 748 91 83.48571 7.51428571 749 86 79.34783 6.65217391 750 95 91.37037 3.62962963 751 66 72.50000 -6.50000000 752 95 94.95238 0.04761905 753 75 72.83871 2.16129032 754 90 83.48571 6.51428571 755 90 90.36364 -0.36363636 756 83 76.61538 6.38461538 757 92 87.75000 4.25000000 758 84 80.50000 3.50000000 759 86 80.50000 5.50000000 760 72 67.90909 4.09090909 761 73 79.34783 -6.34782609 762 100 89.14286 10.85714286 763 79 82.66667 -3.66666667 764 71 68.31579 2.68421053 765 82 87.61538 -5.61538462 766 99 98.78571 0.21428571 767 85 79.34783 5.65217391 768 80 84.66667 -4.66666667 769 85 70.62500 14.37500000 770 98 92.34615 5.65384615 771 99 100.42857 -1.42857143 772 86 77.15385 8.84615385 773 73 72.83871 0.16129032 774 78 77.15385 0.84615385 775 90 84.37500 5.62500000 776 103 100.42857 2.57142857 777 87 84.66667 2.33333333 778 76 80.50000 -4.50000000 779 102 93.00000 9.00000000 780 73 73.56250 -0.56250000 781 101 100.42857 0.57142857 782 83 87.07143 -4.07142857 783 80 76.61538 3.38461538 784 79 72.83871 6.16129032 785 63 72.50000 -9.50000000 786 96 91.95000 4.05000000 787 75 79.34783 -4.34782609 788 103 106.88235 -3.88235294 789 89 92.61111 -3.61111111 790 105 106.75000 -1.75000000 791 78 79.23077 -1.23076923 792 80 84.66667 -4.66666667 793 95 100.42857 -5.42857143 794 96 90.50000 5.50000000 795 71 68.31579 2.68421053 796 80 80.50000 -0.50000000 797 92 93.00000 -1.00000000 798 67 70.62500 -3.62500000 799 97 95.40000 1.60000000 800 79 83.48571 -4.48571429 801 79 85.30769 -6.30769231 802 83 84.66667 -1.66666667 803 77 78.08333 -1.08333333 804 82 87.75000 -5.75000000 805 79 77.15385 1.84615385 806 83 84.66667 -1.66666667 807 71 73.56250 -2.56250000 808 83 82.66667 0.33333333 809 73 79.34783 -6.34782609 810 86 87.75000 -1.75000000 811 77 92.73913 -15.73913043 812 72 77.15385 -5.15384615 813 73 79.34783 -6.34782609 814 82 76.93333 5.06666667 815 65 73.56250 -8.56250000 816 67 72.50000 -5.50000000 817 78 67.90909 10.09090909 818 70 68.31579 1.68421053 819 78 72.50000 5.50000000 820 88 82.21053 5.78947368 821 69 79.23077 -10.23076923 822 85 87.75000 -2.75000000 823 88 87.75000 0.25000000 > 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/44b1n1337953510.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/5q3891337953510.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/63wpd1337953511.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/73i2w1337953511.tab") + } > > try(system("convert tmp/241wt1337953510.ps tmp/241wt1337953510.png",intern=TRUE)) character(0) > try(system("convert tmp/3l3sq1337953510.ps tmp/3l3sq1337953510.png",intern=TRUE)) character(0) > try(system("convert tmp/44b1n1337953510.ps tmp/44b1n1337953510.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 16.756 0.617 17.387