R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(3111 + ,5140 + ,17153 + ,2.5 + ,766 + ,332 + ,2.4 + ,3995 + ,4749 + ,15579 + ,1.8 + ,294 + ,369 + ,2.4 + ,5245 + ,3635 + ,16755 + ,7.3 + ,235 + ,384 + ,2.4 + ,5588 + ,4305 + ,16585 + ,9.9 + ,462 + ,373 + ,2.1 + ,10681 + ,5805 + ,16572 + ,13.2 + ,919 + ,378 + ,2 + ,10516 + ,4260 + ,16325 + ,17.8 + ,346 + ,426 + ,2 + ,7496 + ,3869 + ,17913 + ,18.8 + ,298 + ,423 + ,2.1 + ,9935 + ,7325 + ,17572 + ,19.3 + ,92 + ,397 + ,2.1 + ,10249 + ,9280 + ,17338 + ,13.9 + ,516 + ,422 + ,2 + ,6271 + ,6222 + ,17087 + ,7.5 + ,843 + ,409 + ,2 + ,3616 + ,3272 + ,15864 + ,8 + ,395 + ,430 + ,2 + ,3724 + ,7598 + ,15554 + ,4 + ,961 + ,412 + ,1.7 + ,2886 + ,1345 + ,16229 + ,3.6 + ,1231 + ,470 + ,1.3 + ,3318 + ,1900 + ,15180 + ,4.8 + ,794 + ,491 + ,1.2 + ,4166 + ,1480 + ,16215 + ,5.9 + ,420 + ,504 + ,1.1 + ,6401 + ,1472 + ,15801 + ,10.4 + ,331 + ,484 + ,1.4 + ,9209 + ,3823 + ,15751 + ,12.3 + ,312 + ,474 + ,1.5 + ,9820 + ,4454 + ,16477 + ,15.5 + ,692 + ,508 + ,1.4 + ,7470 + ,3357 + ,17324 + ,16.7 + ,1221 + ,492 + ,1.1 + ,8207 + ,5393 + ,16919 + ,18.8 + ,1272 + ,452 + ,1.1 + ,9564 + ,8329 + ,16438 + ,15.2 + ,622 + ,457 + ,1 + ,5309 + ,4152 + ,16239 + ,11.3 + ,479 + ,457 + ,1.4 + ,3385 + ,4042 + ,15613 + ,6.3 + ,757 + ,471 + ,1.3 + ,3706 + ,7747 + ,15821 + ,3.2 + ,463 + ,451 + ,1.2 + ,2733 + ,1451 + ,15678 + ,5.3 + ,534 + ,493 + ,1.5 + ,3045 + ,911 + ,14671 + ,2.4 + ,731 + ,514 + ,1.6 + ,3449 + ,406 + ,15876 + ,6.5 + ,498 + ,522 + ,1.8 + ,5542 + ,1387 + ,15563 + ,10.4 + ,629 + ,490 + ,1.5 + ,10072 + ,2150 + ,15711 + ,12.6 + ,542 + ,484 + ,1.3 + ,9418 + ,1577 + ,15583 + ,16.8 + ,519 + ,506 + ,1.6 + ,7516 + ,2642 + ,16405 + ,17.7 + ,1585 + ,501 + ,1.6 + ,7840 + ,4273 + ,16701 + ,16.2 + ,956 + ,462 + ,1.8 + ,10081 + ,8064 + ,16194 + ,15.7 + ,633 + ,465 + ,1.8 + ,4956 + ,3243 + ,16024 + ,13.3 + ,561 + ,454 + ,1.6 + ,3641 + ,1112 + ,14728 + ,6.9 + ,976 + ,464 + ,1.8 + ,3970 + ,2280 + ,14776 + ,4 + ,565 + ,427 + ,2 + ,2931 + ,505 + ,15399 + ,1.5 + ,151 + ,460 + ,1.3 + ,3170 + ,744 + ,14286 + ,2.9 + ,588 + ,473 + ,1.1 + ,3889 + ,1369 + ,15646 + ,3.9 + ,1043 + ,465 + ,1 + ,4850 + ,531 + ,14543 + ,9 + ,398 + ,422 + ,1.2 + ,8037 + ,1041 + ,15673 + ,14.5 + ,902 + ,415 + ,1.2 + ,12370 + ,2076 + ,15171 + ,16.7 + ,180 + ,413 + ,1.3 + ,6712 + ,577 + ,15999 + ,22.3 + ,150 + ,420 + ,1.3 + ,7297 + ,5080 + ,1626 + ,16.4 + ,1805 + ,363 + ,1.4 + ,10613 + ,6584 + ,16123 + ,17.9 + ,86 + ,376 + ,1.1 + ,5184 + ,3761 + ,16144 + ,13.6 + ,1093 + ,380 + ,0.9 + ,3506 + ,294 + ,15005 + ,9.2 + ,925 + ,384 + ,1 + ,3810 + ,5020 + ,14806 + ,6.5 + ,750 + ,346 + ,1.1 + ,2692 + ,1141 + ,15019 + ,7.1 + ,1038 + ,389 + ,1.4 + ,3073 + ,3805 + ,13909 + ,6 + ,679 + ,407 + ,1.5 + ,3713 + ,2127 + ,15211 + ,8 + ,848 + ,393 + ,1.8 + ,4555 + ,2531 + ,14385 + ,13.1 + ,300 + ,346 + ,1.8 + ,7807 + ,3682 + ,15144 + ,14.1 + ,1379 + ,348 + ,1.8 + ,10869 + ,3263 + ,14659 + ,17.5 + ,901 + ,353 + ,1.7 + ,9682 + ,2798 + ,15989 + ,17 + ,1606 + ,364 + ,1.5 + ,7704 + ,5936 + ,16262 + ,17.1 + ,422 + ,305 + ,1.1 + ,9826 + ,10568 + ,16021 + ,13.8 + ,968 + ,307 + ,1.3 + ,5456 + ,5296 + ,15662 + ,10.1 + ,319 + ,312 + ,1.6 + ,3677 + ,1870 + ,14531 + ,6.9 + ,583 + ,312 + ,1.9 + ,3431 + ,4390 + ,14544 + ,2.4 + ,765 + ,286 + ,1.9 + ,2765 + ,3707 + ,15071 + ,6.5 + ,963 + ,324 + ,2 + ,3483 + ,5201 + ,14236 + ,5.1 + ,392 + ,336 + ,2.2 + ,3445 + ,3748 + ,14771 + ,5.9 + ,919 + ,327 + ,2.2 + ,6081 + ,5282 + ,14804 + ,8.9 + ,339 + ,302 + ,2 + ,8767 + ,5349 + ,15597 + ,15.7 + ,327 + ,299 + ,2.3 + ,9407 + ,6249 + ,15418 + ,16.5 + ,397 + ,311 + ,2.6 + ,6551 + ,5517 + ,16903 + ,18.1 + ,1268 + ,315 + ,3.2 + ,12480 + ,8640 + ,16350 + ,17.4 + ,1137 + ,264 + ,3.2 + ,9530 + ,15767 + ,16393 + ,13.6 + ,1000 + ,278 + ,3.1 + ,5960 + ,8850 + ,15685 + ,10.1 + ,915 + ,278 + ,2.8 + ,3252 + ,5582 + ,14556 + ,6.9 + ,905 + ,287 + ,2.3 + ,3717 + ,6496 + ,14850 + ,2.4 + ,243 + ,279 + ,1.9 + ,2642 + ,3255 + ,15391 + ,0.8 + ,537 + ,324 + ,1.9 + ,2989 + ,6189 + ,13704 + ,3.3 + ,551 + ,354 + ,2 + ,3607 + ,6452 + ,15409 + ,6.3 + ,482 + ,354 + ,2 + ,5366 + ,5099 + ,15098 + ,12.2 + ,199 + ,360 + ,1.8 + ,8898 + ,6833 + ,15254 + ,13.9 + ,650 + ,363 + ,1.6 + ,9435 + ,7046 + ,15522 + ,15.6 + ,533 + ,385 + ,1.4 + ,7328 + ,7739 + ,16669 + ,18.1 + ,1071 + ,412 + ,0.2 + ,8594 + ,10142 + ,16238 + ,18.5 + ,469 + ,370 + ,0.3 + ,11349 + ,16054 + ,16246 + ,15 + ,335 + ,389 + ,0.4 + ,5797 + ,7721 + ,15424 + ,10.7 + ,598 + ,395 + ,0.7 + ,3621 + ,6182 + ,14952 + ,9.5 + ,1200 + ,417 + ,1 + ,3851 + ,6490 + ,15008 + ,2.2 + ,844 + ,404 + ,1.1) + ,dim=c(7 + ,84) + ,dimnames=list(c('Huwelijken' + ,'Bevolkingsgroei' + ,'Geborenen' + ,'Temperatuur' + ,'Neerslag' + ,'Werkloosheid' + ,'Inflatie') + ,1:84)) > y <- array(NA,dim=c(7,84),dimnames=list(c('Huwelijken','Bevolkingsgroei','Geborenen','Temperatuur','Neerslag','Werkloosheid','Inflatie'),1:84)) > 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 = '' > par2 = 'none' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > 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 <- 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] "Huwelijken" > x[,par1] [1] 3111 3995 5245 5588 10681 10516 7496 9935 10249 6271 3616 3724 [13] 2886 3318 4166 6401 9209 9820 7470 8207 9564 5309 3385 3706 [25] 2733 3045 3449 5542 10072 9418 7516 7840 10081 4956 3641 3970 [37] 2931 3170 3889 4850 8037 12370 6712 7297 10613 5184 3506 3810 [49] 2692 3073 3713 4555 7807 10869 9682 7704 9826 5456 3677 3431 [61] 2765 3483 3445 6081 8767 9407 6551 12480 9530 5960 3252 3717 [73] 2642 2989 3607 5366 8898 9435 7328 8594 11349 5797 3621 3851 > 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]) 2642 2692 2733 2765 2886 2931 2989 3045 3073 3111 3170 3252 3318 1 1 1 1 1 1 1 1 1 1 1 1 1 3385 3431 3445 3449 3483 3506 3607 3616 3621 3641 3677 3706 3713 1 1 1 1 1 1 1 1 1 1 1 1 1 3717 3724 3810 3851 3889 3970 3995 4166 4555 4850 4956 5184 5245 1 1 1 1 1 1 1 1 1 1 1 1 1 5309 5366 5456 5542 5588 5797 5960 6081 6271 6401 6551 6712 7297 1 1 1 1 1 1 1 1 1 1 1 1 1 7328 7470 7496 7516 7704 7807 7840 8037 8207 8594 8767 8898 9209 1 1 1 1 1 1 1 1 1 1 1 1 1 9407 9418 9435 9530 9564 9682 9820 9826 9935 10072 10081 10249 10516 1 1 1 1 1 1 1 1 1 1 1 1 1 10613 10681 10869 11349 12370 12480 1 1 1 1 1 1 > colnames(x) [1] "Huwelijken" "Bevolkingsgroei" "Geborenen" "Temperatuur" [5] "Neerslag" "Werkloosheid" "Inflatie" > colnames(x)[par1] [1] "Huwelijken" > x[,par1] [1] 3111 3995 5245 5588 10681 10516 7496 9935 10249 6271 3616 3724 [13] 2886 3318 4166 6401 9209 9820 7470 8207 9564 5309 3385 3706 [25] 2733 3045 3449 5542 10072 9418 7516 7840 10081 4956 3641 3970 [37] 2931 3170 3889 4850 8037 12370 6712 7297 10613 5184 3506 3810 [49] 2692 3073 3713 4555 7807 10869 9682 7704 9826 5456 3677 3431 [61] 2765 3483 3445 6081 8767 9407 6551 12480 9530 5960 3252 3717 [73] 2642 2989 3607 5366 8898 9435 7328 8594 11349 5797 3621 3851 > if (par2 == 'none') { + m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x) + } > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > if (par2 != 'none') { + m <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data = x) + if (par4=='yes') { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'10-Fold Cross Validation',3+2*par3,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'',1,TRUE) + a<-table.element(a,'Prediction (training)',par3+1,TRUE) + a<-table.element(a,'Prediction (testing)',par3+1,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Actual',1,TRUE) + for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE) + a<-table.element(a,'CV',1,TRUE) + for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE) + a<-table.element(a,'CV',1,TRUE) + a<-table.row.end(a) + for (i in 1:10) { + ind <- sample(2, nrow(x), replace=T, prob=c(0.9,0.1)) + m.ct <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data =x[ind==1,]) + if (i==1) { + m.ct.i.pred <- predict(m.ct, newdata=x[ind==1,]) + m.ct.i.actu <- x[ind==1,par1] + m.ct.x.pred <- predict(m.ct, newdata=x[ind==2,]) + m.ct.x.actu <- x[ind==2,par1] + } else { + m.ct.i.pred <- c(m.ct.i.pred,predict(m.ct, newdata=x[ind==1,])) + m.ct.i.actu <- c(m.ct.i.actu,x[ind==1,par1]) + m.ct.x.pred <- c(m.ct.x.pred,predict(m.ct, newdata=x[ind==2,])) + m.ct.x.actu <- c(m.ct.x.actu,x[ind==2,par1]) + } + } + print(m.ct.i.tab <- table(m.ct.i.actu,m.ct.i.pred)) + numer <- 0 + for (i in 1:par3) { + print(m.ct.i.tab[i,i] / sum(m.ct.i.tab[i,])) + numer <- numer + m.ct.i.tab[i,i] + } + print(m.ct.i.cp <- numer / sum(m.ct.i.tab)) + print(m.ct.x.tab <- table(m.ct.x.actu,m.ct.x.pred)) + numer <- 0 + for (i in 1:par3) { + print(m.ct.x.tab[i,i] / sum(m.ct.x.tab[i,])) + numer <- numer + m.ct.x.tab[i,i] + } + print(m.ct.x.cp <- numer / sum(m.ct.x.tab)) + for (i in 1:par3) { + a<-table.row.start(a) + a<-table.element(a,paste('C',i,sep=''),1,TRUE) + for (jjj in 1:par3) a<-table.element(a,m.ct.i.tab[i,jjj]) + a<-table.element(a,round(m.ct.i.tab[i,i]/sum(m.ct.i.tab[i,]),4)) + for (jjj in 1:par3) a<-table.element(a,m.ct.x.tab[i,jjj]) + a<-table.element(a,round(m.ct.x.tab[i,i]/sum(m.ct.x.tab[i,]),4)) + a<-table.row.end(a) + } + a<-table.row.start(a) + a<-table.element(a,'Overall',1,TRUE) + for (jjj in 1:par3) a<-table.element(a,'-') + a<-table.element(a,round(m.ct.i.cp,4)) + for (jjj in 1:par3) a<-table.element(a,'-') + a<-table.element(a,round(m.ct.x.cp,4)) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/1ym0r1292698914.tab") + } + } > m Conditional inference tree with 3 terminal nodes Response: Huwelijken Inputs: Bevolkingsgroei, Geborenen, Temperatuur, Neerslag, Werkloosheid, Inflatie Number of observations: 84 1) Temperatuur <= 12.2; criterion = 1, statistic = 57.203 2) Temperatuur <= 7.1; criterion = 1, statistic = 21.391 3)* weights = 30 2) Temperatuur > 7.1 4)* weights = 16 1) Temperatuur > 12.2 5)* weights = 38 > postscript(file="/var/www/rcomp/tmp/2ym0r1292698914.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(m) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/3ym0r1292698914.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 3111 3385.100 -274.10000 2 3995 3385.100 609.90000 3 5245 5145.125 99.87500 4 5588 5145.125 442.87500 5 10681 8842.763 1838.23684 6 10516 8842.763 1673.23684 7 7496 8842.763 -1346.76316 8 9935 8842.763 1092.23684 9 10249 8842.763 1406.23684 10 6271 5145.125 1125.87500 11 3616 5145.125 -1529.12500 12 3724 3385.100 338.90000 13 2886 3385.100 -499.10000 14 3318 3385.100 -67.10000 15 4166 3385.100 780.90000 16 6401 5145.125 1255.87500 17 9209 8842.763 366.23684 18 9820 8842.763 977.23684 19 7470 8842.763 -1372.76316 20 8207 8842.763 -635.76316 21 9564 8842.763 721.23684 22 5309 5145.125 163.87500 23 3385 3385.100 -0.10000 24 3706 3385.100 320.90000 25 2733 3385.100 -652.10000 26 3045 3385.100 -340.10000 27 3449 3385.100 63.90000 28 5542 5145.125 396.87500 29 10072 8842.763 1229.23684 30 9418 8842.763 575.23684 31 7516 8842.763 -1326.76316 32 7840 8842.763 -1002.76316 33 10081 8842.763 1238.23684 34 4956 8842.763 -3886.76316 35 3641 3385.100 255.90000 36 3970 3385.100 584.90000 37 2931 3385.100 -454.10000 38 3170 3385.100 -215.10000 39 3889 3385.100 503.90000 40 4850 5145.125 -295.12500 41 8037 8842.763 -805.76316 42 12370 8842.763 3527.23684 43 6712 8842.763 -2130.76316 44 7297 8842.763 -1545.76316 45 10613 8842.763 1770.23684 46 5184 8842.763 -3658.76316 47 3506 5145.125 -1639.12500 48 3810 3385.100 424.90000 49 2692 3385.100 -693.10000 50 3073 3385.100 -312.10000 51 3713 5145.125 -1432.12500 52 4555 8842.763 -4287.76316 53 7807 8842.763 -1035.76316 54 10869 8842.763 2026.23684 55 9682 8842.763 839.23684 56 7704 8842.763 -1138.76316 57 9826 8842.763 983.23684 58 5456 5145.125 310.87500 59 3677 3385.100 291.90000 60 3431 3385.100 45.90000 61 2765 3385.100 -620.10000 62 3483 3385.100 97.90000 63 3445 3385.100 59.90000 64 6081 5145.125 935.87500 65 8767 8842.763 -75.76316 66 9407 8842.763 564.23684 67 6551 8842.763 -2291.76316 68 12480 8842.763 3637.23684 69 9530 8842.763 687.23684 70 5960 5145.125 814.87500 71 3252 3385.100 -133.10000 72 3717 3385.100 331.90000 73 2642 3385.100 -743.10000 74 2989 3385.100 -396.10000 75 3607 3385.100 221.90000 76 5366 5145.125 220.87500 77 8898 8842.763 55.23684 78 9435 8842.763 592.23684 79 7328 8842.763 -1514.76316 80 8594 8842.763 -248.76316 81 11349 8842.763 2506.23684 82 5797 5145.125 651.87500 83 3621 5145.125 -1524.12500 84 3851 3385.100 465.90000 > if (par2 != 'none') { + print(cbind(as.factor(x[,par1]),predict(m))) + myt <- table(as.factor(x[,par1]),predict(m)) + print(myt) + } > postscript(file="/var/www/rcomp/tmp/4reid1292698914.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > if(par2=='none') { + op <- par(mfrow=c(2,2)) + plot(density(result$Actuals),main='Kernel Density Plot of Actuals') + plot(density(result$Residuals),main='Kernel Density Plot of Residuals') + plot(result$Forecasts,result$Actuals,main='Actuals versus Predictions',xlab='Predictions',ylab='Actuals') + plot(density(result$Forecasts),main='Kernel Density Plot of Predictions') + par(op) + } > if(par2!='none') { + plot(myt,main='Confusion Matrix',xlab='Actual',ylab='Predicted') + } > dev.off() null device 1 > if (par2 == 'none') { + detcoef <- cor(result$Forecasts,result$Actuals) + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goodness of Fit',2,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Correlation',1,TRUE) + a<-table.element(a,round(detcoef,4)) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'R-squared',1,TRUE) + a<-table.element(a,round(detcoef*detcoef,4)) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'RMSE',1,TRUE) + a<-table.element(a,round(sqrt(mean((result$Residuals)^2)),4)) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/55nx31292698914.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Actuals, Predictions, and Residuals',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'#',header=TRUE) + a<-table.element(a,'Actuals',header=TRUE) + a<-table.element(a,'Forecasts',header=TRUE) + a<-table.element(a,'Residuals',header=TRUE) + a<-table.row.end(a) + for (i in 1:length(result$Actuals)) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,result$Actuals[i]) + a<-table.element(a,result$Forecasts[i]) + a<-table.element(a,result$Residuals[i]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/6q6wr1292698914.tab") + } > if (par2 != 'none') { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Confusion Matrix (predicted in columns / actuals in rows)',par3+1,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'',1,TRUE) + for (i in 1:par3) { + a<-table.element(a,paste('C',i,sep=''),1,TRUE) + } + a<-table.row.end(a) + for (i in 1:par3) { + a<-table.row.start(a) + a<-table.element(a,paste('C',i,sep=''),1,TRUE) + for (j in 1:par3) { + a<-table.element(a,myt[i,j]) + } + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/71xvc1292698914.tab") + } > > try(system("convert tmp/2ym0r1292698914.ps tmp/2ym0r1292698914.png",intern=TRUE)) character(0) > try(system("convert tmp/3ym0r1292698914.ps tmp/3ym0r1292698914.png",intern=TRUE)) character(0) > try(system("convert tmp/4reid1292698914.ps tmp/4reid1292698914.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.21 0.39 2.58