R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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. > x <- array(list(8.2 + ,3.7 + ,5.1 + ,6.8 + ,4.9 + ,8.5 + ,4.3 + ,5 + ,5.7 + ,4.9 + ,4.3 + ,5.3 + ,7.9 + ,8.2 + ,4 + ,3.9 + ,8.9 + ,4.5 + ,4 + ,4.5 + ,7.4 + ,9.2 + ,4.6 + ,5.4 + ,4.8 + ,3 + ,4.1 + ,8.8 + ,4.7 + ,6.4 + ,3.6 + ,4.3 + ,7.1 + ,3.5 + ,3.5 + ,6.8 + ,6 + ,9 + ,4.5 + ,4.5 + ,4.7 + ,3.3 + ,4.7 + ,8.5 + ,4.3 + ,6.5 + ,9.5 + ,3.6 + ,5.7 + ,2 + ,4.2 + ,8.9 + ,2.3 + ,6.9 + ,2.5 + ,2.1 + ,6.3 + ,3.7 + ,6.3 + ,6.9 + ,3.6 + ,6.2 + ,4.8 + ,4.3 + ,7 + ,4.6 + ,6.1 + ,9.3 + ,5.9 + ,5.8 + ,4.4 + ,4.4 + ,5.5 + ,4.4 + ,5.8 + ,8.4 + ,5.7 + ,6.4 + ,5.3 + ,4.1 + ,7.4 + ,4 + ,3.7 + ,6.8 + ,6.8 + ,8.7 + ,7.5 + ,3.8 + ,6 + ,3.2 + ,4.9 + ,8.2 + ,3.9 + ,6.1 + ,5.9 + ,3 + ,8.4 + ,4.4 + ,4.5 + ,7.6 + ,6.9 + ,9.5 + ,5.3 + ,5.1 + ,7.6 + ,4.2 + ,2.6 + ,7.1 + ,8.4 + ,9.2 + ,3 + ,4.5 + ,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') + ,1:200)) > y <- array(NA,dim=c(8,200),dimnames=list(c('Klantentevredenheid','Leveringssnelheid','Prijsflexibiliteit','Prijszetting','Productgamma','Productkwaliteit','Productontwikkeling','Facturatie '),1:200)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par4 = 'no' > par3 = '3' > par2 = 'none' > par1 = '1' > par4 <- 'no' > par3 <- '3' > par2 <- 'none' > par1 <- '1' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., 2012, Recursive Partitioning (Regression Trees) (v1.0.3) 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 Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, as.Date.numeric Loading required package: sandwich Loading required package: strucchange Loading required package: vcd Loading required package: MASS Loading required package: colorspace > library(Hmisc) Hmisc library by Frank E Harrell Jr Type library(help='Hmisc'), ?Overview, or ?Hmisc.Overview') to see overall documentation. NOTE:Hmisc no longer redefines [.factor to drop unused levels when subsetting. To get the old behavior of Hmisc type dropUnusedLevels(). 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 <- data.frame(t(y)) > is.data.frame(x) [1] TRUE > x <- x[!is.na(x[,par1]),] > k <- length(x[1,]) > n <- length(x[,1]) > colnames(x)[par1] [1] "Klantentevredenheid" > x[,par1] [1] 8.2 5.7 8.9 4.8 7.1 4.7 5.7 6.3 7.0 5.5 7.4 6.0 8.4 7.6 8.0 6.6 6.4 7.4 [19] 6.8 7.6 5.4 9.9 7.0 8.6 4.8 6.6 6.3 5.4 6.3 5.4 6.1 6.4 5.4 7.3 6.3 5.4 [37] 7.1 8.7 7.6 6.0 7.0 7.6 8.9 7.6 5.5 7.4 7.1 7.6 8.7 8.6 5.4 5.7 8.7 6.1 [55] 7.3 7.7 9.0 8.2 7.1 7.9 6.6 8.0 6.3 6.0 5.4 7.6 6.4 6.1 5.2 6.6 7.6 5.8 [73] 7.9 8.6 8.2 7.1 6.4 7.6 8.9 5.7 7.1 7.4 6.6 5.0 8.2 5.2 5.2 8.2 7.3 8.2 [91] 7.4 4.8 7.6 8.9 7.7 7.3 6.3 5.4 6.4 6.4 5.4 8.7 6.1 8.4 7.9 7.0 8.7 7.9 [109] 7.1 5.8 8.4 7.1 7.6 7.3 8.0 6.1 8.7 5.8 6.4 6.4 9.0 6.4 6.0 8.7 5.0 7.4 [127] 8.6 5.8 9.8 4.8 7.0 5.5 5.0 6.0 8.0 7.9 4.8 6.4 4.8 6.4 6.8 7.9 8.9 7.4 [145] 7.0 7.0 6.0 7.4 7.6 4.8 7.3 6.3 5.0 7.1 6.3 6.8 5.2 6.3 6.1 7.3 5.4 8.0 [163] 7.4 7.3 7.3 6.4 5.7 5.7 6.6 6.3 5.4 7.4 8.6 7.3 6.3 8.7 8.6 8.4 7.4 9.9 [181] 8.0 7.9 9.8 8.9 6.8 7.4 4.7 5.4 7.0 7.1 6.3 5.5 5.4 5.4 4.8 8.2 7.9 8.6 [199] 8.2 8.6 > 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]) 4.7 4.8 5 5.2 5.4 5.5 5.7 5.8 6 6.1 6.3 6.4 6.6 6.8 7 7.1 7.3 7.4 7.6 7.7 2 8 4 4 14 4 6 4 6 6 12 12 6 4 8 10 10 12 12 2 7.9 8 8.2 8.4 8.6 8.7 8.9 9 9.8 9.9 8 6 8 4 8 8 6 2 2 2 > colnames(x) [1] "Klantentevredenheid" "Leveringssnelheid" "Prijsflexibiliteit" [4] "Prijszetting" "Productgamma" "Productkwaliteit" [7] "Productontwikkeling" "Facturatie." > colnames(x)[par1] [1] "Klantentevredenheid" > x[,par1] [1] 8.2 5.7 8.9 4.8 7.1 4.7 5.7 6.3 7.0 5.5 7.4 6.0 8.4 7.6 8.0 6.6 6.4 7.4 [19] 6.8 7.6 5.4 9.9 7.0 8.6 4.8 6.6 6.3 5.4 6.3 5.4 6.1 6.4 5.4 7.3 6.3 5.4 [37] 7.1 8.7 7.6 6.0 7.0 7.6 8.9 7.6 5.5 7.4 7.1 7.6 8.7 8.6 5.4 5.7 8.7 6.1 [55] 7.3 7.7 9.0 8.2 7.1 7.9 6.6 8.0 6.3 6.0 5.4 7.6 6.4 6.1 5.2 6.6 7.6 5.8 [73] 7.9 8.6 8.2 7.1 6.4 7.6 8.9 5.7 7.1 7.4 6.6 5.0 8.2 5.2 5.2 8.2 7.3 8.2 [91] 7.4 4.8 7.6 8.9 7.7 7.3 6.3 5.4 6.4 6.4 5.4 8.7 6.1 8.4 7.9 7.0 8.7 7.9 [109] 7.1 5.8 8.4 7.1 7.6 7.3 8.0 6.1 8.7 5.8 6.4 6.4 9.0 6.4 6.0 8.7 5.0 7.4 [127] 8.6 5.8 9.8 4.8 7.0 5.5 5.0 6.0 8.0 7.9 4.8 6.4 4.8 6.4 6.8 7.9 8.9 7.4 [145] 7.0 7.0 6.0 7.4 7.6 4.8 7.3 6.3 5.0 7.1 6.3 6.8 5.2 6.3 6.1 7.3 5.4 8.0 [163] 7.4 7.3 7.3 6.4 5.7 5.7 6.6 6.3 5.4 7.4 8.6 7.3 6.3 8.7 8.6 8.4 7.4 9.9 [181] 8.0 7.9 9.8 8.9 6.8 7.4 4.7 5.4 7.0 7.1 6.3 5.5 5.4 5.4 4.8 8.2 7.9 8.6 [199] 8.2 8.6 > 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/111kj1355254999.tab") + } + } > m Conditional inference tree with 10 terminal nodes Response: Klantentevredenheid Inputs: Leveringssnelheid, Prijsflexibiliteit, Prijszetting, Productgamma, Productkwaliteit, Productontwikkeling, Facturatie. Number of observations: 200 1) Productgamma <= 5.7; criterion = 1, statistic = 83.133 2) Leveringssnelheid <= 3.4; criterion = 1, statistic = 41.286 3) Prijszetting <= 8.4; criterion = 0.99, statistic = 10.24 4) Leveringssnelheid <= 2.8; criterion = 0.957, statistic = 7.458 5)* weights = 12 4) Leveringssnelheid > 2.8 6) Productkwaliteit <= 7.5; criterion = 0.987, statistic = 9.672 7)* weights = 14 6) Productkwaliteit > 7.5 8)* weights = 8 3) Prijszetting > 8.4 9)* weights = 12 2) Leveringssnelheid > 3.4 10)* weights = 58 1) Productgamma > 5.7 11) Leveringssnelheid <= 3.8; criterion = 0.998, statistic = 13.083 12)* weights = 20 11) Leveringssnelheid > 3.8 13) Productkwaliteit <= 9.1; criterion = 0.967, statistic = 7.964 14) Productgamma <= 7.5; criterion = 0.969, statistic = 8.074 15)* weights = 30 14) Productgamma > 7.5 16)* weights = 10 13) Productkwaliteit > 9.1 17) Prijszetting <= 4.6; criterion = 0.999, statistic = 14.632 18)* weights = 8 17) Prijszetting > 4.6 19)* weights = 28 > postscript(file="/var/wessaorg/rcomp/tmp/2374v1355254999.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/3rrhb1355254999.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 8.2 6.755172 1.44482759 2 5.7 6.240000 -0.54000000 3 8.9 9.375000 -0.47500000 4 4.8 5.066667 -0.26666667 5 7.1 6.860000 0.24000000 6 4.7 5.066667 -0.36666667 7 5.7 5.066667 0.63333333 8 6.3 6.755172 -0.45517241 9 7.0 7.760000 -0.76000000 10 5.5 6.755172 -1.25517241 11 7.4 7.760000 -0.36000000 12 6.0 5.700000 0.30000000 13 8.4 8.378571 0.02142857 14 7.6 8.378571 -0.77857143 15 8.0 7.760000 0.24000000 16 6.6 6.240000 0.36000000 17 6.4 6.755172 -0.35517241 18 7.4 7.760000 -0.36000000 19 6.8 6.755172 0.04482759 20 7.6 6.755172 0.84482759 21 5.4 5.700000 -0.30000000 22 9.9 9.375000 0.52500000 23 7.0 7.760000 -0.76000000 24 8.6 8.378571 0.22142857 25 4.8 6.755172 -1.95517241 26 6.6 6.755172 -0.15517241 27 6.3 6.240000 0.06000000 28 5.4 6.755172 -1.35517241 29 6.3 6.240000 0.06000000 30 5.4 6.755172 -1.35517241 31 6.1 6.860000 -0.76000000 32 6.4 6.425000 -0.02500000 33 5.4 5.066667 0.33333333 34 7.3 6.755172 0.54482759 35 6.3 6.755172 -0.45517241 36 5.4 6.860000 -1.46000000 37 7.1 6.860000 0.24000000 38 8.7 8.378571 0.32142857 39 7.6 6.755172 0.84482759 40 6.0 5.700000 0.30000000 41 7.0 6.755172 0.24482759 42 7.6 8.378571 -0.77857143 43 8.9 8.378571 0.52142857 44 7.6 6.755172 0.84482759 45 5.5 6.240000 -0.74000000 46 7.4 7.760000 -0.36000000 47 7.1 6.755172 0.34482759 48 7.6 6.755172 0.84482759 49 8.7 8.378571 0.32142857 50 8.6 7.760000 0.84000000 51 5.4 5.383333 0.01666667 52 5.7 6.240000 -0.54000000 53 8.7 8.378571 0.32142857 54 6.1 6.860000 -0.76000000 55 7.3 6.755172 0.54482759 56 7.7 6.860000 0.84000000 57 9.0 7.760000 1.24000000 58 8.2 7.760000 0.44000000 59 7.1 6.755172 0.34482759 60 7.9 8.378571 -0.47857143 61 6.6 6.240000 0.36000000 62 8.0 6.755172 1.24482759 63 6.3 6.425000 -0.12500000 64 6.0 5.383333 0.61666667 65 5.4 5.383333 0.01666667 66 7.6 6.755172 0.84482759 67 6.4 6.755172 -0.35517241 68 6.1 6.755172 -0.65517241 69 5.2 5.700000 -0.50000000 70 6.6 6.755172 -0.15517241 71 7.6 6.755172 0.84482759 72 5.8 6.860000 -1.06000000 73 7.9 7.760000 0.14000000 74 8.6 8.378571 0.22142857 75 8.2 6.755172 1.44482759 76 7.1 6.860000 0.24000000 77 6.4 6.755172 -0.35517241 78 7.6 8.378571 -0.77857143 79 8.9 9.375000 -0.47500000 80 5.7 5.383333 0.31666667 81 7.1 6.860000 0.24000000 82 7.4 7.760000 -0.36000000 83 6.6 6.425000 0.17500000 84 5.0 5.383333 -0.38333333 85 8.2 7.760000 0.44000000 86 5.2 5.700000 -0.50000000 87 5.2 5.700000 -0.50000000 88 8.2 7.760000 0.44000000 89 7.3 7.760000 -0.46000000 90 8.2 6.755172 1.44482759 91 7.4 6.860000 0.54000000 92 4.8 5.066667 -0.26666667 93 7.6 8.378571 -0.77857143 94 8.9 9.375000 -0.47500000 95 7.7 6.860000 0.84000000 96 7.3 6.860000 0.44000000 97 6.3 6.755172 -0.45517241 98 5.4 6.860000 -1.46000000 99 6.4 6.755172 -0.35517241 100 6.4 6.755172 -0.35517241 101 5.4 6.755172 -1.35517241 102 8.7 8.378571 0.32142857 103 6.1 6.755172 -0.65517241 104 8.4 8.378571 0.02142857 105 7.9 7.760000 0.14000000 106 7.0 6.755172 0.24482759 107 8.7 8.378571 0.32142857 108 7.9 7.760000 0.14000000 109 7.1 7.760000 -0.66000000 110 5.8 6.860000 -1.06000000 111 8.4 8.378571 0.02142857 112 7.1 6.240000 0.86000000 113 7.6 6.755172 0.84482759 114 7.3 6.755172 0.54482759 115 8.0 6.755172 1.24482759 116 6.1 6.755172 -0.65517241 117 8.7 8.378571 0.32142857 118 5.8 5.700000 0.10000000 119 6.4 6.425000 -0.02500000 120 6.4 6.425000 -0.02500000 121 9.0 7.760000 1.24000000 122 6.4 6.755172 -0.35517241 123 6.0 5.383333 0.61666667 124 8.7 8.378571 0.32142857 125 5.0 5.066667 -0.06666667 126 7.4 6.860000 0.54000000 127 8.6 7.760000 0.84000000 128 5.8 5.700000 0.10000000 129 9.8 9.375000 0.42500000 130 4.8 5.383333 -0.58333333 131 7.0 7.760000 -0.76000000 132 5.5 6.240000 -0.74000000 133 5.0 5.383333 -0.38333333 134 6.0 5.700000 0.30000000 135 8.0 7.760000 0.24000000 136 7.9 8.378571 -0.47857143 137 4.8 5.383333 -0.58333333 138 6.4 6.755172 -0.35517241 139 4.8 5.066667 -0.26666667 140 6.4 6.755172 -0.35517241 141 6.8 6.755172 0.04482759 142 7.9 8.378571 -0.47857143 143 8.9 9.375000 -0.47500000 144 7.4 7.760000 -0.36000000 145 7.0 6.755172 0.24482759 146 7.0 6.755172 0.24482759 147 6.0 5.700000 0.30000000 148 7.4 6.860000 0.54000000 149 7.6 6.755172 0.84482759 150 4.8 6.755172 -1.95517241 151 7.3 6.755172 0.54482759 152 6.3 6.755172 -0.45517241 153 5.0 5.066667 -0.06666667 154 7.1 6.240000 0.86000000 155 6.3 5.700000 0.60000000 156 6.8 6.755172 0.04482759 157 5.2 5.700000 -0.50000000 158 6.3 6.755172 -0.45517241 159 6.1 6.755172 -0.65517241 160 7.3 7.760000 -0.46000000 161 5.4 5.066667 0.33333333 162 8.0 7.760000 0.24000000 163 7.4 6.860000 0.54000000 164 7.3 6.860000 0.44000000 165 7.3 6.860000 0.44000000 166 6.4 6.425000 -0.02500000 167 5.7 5.383333 0.31666667 168 5.7 5.066667 0.63333333 169 6.6 6.425000 0.17500000 170 6.3 6.755172 -0.45517241 171 5.4 6.755172 -1.35517241 172 7.4 6.755172 0.64482759 173 8.6 8.378571 0.22142857 174 7.3 6.860000 0.44000000 175 6.3 5.700000 0.60000000 176 8.7 8.378571 0.32142857 177 8.6 8.378571 0.22142857 178 8.4 8.378571 0.02142857 179 7.4 6.755172 0.64482759 180 9.9 9.375000 0.52500000 181 8.0 7.760000 0.24000000 182 7.9 8.378571 -0.47857143 183 9.8 9.375000 0.42500000 184 8.9 8.378571 0.52142857 185 6.8 6.755172 0.04482759 186 7.4 7.760000 -0.36000000 187 4.7 5.066667 -0.36666667 188 5.4 5.383333 0.01666667 189 7.0 7.760000 -0.76000000 190 7.1 7.760000 -0.66000000 191 6.3 6.425000 -0.12500000 192 5.5 6.755172 -1.25517241 193 5.4 5.383333 0.01666667 194 5.4 5.700000 -0.30000000 195 4.8 5.066667 -0.26666667 196 8.2 7.760000 0.44000000 197 7.9 7.760000 0.14000000 198 8.6 8.378571 0.22142857 199 8.2 6.755172 1.44482759 200 8.6 8.378571 0.22142857 > 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/4umqk1355254999.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/58tig1355254999.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/6abyh1355254999.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/7rdnp1355254999.tab") + } > > try(system("convert tmp/2374v1355254999.ps tmp/2374v1355254999.png",intern=TRUE)) character(0) > try(system("convert tmp/3rrhb1355254999.ps tmp/3rrhb1355254999.png",intern=TRUE)) character(0) > try(system("convert tmp/4umqk1355254999.ps tmp/4umqk1355254999.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.526 0.432 6.941