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(18.2 + ,2687 + ,1870 + ,1890 + ,145.7 + ,352.2 + ,143.8 + ,13271 + ,9115 + ,8190 + ,-279.0 + ,83.0 + ,23.4 + ,13621 + ,4848 + ,4572 + ,485.0 + ,898.9 + ,1.1 + ,3614 + ,367 + ,90 + ,14.1 + ,24.6 + ,49.5 + ,6425 + ,6131 + ,2448 + ,345.8 + ,682.5 + ,4.8 + ,1022 + ,1754 + ,1370 + ,72.0 + ,119.5 + ,20.8 + ,1093 + ,1679 + ,1070 + ,100.9 + ,164.5 + ,19.4 + ,1529 + ,1295 + ,444 + ,25.6 + ,137.0 + ,2.1 + ,2788 + ,271 + ,304 + ,23.5 + ,28.9 + ,79.4 + ,19788 + ,9084 + ,10636 + ,1092.9 + ,2576.8 + ,2.8 + ,327 + ,542 + ,959 + ,54.1 + ,72.5 + ,3.8 + ,1117 + ,1038 + ,478 + ,59.7 + ,91.7 + ,4.1 + ,5401 + ,550 + ,376 + ,25.6 + ,37.5 + ,13.2 + ,1128 + ,1516 + ,430 + ,-47.0 + ,26.7 + ,2.8 + ,1633 + ,701 + ,679 + ,74.3 + ,135.9 + ,48.5 + ,44736 + ,16197 + ,4653 + ,-732.5 + ,-651.9 + ,6.2 + ,5651 + ,1254 + ,2002 + ,310.7 + ,407.9 + ,10.8 + ,5835 + ,4053 + ,1601 + ,-93.8 + ,173.8 + ,3.8 + ,278 + ,205 + ,853 + ,44.8 + ,50.5 + ,21.9 + ,5074 + ,2557 + ,1892 + ,239.9 + ,578.3 + ,12.6 + ,866 + ,1487 + ,944 + ,71.7 + ,115.4 + ,128.0 + ,4418 + ,8793 + ,4459 + ,283.6 + ,456.5 + ,87.3 + ,6914 + ,7029 + ,7957 + ,400.6 + ,754.7 + ,16.0 + ,862 + ,1601 + ,1093 + ,66.9 + ,106.8 + ,0.7 + ,401 + ,176 + ,1084 + ,55.6 + ,57.0 + ,22.5 + ,430 + ,1155 + ,1045 + ,55.7 + ,70.8 + ,15.4 + ,799 + ,1140 + ,683 + ,57.6 + ,89.2 + ,3.0 + ,4789 + ,453 + ,367 + ,40.2 + ,51.4 + ,2.1 + ,2548 + ,264 + ,181 + ,22.2 + ,26.2 + ,4.1 + ,5249 + ,527 + ,346 + ,37.8 + ,56.2 + ,6.4 + ,3494 + ,1653 + ,1442 + ,160.9 + ,320.3 + ,26.6 + ,1804 + ,2564 + ,483 + ,70.5 + ,164.9 + ,304.0 + ,26432 + ,28285 + ,33172 + ,2336.0 + ,3562.0 + ,18.6 + ,623 + ,2247 + ,797 + ,57.0 + ,93.8 + ,65.0 + ,1608 + ,6615 + ,829 + ,56.1 + ,134.0 + ,66.2 + ,4662 + ,4781 + ,2988 + ,28.7 + ,371.5 + ,83.0 + ,5769 + ,6571 + ,9462 + ,482.0 + ,792.0 + ,62.0 + ,6259 + ,4152 + ,3090 + ,283.7 + ,524.5 + ,1.6 + ,1654 + ,451 + ,779 + ,84.8 + ,130.4 + ,400.2 + ,52634 + ,50056 + ,95697 + ,6555.0 + ,9874.0 + ,23.3 + ,999 + ,1878 + ,393 + ,-173.5 + ,-108.1 + ,4.6 + ,1679 + ,1354 + ,687 + ,93.8 + ,154.6 + ,164.6 + ,4178 + ,17124 + ,2091 + ,180.8 + ,390.4 + ,1.9 + ,223 + ,557 + ,1040 + ,60.6 + ,63.7 + ,57.5 + ,6307 + ,8199 + ,598 + ,-771.5 + ,-524.3 + ,2.4 + ,3720 + ,356 + ,211 + ,26.6 + ,34.8 + ,77.3 + ,3442 + ,5080 + ,2673 + ,235.4 + ,361.5 + ,15.8 + ,33406 + ,3222 + ,1413 + ,201.7 + ,246.7 + ,0.6 + ,1257 + ,355 + ,181 + ,167.5 + ,304.0 + ,3.5 + ,1743 + ,597 + ,717 + ,121.6 + ,172.4 + ,9.0 + ,12505 + ,1302 + ,702 + ,108.4 + ,131.4 + ,62.0 + ,3940 + ,4317 + ,3940 + ,315.2 + ,566.3 + ,7.4 + ,8998 + ,882 + ,988 + ,93.0 + ,119.0 + ,15.6 + ,21419 + ,2516 + ,930 + ,107.6 + ,164.7 + ,25.2 + ,2366 + ,3305 + ,1117 + ,131.2 + ,256.5 + ,25.4 + ,2448 + ,3484 + ,1036 + ,48.8 + ,257.1 + ,3.5 + ,1440 + ,1617 + ,639 + ,81.7 + ,126.4 + ,27.3 + ,14045 + ,15636 + ,2754 + ,418.0 + ,1462.0 + ,37.5 + ,4084 + ,4346 + ,3023 + ,302.7 + ,521.7 + ,3.4 + ,3010 + ,749 + ,1120 + ,146.3 + ,209.2 + ,14.3 + ,1286 + ,1734 + ,361 + ,69.2 + ,145.7 + ,6.1 + ,707 + ,706 + ,275 + ,61.4 + ,77.8 + ,4.9 + ,3086 + ,1739 + ,1507 + ,202.7 + ,335.2 + ,3.3 + ,252 + ,312 + ,883 + ,41.7 + ,60.6 + ,7.0 + ,11052 + ,1097 + ,606 + ,64.9 + ,97.6 + ,8.2 + ,9672 + ,1037 + ,829 + ,92.6 + ,118.2 + ,43.5 + ,1112 + ,3689 + ,542 + ,30.3 + ,96.9 + ,48.5 + ,1104 + ,5123 + ,910 + ,63.7 + ,133.3 + ,5.4 + ,478 + ,672 + ,866 + ,67.1 + ,101.6 + ,49.5 + ,10348 + ,5721 + ,1915 + ,223.6 + ,322.5 + ,29.1 + ,2769 + ,3725 + ,663 + ,-208.4 + ,12.4 + ,2.6 + ,752 + ,2149 + ,101 + ,11.1 + ,15.2 + ,0.8 + ,4989 + ,518 + ,53 + ,-3.1 + ,-0.3 + ,184.8 + ,10528 + ,14992 + ,5377 + ,312.7 + ,710.7 + ,2.3 + ,1995 + ,2662 + ,341 + ,34.7 + ,100.7 + ,8.0 + ,2286 + ,2235 + ,2306 + ,195.3 + ,219.0 + ,10.3 + ,952 + ,1307 + ,309 + ,35.4 + ,92.8 + ,50.0 + ,2957 + ,2806 + ,457 + ,40.6 + ,93.5 + ,118.1 + ,2535 + ,5958 + ,1921 + ,177.0 + ,288.0) + ,dim=c(6 + ,79) + ,dimnames=list(c('Aantalwerknemers' + ,'Totaleactiva' + ,'omzet' + ,'marktwaarde' + ,'winst' + ,'cashflow') + ,1:79)) > y <- array(NA,dim=c(6,79),dimnames=list(c('Aantalwerknemers','Totaleactiva','omzet','marktwaarde','winst','cashflow'),1:79)) > 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] "Aantalwerknemers" > x[,par1] [1] 18.2 143.8 23.4 1.1 49.5 4.8 20.8 19.4 2.1 79.4 2.8 3.8 [13] 4.1 13.2 2.8 48.5 6.2 10.8 3.8 21.9 12.6 128.0 87.3 16.0 [25] 0.7 22.5 15.4 3.0 2.1 4.1 6.4 26.6 304.0 18.6 65.0 66.2 [37] 83.0 62.0 1.6 400.2 23.3 4.6 164.6 1.9 57.5 2.4 77.3 15.8 [49] 0.6 3.5 9.0 62.0 7.4 15.6 25.2 25.4 3.5 27.3 37.5 3.4 [61] 14.3 6.1 4.9 3.3 7.0 8.2 43.5 48.5 5.4 49.5 29.1 2.6 [73] 0.8 184.8 2.3 8.0 10.3 50.0 118.1 > 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]) 0.6 0.7 0.8 1.1 1.6 1.9 2.1 2.3 2.4 2.6 2.8 3 3.3 1 1 1 1 1 1 2 1 1 1 2 1 1 3.4 3.5 3.8 4.1 4.6 4.8 4.9 5.4 6.1 6.2 6.4 7 7.4 1 2 2 2 1 1 1 1 1 1 1 1 1 8 8.2 9 10.3 10.8 12.6 13.2 14.3 15.4 15.6 15.8 16 18.2 1 1 1 1 1 1 1 1 1 1 1 1 1 18.6 19.4 20.8 21.9 22.5 23.3 23.4 25.2 25.4 26.6 27.3 29.1 37.5 1 1 1 1 1 1 1 1 1 1 1 1 1 43.5 48.5 49.5 50 57.5 62 65 66.2 77.3 79.4 83 87.3 118.1 1 2 2 1 1 2 1 1 1 1 1 1 1 128 143.8 164.6 184.8 304 400.2 1 1 1 1 1 1 > colnames(x) [1] "Aantalwerknemers" "Totaleactiva" "omzet" "marktwaarde" [5] "winst" "cashflow" > colnames(x)[par1] [1] "Aantalwerknemers" > x[,par1] [1] 18.2 143.8 23.4 1.1 49.5 4.8 20.8 19.4 2.1 79.4 2.8 3.8 [13] 4.1 13.2 2.8 48.5 6.2 10.8 3.8 21.9 12.6 128.0 87.3 16.0 [25] 0.7 22.5 15.4 3.0 2.1 4.1 6.4 26.6 304.0 18.6 65.0 66.2 [37] 83.0 62.0 1.6 400.2 23.3 4.6 164.6 1.9 57.5 2.4 77.3 15.8 [49] 0.6 3.5 9.0 62.0 7.4 15.6 25.2 25.4 3.5 27.3 37.5 3.4 [61] 14.3 6.1 4.9 3.3 7.0 8.2 43.5 48.5 5.4 49.5 29.1 2.6 [73] 0.8 184.8 2.3 8.0 10.3 50.0 118.1 > if (par2 == 'none') { + m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x) + } > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/17v0c1355222370.tab") + } + } > m Conditional inference tree with 6 terminal nodes Response: Aantalwerknemers Inputs: Totaleactiva, omzet, marktwaarde, winst, cashflow Number of observations: 79 1) omzet <= 8199; criterion = 1, statistic = 66.601 2) omzet <= 4053; criterion = 1, statistic = 51.666 3) omzet <= 2235; criterion = 1, statistic = 27.799 4) omzet <= 1097; criterion = 1, statistic = 15.29 5) omzet <= 597; criterion = 0.998, statistic = 12.648 6)* weights = 16 5) omzet > 597 7)* weights = 8 4) omzet > 1097 8)* weights = 20 3) omzet > 2235 9)* weights = 12 2) omzet > 4053 10)* weights = 14 1) omzet > 8199 11)* weights = 9 > postscript(file="/var/fisher/rcomp/tmp/2a1e81355222370.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/fisher/rcomp/tmp/39n241355222370.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 18.2 11.80000 6.40000000 2 143.8 164.51111 -20.71111111 3 23.4 63.34286 -39.94285714 4 1.1 2.36875 -1.26875000 5 49.5 63.34286 -13.84285714 6 4.8 11.80000 -7.00000000 7 20.8 11.80000 9.00000000 8 19.4 11.80000 7.60000000 9 2.1 2.36875 -0.26875000 10 79.4 164.51111 -85.11111111 11 2.8 2.36875 0.43125000 12 3.8 5.51250 -1.71250000 13 4.1 2.36875 1.73125000 14 13.2 11.80000 1.40000000 15 2.8 5.51250 -2.71250000 16 48.5 164.51111 -116.01111111 17 6.2 11.80000 -5.60000000 18 10.8 23.73333 -12.93333333 19 3.8 2.36875 1.43125000 20 21.9 23.73333 -1.83333333 21 12.6 11.80000 0.80000000 22 128.0 164.51111 -36.51111111 23 87.3 63.34286 23.95714286 24 16.0 11.80000 4.20000000 25 0.7 2.36875 -1.66875000 26 22.5 11.80000 10.70000000 27 15.4 11.80000 3.60000000 28 3.0 2.36875 0.63125000 29 2.1 2.36875 -0.26875000 30 4.1 2.36875 1.73125000 31 6.4 11.80000 -5.40000000 32 26.6 23.73333 2.86666667 33 304.0 164.51111 139.48888889 34 18.6 23.73333 -5.13333333 35 65.0 63.34286 1.65714286 36 66.2 63.34286 2.85714286 37 83.0 63.34286 19.65714286 38 62.0 63.34286 -1.34285714 39 1.6 2.36875 -0.76875000 40 400.2 164.51111 235.68888889 41 23.3 11.80000 11.50000000 42 4.6 11.80000 -7.20000000 43 164.6 164.51111 0.08888889 44 1.9 2.36875 -0.46875000 45 57.5 63.34286 -5.84285714 46 2.4 2.36875 0.03125000 47 77.3 63.34286 13.95714286 48 15.8 23.73333 -7.93333333 49 0.6 2.36875 -1.76875000 50 3.5 2.36875 1.13125000 51 9.0 11.80000 -2.80000000 52 62.0 63.34286 -1.34285714 53 7.4 5.51250 1.88750000 54 15.6 23.73333 -8.13333333 55 25.2 23.73333 1.46666667 56 25.4 23.73333 1.66666667 57 3.5 11.80000 -8.30000000 58 27.3 164.51111 -137.21111111 59 37.5 63.34286 -25.84285714 60 3.4 5.51250 -2.11250000 61 14.3 11.80000 2.50000000 62 6.1 5.51250 0.58750000 63 4.9 11.80000 -6.90000000 64 3.3 2.36875 0.93125000 65 7.0 5.51250 1.48750000 66 8.2 5.51250 2.68750000 67 43.5 23.73333 19.76666667 68 48.5 63.34286 -14.84285714 69 5.4 5.51250 -0.11250000 70 49.5 63.34286 -13.84285714 71 29.1 23.73333 5.36666667 72 2.6 11.80000 -9.20000000 73 0.8 2.36875 -1.56875000 74 184.8 164.51111 20.28888889 75 2.3 23.73333 -21.43333333 76 8.0 11.80000 -3.80000000 77 10.3 11.80000 -1.50000000 78 50.0 23.73333 26.26666667 79 118.1 63.34286 54.75714286 > if (par2 != 'none') { + print(cbind(as.factor(x[,par1]),predict(m))) + myt <- table(as.factor(x[,par1]),predict(m)) + print(myt) + } > postscript(file="/var/fisher/rcomp/tmp/4la5l1355222370.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/fisher/rcomp/tmp/52mtu1355222370.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/fisher/rcomp/tmp/6lnfw1355222370.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/fisher/rcomp/tmp/7gxbj1355222370.tab") + } > > try(system("convert tmp/2a1e81355222370.ps tmp/2a1e81355222370.png",intern=TRUE)) character(0) > try(system("convert tmp/39n241355222370.ps tmp/39n241355222370.png",intern=TRUE)) character(0) > try(system("convert tmp/4la5l1355222370.ps tmp/4la5l1355222370.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.223 0.577 4.780