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. > x <- array(list(1801 + ,159261 + ,91 + ,48 + ,19 + ,1717 + ,189672 + ,59 + ,53 + ,20 + ,192 + ,7215 + ,18 + ,0 + ,0 + ,2295 + ,129098 + ,95 + ,51 + ,27 + ,3450 + ,230632 + ,136 + ,76 + ,31 + ,6861 + ,515038 + ,263 + ,136 + ,36 + ,1795 + ,180745 + ,56 + ,62 + ,23 + ,1681 + ,185559 + ,59 + ,83 + ,30 + ,1897 + ,154581 + ,44 + ,55 + ,30 + ,2974 + ,298001 + ,96 + ,67 + ,26 + ,1946 + ,121844 + ,75 + ,50 + ,24 + ,2330 + ,200907 + ,70 + ,87 + ,30 + ,1839 + ,101647 + ,100 + ,46 + ,22 + ,3183 + ,220269 + ,119 + ,79 + ,28 + ,1486 + ,170952 + ,61 + ,56 + ,18 + ,1567 + ,154647 + ,88 + ,54 + ,22 + ,1756 + ,142018 + ,57 + ,81 + ,33 + ,1247 + ,79030 + ,61 + ,6 + ,15 + ,2779 + ,167047 + ,87 + ,74 + ,34 + ,726 + ,27997 + ,24 + ,13 + ,18 + ,1048 + ,73019 + ,59 + ,22 + ,15 + ,2805 + ,241082 + ,100 + ,99 + ,30 + ,1760 + ,195820 + ,72 + ,38 + ,25 + ,2266 + ,142001 + ,54 + ,59 + ,34 + ,1848 + ,145433 + ,86 + ,50 + ,21 + ,1665 + ,183744 + ,32 + ,50 + ,21 + ,2114 + ,206521 + ,164 + ,63 + ,25 + ,1448 + ,201385 + ,94 + ,90 + ,31 + ,2741 + ,354924 + ,118 + ,60 + ,31 + ,2112 + ,192399 + ,44 + ,52 + ,20 + ,1684 + ,182286 + ,44 + ,61 + ,28 + ,1616 + ,181590 + ,45 + ,60 + ,22 + ,2227 + ,133801 + ,105 + ,53 + ,17 + ,3088 + ,233686 + ,123 + ,76 + ,25 + ,2389 + ,219428 + ,53 + ,63 + ,24 + ,1 + ,0 + ,1 + ,0 + ,0 + ,2099 + ,223044 + ,63 + ,54 + ,28 + ,1669 + ,100129 + ,51 + ,44 + ,14 + ,2137 + ,145864 + ,49 + ,42 + ,35 + ,2153 + ,249965 + ,64 + ,83 + ,34 + ,2390 + ,242379 + ,71 + ,105 + ,22 + ,1701 + ,145794 + ,59 + ,37 + ,34 + ,1049 + ,103623 + ,33 + ,25 + ,23 + ,2161 + ,195891 + ,78 + ,64 + ,24 + ,1276 + ,117156 + ,50 + ,55 + ,26 + ,1190 + ,157787 + ,95 + ,41 + ,22 + ,745 + ,81293 + ,32 + ,23 + ,35 + ,2374 + ,243273 + ,103 + ,77 + ,24 + ,2289 + ,233155 + ,89 + ,59 + ,31 + ,2639 + ,160344 + ,59 + ,68 + ,26 + ,658 + ,48188 + ,28 + ,12 + ,22 + ,1917 + ,161922 + ,69 + ,99 + ,21 + ,2557 + ,307432 + ,74 + ,78 + ,27 + ,2026 + ,235223 + ,79 + ,56 + ,30 + ,1911 + ,195583 + ,59 + ,67 + ,33 + ,1716 + ,146061 + ,56 + ,40 + ,11 + ,1852 + ,208834 + ,67 + ,53 + ,26 + ,981 + ,93764 + ,24 + ,26 + ,26 + ,1177 + ,151985 + ,66 + ,67 + ,23 + ,2849 + ,195506 + ,97 + ,36 + ,38 + ,1688 + ,148922 + ,60 + ,50 + ,31 + ,2162 + ,142670 + ,81 + ,51 + ,20 + ,1331 + ,129561 + ,61 + ,46 + ,22 + ,1307 + ,122204 + ,38 + ,57 + ,26 + ,1256 + ,160930 + ,35 + ,27 + ,26 + ,1294 + ,99184 + ,41 + ,38 + ,33 + ,2311 + ,192811 + ,71 + ,72 + ,36 + ,2897 + ,138708 + ,65 + ,93 + ,25 + ,1103 + ,114408 + ,38 + ,59 + ,24 + ,340 + ,31970 + ,15 + ,5 + ,21 + ,2791 + ,225558 + ,112 + ,53 + ,19 + ,1338 + ,139220 + ,72 + ,40 + ,12 + ,1441 + ,113612 + ,68 + ,72 + ,30 + ,1681 + ,119537 + ,72 + ,53 + ,21 + ,2650 + ,162203 + ,67 + ,81 + ,34 + ,1499 + ,100098 + ,44 + ,27 + ,32 + ,2302 + ,174768 + ,60 + ,94 + ,28 + ,2540 + ,158459 + ,97 + ,71 + ,28 + ,1000 + ,80934 + ,30 + ,20 + ,21 + ,1234 + ,84971 + ,71 + ,34 + ,31 + ,927 + ,80545 + ,68 + ,54 + ,26 + ,2176 + ,287191 + ,64 + ,49 + ,29 + ,957 + ,62974 + ,28 + ,26 + ,23 + ,1551 + ,134091 + ,40 + ,48 + ,25 + ,1014 + ,75555 + ,46 + ,35 + ,22 + ,1772 + ,162154 + ,55 + ,32 + ,26 + ,2630 + ,227638 + ,229 + ,55 + ,33 + ,1205 + ,115367 + ,112 + ,58 + ,24 + ,1392 + ,115603 + ,63 + ,44 + ,24 + ,1524 + ,155537 + ,52 + ,45 + ,21 + ,1829 + ,153133 + ,41 + ,49 + ,28 + ,2229 + ,165618 + ,78 + ,72 + ,27 + ,1233 + ,151517 + ,57 + ,39 + ,25 + ,1365 + ,133686 + ,58 + ,28 + ,15 + ,950 + ,61342 + ,40 + ,24 + ,13 + ,2319 + ,245196 + ,117 + ,52 + ,36 + ,1857 + ,195576 + ,70 + ,96 + ,24 + ,223 + ,19349 + ,12 + ,13 + ,1 + ,2390 + ,225371 + ,105 + ,38 + ,24 + ,1985 + ,153213 + ,78 + ,41 + ,31 + ,700 + ,59117 + ,29 + ,24 + ,4 + ,1062 + ,91762 + ,24 + ,54 + ,21 + ,1311 + ,136769 + ,54 + ,68 + ,23 + ,1157 + ,114798 + ,61 + ,28 + ,23 + ,823 + ,85338 + ,40 + ,36 + ,12 + ,596 + ,27676 + ,22 + ,2 + ,16 + ,1545 + ,153535 + ,48 + ,91 + ,29 + ,1130 + ,122417 + ,37 + ,29 + ,26 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1082 + ,91529 + ,32 + ,46 + ,25 + ,1135 + ,107205 + ,67 + ,25 + ,21 + ,1367 + ,144664 + ,45 + ,51 + ,23 + ,1506 + ,146445 + ,63 + ,60 + ,21 + ,870 + ,76656 + ,60 + ,36 + ,21 + ,78 + ,3616 + ,5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1130 + ,183088 + ,44 + ,40 + ,23 + ,1582 + ,144677 + ,84 + ,68 + ,33 + ,2034 + ,159104 + ,98 + ,28 + ,30 + ,970 + ,128944 + ,39 + ,41 + ,23 + ,778 + ,43410 + ,19 + ,7 + ,1 + ,1752 + ,175774 + ,73 + ,70 + ,29 + ,957 + ,95401 + ,42 + ,30 + ,18 + ,2098 + ,134837 + ,55 + ,69 + ,33 + ,731 + ,60493 + ,40 + ,3 + ,12 + ,285 + ,19764 + ,12 + ,10 + ,2 + ,1834 + ,164062 + ,56 + ,46 + ,21 + ,1148 + ,132696 + ,33 + ,34 + ,28 + ,1646 + ,155367 + ,54 + ,54 + ,29 + ,256 + ,11796 + ,9 + ,1 + ,2 + ,98 + ,10674 + ,9 + ,0 + ,0 + ,1404 + ,142261 + ,57 + ,39 + ,18 + ,41 + ,6836 + ,3 + ,0 + ,1 + ,1824 + ,162563 + ,63 + ,48 + ,21 + ,42 + ,5118 + ,3 + ,5 + ,0 + ,528 + ,40248 + ,16 + ,8 + ,4 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1073 + ,122641 + ,47 + ,38 + ,25 + ,1305 + ,88837 + ,38 + ,21 + ,26 + ,81 + ,7131 + ,4 + ,0 + ,0 + ,261 + ,9056 + ,14 + ,0 + ,4 + ,934 + ,76611 + ,24 + ,15 + ,17 + ,1180 + ,132697 + ,51 + ,50 + ,21 + ,1148 + ,100681 + ,20 + ,17 + ,22) + ,dim=c(5 + ,144) + ,dimnames=list(c('Pageviews' + ,'Time_in_RFC' + ,'Logins' + ,'Blogged_Computations' + ,'Reviewed_Compendiums') + ,1:144)) > y <- array(NA,dim=c(5,144),dimnames=list(c('Pageviews','Time_in_RFC','Logins','Blogged_Computations','Reviewed_Compendiums'),1:144)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par4 = 'yes' > par3 = '2' > par2 = 'quantiles' > par1 = '5' > #'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] "Reviewed_Compendiums" > x[,par1] [1] 19 20 0 27 31 36 23 30 30 26 24 30 22 28 18 22 33 15 34 18 15 30 25 34 21 [26] 21 25 31 31 20 28 22 17 25 24 0 28 14 35 34 22 34 23 24 26 22 35 24 31 26 [51] 22 21 27 30 33 11 26 26 23 38 31 20 22 26 26 33 36 25 24 21 19 12 30 21 34 [76] 32 28 28 21 31 26 29 23 25 22 26 33 24 24 21 28 27 25 15 13 36 24 1 24 31 [101] 4 21 23 23 12 16 29 26 0 25 21 23 21 21 0 0 23 33 30 23 1 29 18 33 12 [126] 2 21 28 29 2 0 18 1 21 0 4 0 25 26 0 4 17 21 22 > 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,25) [25,38] 79 65 > colnames(x) [1] "Pageviews" "Time_in_RFC" "Logins" [4] "Blogged_Computations" "Reviewed_Compendiums" > colnames(x)[par1] [1] "Reviewed_Compendiums" > x[,par1] [1] [ 0,25) [ 0,25) [ 0,25) [25,38] [25,38] [25,38] [ 0,25) [25,38] [25,38] [10] [25,38] [ 0,25) [25,38] [ 0,25) [25,38] [ 0,25) [ 0,25) [25,38] [ 0,25) [19] [25,38] [ 0,25) [ 0,25) [25,38] [25,38] [25,38] [ 0,25) [ 0,25) [25,38] [28] [25,38] [25,38] [ 0,25) [25,38] [ 0,25) [ 0,25) [25,38] [ 0,25) [ 0,25) [37] [25,38] [ 0,25) [25,38] [25,38] [ 0,25) [25,38] [ 0,25) [ 0,25) [25,38] [46] [ 0,25) [25,38] [ 0,25) [25,38] [25,38] [ 0,25) [ 0,25) [25,38] [25,38] [55] [25,38] [ 0,25) [25,38] [25,38] [ 0,25) [25,38] [25,38] [ 0,25) [ 0,25) [64] [25,38] [25,38] [25,38] [25,38] [25,38] [ 0,25) [ 0,25) [ 0,25) [ 0,25) [73] [25,38] [ 0,25) [25,38] [25,38] [25,38] [25,38] [ 0,25) [25,38] [25,38] [82] [25,38] [ 0,25) [25,38] [ 0,25) [25,38] [25,38] [ 0,25) [ 0,25) [ 0,25) [91] [25,38] [25,38] [25,38] [ 0,25) [ 0,25) [25,38] [ 0,25) [ 0,25) [ 0,25) [100] [25,38] [ 0,25) [ 0,25) [ 0,25) [ 0,25) [ 0,25) [ 0,25) [25,38] [25,38] [109] [ 0,25) [25,38] [ 0,25) [ 0,25) [ 0,25) [ 0,25) [ 0,25) [ 0,25) [ 0,25) [118] [25,38] [25,38] [ 0,25) [ 0,25) [25,38] [ 0,25) [25,38] [ 0,25) [ 0,25) [127] [ 0,25) [25,38] [25,38] [ 0,25) [ 0,25) [ 0,25) [ 0,25) [ 0,25) [ 0,25) [136] [ 0,25) [ 0,25) [25,38] [25,38] [ 0,25) [ 0,25) [ 0,25) [ 0,25) [ 0,25) Levels: [ 0,25) [25,38] > 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/1mp781324652625.tab") + } + } m.ct.i.pred m.ct.i.actu 1 2 1 447 266 2 115 449 [1] 0.6269285 [1] 0.7960993 [1] 0.7016445 m.ct.x.pred m.ct.x.actu 1 2 1 44 33 2 22 64 [1] 0.5714286 [1] 0.744186 [1] 0.6625767 > m Conditional inference tree with 2 terminal nodes Response: as.factor(Reviewed_Compendiums) Inputs: Pageviews, Time_in_RFC, Logins, Blogged_Computations Number of observations: 144 1) Pageviews <= 1205; criterion = 1, statistic = 32.821 2)* weights = 50 1) Pageviews > 1205 3)* weights = 94 > postscript(file="/var/wessaorg/rcomp/tmp/2i6xx1324652625.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/38pj21324652625.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) + } > if (par2 != 'none') { + print(cbind(as.factor(x[,par1]),predict(m))) + myt <- table(as.factor(x[,par1]),predict(m)) + print(myt) + } [,1] [,2] [1,] 1 2 [2,] 1 2 [3,] 1 1 [4,] 2 2 [5,] 2 2 [6,] 2 2 [7,] 1 2 [8,] 2 2 [9,] 2 2 [10,] 2 2 [11,] 1 2 [12,] 2 2 [13,] 1 2 [14,] 2 2 [15,] 1 2 [16,] 1 2 [17,] 2 2 [18,] 1 2 [19,] 2 2 [20,] 1 1 [21,] 1 1 [22,] 2 2 [23,] 2 2 [24,] 2 2 [25,] 1 2 [26,] 1 2 [27,] 2 2 [28,] 2 2 [29,] 2 2 [30,] 1 2 [31,] 2 2 [32,] 1 2 [33,] 1 2 [34,] 2 2 [35,] 1 2 [36,] 1 1 [37,] 2 2 [38,] 1 2 [39,] 2 2 [40,] 2 2 [41,] 1 2 [42,] 2 2 [43,] 1 1 [44,] 1 2 [45,] 2 2 [46,] 1 1 [47,] 2 1 [48,] 1 2 [49,] 2 2 [50,] 2 2 [51,] 1 1 [52,] 1 2 [53,] 2 2 [54,] 2 2 [55,] 2 2 [56,] 1 2 [57,] 2 2 [58,] 2 1 [59,] 1 1 [60,] 2 2 [61,] 2 2 [62,] 1 2 [63,] 1 2 [64,] 2 2 [65,] 2 2 [66,] 2 2 [67,] 2 2 [68,] 2 2 [69,] 1 1 [70,] 1 1 [71,] 1 2 [72,] 1 2 [73,] 2 2 [74,] 1 2 [75,] 2 2 [76,] 2 2 [77,] 2 2 [78,] 2 2 [79,] 1 1 [80,] 2 2 [81,] 2 1 [82,] 2 2 [83,] 1 1 [84,] 2 2 [85,] 1 1 [86,] 2 2 [87,] 2 2 [88,] 1 1 [89,] 1 2 [90,] 1 2 [91,] 2 2 [92,] 2 2 [93,] 2 2 [94,] 1 2 [95,] 1 1 [96,] 2 2 [97,] 1 2 [98,] 1 1 [99,] 1 2 [100,] 2 2 [101,] 1 1 [102,] 1 1 [103,] 1 2 [104,] 1 1 [105,] 1 1 [106,] 1 1 [107,] 2 2 [108,] 2 1 [109,] 1 1 [110,] 2 1 [111,] 1 1 [112,] 1 2 [113,] 1 2 [114,] 1 1 [115,] 1 1 [116,] 1 1 [117,] 1 1 [118,] 2 2 [119,] 2 2 [120,] 1 1 [121,] 1 1 [122,] 2 2 [123,] 1 1 [124,] 2 2 [125,] 1 1 [126,] 1 1 [127,] 1 2 [128,] 2 1 [129,] 2 2 [130,] 1 1 [131,] 1 1 [132,] 1 2 [133,] 1 1 [134,] 1 2 [135,] 1 1 [136,] 1 1 [137,] 1 1 [138,] 2 1 [139,] 2 2 [140,] 1 1 [141,] 1 1 [142,] 1 1 [143,] 1 1 [144,] 1 1 [ 0,25) [25,38] [ 0,25) 43 36 [25,38] 7 58 > postscript(file="/var/wessaorg/rcomp/tmp/42xee1324652625.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/5jcfw1324652625.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/6nqeo1324652625.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/7a1w81324652625.tab") + } > > try(system("convert tmp/2i6xx1324652625.ps tmp/2i6xx1324652625.png",intern=TRUE)) character(0) > try(system("convert tmp/38pj21324652625.ps tmp/38pj21324652625.png",intern=TRUE)) character(0) > try(system("convert tmp/42xee1324652625.ps tmp/42xee1324652625.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.105 0.282 3.385