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(101645 + ,63 + ,20 + ,38 + ,17140 + ,28 + ,101011 + ,34 + ,30 + ,39 + ,27570 + ,35 + ,7176 + ,17 + ,0 + ,0 + ,1423 + ,0 + ,96560 + ,76 + ,42 + ,38 + ,22996 + ,47 + ,175824 + ,107 + ,57 + ,77 + ,39992 + ,70 + ,341570 + ,168 + ,94 + ,78 + ,117105 + ,135 + ,103597 + ,43 + ,27 + ,49 + ,23789 + ,26 + ,112611 + ,41 + ,46 + ,73 + ,26706 + ,48 + ,85574 + ,34 + ,37 + ,36 + ,24266 + ,40 + ,220801 + ,75 + ,51 + ,63 + ,44418 + ,66 + ,92661 + ,61 + ,40 + ,41 + ,35232 + ,39 + ,133328 + ,55 + ,56 + ,56 + ,40909 + ,66 + ,61361 + ,77 + ,27 + ,25 + ,13294 + ,27 + ,125930 + ,75 + ,37 + ,65 + ,32387 + ,65 + ,82316 + ,32 + ,27 + ,38 + ,21233 + ,25 + ,102010 + ,53 + ,28 + ,44 + ,44332 + ,26 + ,101523 + ,42 + ,59 + ,87 + ,61056 + ,77 + ,41566 + ,35 + ,0 + ,27 + ,13497 + ,2 + ,99923 + ,66 + ,44 + ,80 + ,32334 + ,36 + ,22648 + ,19 + ,12 + ,28 + ,44339 + ,24 + ,46698 + ,45 + ,14 + ,33 + ,10288 + ,14 + ,131698 + ,65 + ,60 + ,59 + ,65622 + ,78 + ,91735 + ,35 + ,7 + ,49 + ,16563 + ,15 + ,79863 + ,37 + ,29 + ,49 + ,29011 + ,24 + ,108043 + ,62 + ,45 + ,38 + ,34553 + ,40 + ,98866 + ,18 + ,25 + ,39 + ,23517 + ,50 + ,120445 + ,118 + ,36 + ,56 + ,51009 + ,63 + ,116048 + ,64 + ,50 + ,50 + ,33416 + ,63 + ,250047 + ,81 + ,41 + ,61 + ,83305 + ,55 + ,136084 + ,30 + ,27 + ,41 + ,27142 + ,40 + ,92499 + ,32 + ,25 + ,55 + ,21399 + ,21 + ,135781 + ,31 + ,45 + ,44 + ,24874 + ,32 + ,74408 + ,67 + ,29 + ,21 + ,34988 + ,36 + ,81240 + ,66 + ,58 + ,50 + ,45549 + ,13 + ,133368 + ,36 + ,37 + ,57 + ,32755 + ,57 + ,98146 + ,40 + ,15 + ,48 + ,27114 + ,21 + ,79619 + ,43 + ,42 + ,32 + ,20760 + ,43 + ,59194 + ,31 + ,7 + ,68 + ,37636 + ,20 + ,139942 + ,42 + ,54 + ,87 + ,65461 + ,82 + ,118612 + ,46 + ,54 + ,43 + ,30080 + ,90 + ,72880 + ,33 + ,14 + ,67 + ,24094 + ,25 + ,65475 + ,18 + ,16 + ,46 + ,69008 + ,60 + ,99643 + ,55 + ,33 + ,46 + ,54968 + ,61 + ,71965 + ,35 + ,32 + ,56 + ,46090 + ,85 + ,77272 + ,59 + ,21 + ,48 + ,27507 + ,43 + ,49289 + ,19 + ,15 + ,44 + ,10672 + ,25 + ,135131 + ,66 + ,38 + ,60 + ,34029 + ,41 + ,108446 + ,60 + ,22 + ,65 + ,46300 + ,26 + ,89746 + ,36 + ,28 + ,55 + ,24760 + ,38 + ,44296 + ,25 + ,10 + ,38 + ,18779 + ,12 + ,77648 + ,47 + ,31 + ,52 + ,21280 + ,29 + ,181528 + ,54 + ,32 + ,60 + ,40662 + ,49 + ,134019 + ,53 + ,32 + ,54 + ,28987 + ,46 + ,124064 + ,40 + ,43 + ,86 + ,22827 + ,41 + ,92630 + ,40 + ,27 + ,24 + ,18513 + ,31 + ,121848 + ,39 + ,37 + ,52 + ,30594 + ,41 + ,52915 + ,14 + ,20 + ,49 + ,24006 + ,26 + ,81872 + ,45 + ,32 + ,61 + ,27913 + ,23 + ,58981 + ,36 + ,0 + ,61 + ,42744 + ,14 + ,53515 + ,28 + ,5 + ,81 + ,12934 + ,16 + ,60812 + ,44 + ,26 + ,43 + ,22574 + ,25 + ,56375 + ,30 + ,10 + ,40 + ,41385 + ,21 + ,65490 + ,22 + ,27 + ,40 + ,18653 + ,32 + ,80949 + ,17 + ,11 + ,56 + ,18472 + ,9 + ,76302 + ,31 + ,29 + ,68 + ,30976 + ,35 + ,104011 + ,55 + ,25 + ,79 + ,63339 + ,42 + ,98104 + ,54 + ,55 + ,47 + ,25568 + ,68 + ,67989 + ,21 + ,23 + ,57 + ,33747 + ,32 + ,30989 + ,14 + ,5 + ,41 + ,4154 + ,6 + ,135458 + ,81 + ,43 + ,29 + ,19474 + ,68 + ,73504 + ,35 + ,23 + ,3 + ,35130 + ,33 + ,63123 + ,43 + ,34 + ,60 + ,39067 + ,84 + ,61254 + ,46 + ,36 + ,30 + ,13310 + ,46 + ,74914 + ,30 + ,35 + ,79 + ,65892 + ,30 + ,31774 + ,23 + ,0 + ,47 + ,4143 + ,0 + ,81437 + ,38 + ,37 + ,40 + ,28579 + ,36 + ,87186 + ,54 + ,28 + ,48 + ,51776 + ,47 + ,50090 + ,20 + ,16 + ,36 + ,21152 + ,20 + ,65745 + ,53 + ,26 + ,42 + ,38084 + ,50 + ,56653 + ,45 + ,38 + ,49 + ,27717 + ,30 + ,158399 + ,39 + ,23 + ,57 + ,32928 + ,30 + ,46455 + ,20 + ,22 + ,12 + ,11342 + ,34 + ,73624 + ,24 + ,30 + ,40 + ,19499 + ,33 + ,38395 + ,31 + ,16 + ,43 + ,16380 + ,34 + ,91899 + ,35 + ,18 + ,33 + ,36874 + ,37 + ,139526 + ,151 + ,28 + ,77 + ,48259 + ,83 + ,52164 + ,52 + ,32 + ,43 + ,16734 + ,32 + ,51567 + ,30 + ,21 + ,45 + ,28207 + ,30 + ,70551 + ,31 + ,23 + ,47 + ,30143 + ,43 + ,84856 + ,29 + ,29 + ,43 + ,41369 + ,41 + ,102538 + ,57 + ,50 + ,45 + ,45833 + ,51 + ,86678 + ,40 + ,12 + ,50 + ,29156 + ,19 + ,85709 + ,44 + ,21 + ,35 + ,35944 + ,37 + ,34662 + ,25 + ,18 + ,7 + ,36278 + ,33 + ,150580 + ,77 + ,27 + ,71 + ,45588 + ,41 + ,99611 + ,35 + ,41 + ,67 + ,45097 + ,54 + ,19349 + ,11 + ,13 + ,0 + ,3895 + ,14 + ,99373 + ,63 + ,12 + ,62 + ,28394 + ,25 + ,86230 + ,44 + ,21 + ,54 + ,18632 + ,25 + ,30837 + ,19 + ,8 + ,4 + ,2325 + ,8 + ,31706 + ,13 + ,26 + ,25 + ,25139 + ,26 + ,89806 + ,42 + ,27 + ,40 + ,27975 + ,20 + ,62088 + ,38 + ,13 + ,38 + ,14483 + ,11 + ,40151 + ,29 + ,16 + ,19 + ,13127 + ,14 + ,27634 + ,20 + ,2 + ,17 + ,5839 + ,3 + ,76990 + ,27 + ,42 + ,67 + ,24069 + ,40 + ,37460 + ,20 + ,5 + ,14 + ,3738 + ,5 + ,54157 + ,19 + ,37 + ,30 + ,18625 + ,38 + ,49862 + ,37 + ,17 + ,54 + ,36341 + ,32 + ,84337 + ,26 + ,38 + ,35 + ,24548 + ,41 + ,64175 + ,42 + ,37 + ,59 + ,21792 + ,46 + ,59382 + ,49 + ,29 + ,24 + ,26263 + ,47 + ,119308 + ,30 + ,32 + ,58 + ,23686 + ,37 + ,76702 + ,49 + ,35 + ,42 + ,49303 + ,51 + ,103425 + ,67 + ,17 + ,46 + ,25659 + ,49 + ,70344 + ,28 + ,20 + ,61 + ,28904 + ,21 + ,43410 + ,19 + ,7 + ,3 + ,2781 + ,1 + ,104838 + ,49 + ,46 + ,52 + ,29236 + ,44 + ,62215 + ,27 + ,24 + ,25 + ,19546 + ,26 + ,69304 + ,30 + ,40 + ,40 + ,22818 + ,21 + ,53117 + ,22 + ,3 + ,32 + ,32689 + ,4 + ,19764 + ,12 + ,10 + ,4 + ,5752 + ,10 + ,86680 + ,31 + ,37 + ,49 + ,22197 + ,43 + ,84105 + ,20 + ,17 + ,63 + ,20055 + ,34 + ,77945 + ,20 + ,28 + ,67 + ,25272 + ,32 + ,89113 + ,39 + ,19 + ,32 + ,82206 + ,20 + ,91005 + ,29 + ,29 + ,23 + ,32073 + ,34 + ,40248 + ,16 + ,8 + ,7 + ,5444 + ,6 + ,64187 + ,27 + ,10 + ,54 + ,20154 + ,12 + ,50857 + ,21 + ,15 + ,37 + ,36944 + ,24 + ,56613 + ,19 + ,15 + ,35 + ,8019 + ,16 + ,62792 + ,35 + ,28 + ,51 + ,30884 + ,72 + ,72535 + ,14 + ,17 + ,39 + ,19540 + ,27) + ,dim=c(6 + ,133) + ,dimnames=list(c('time_in_rfc' + ,'logins' + ,'blogged_computations' + ,'feedback_messages_p120' + ,'totsize' + ,'tothyperlinks ') + ,1:133)) > y <- array(NA,dim=c(6,133),dimnames=list(c('time_in_rfc','logins','blogged_computations','feedback_messages_p120','totsize','tothyperlinks '),1:133)) > 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 = '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] "time_in_rfc" > x[,par1] [1] 101645 101011 7176 96560 175824 341570 103597 112611 85574 220801 [11] 92661 133328 61361 125930 82316 102010 101523 41566 99923 22648 [21] 46698 131698 91735 79863 108043 98866 120445 116048 250047 136084 [31] 92499 135781 74408 81240 133368 98146 79619 59194 139942 118612 [41] 72880 65475 99643 71965 77272 49289 135131 108446 89746 44296 [51] 77648 181528 134019 124064 92630 121848 52915 81872 58981 53515 [61] 60812 56375 65490 80949 76302 104011 98104 67989 30989 135458 [71] 73504 63123 61254 74914 31774 81437 87186 50090 65745 56653 [81] 158399 46455 73624 38395 91899 139526 52164 51567 70551 84856 [91] 102538 86678 85709 34662 150580 99611 19349 99373 86230 30837 [101] 31706 89806 62088 40151 27634 76990 37460 54157 49862 84337 [111] 64175 59382 119308 76702 103425 70344 43410 104838 62215 69304 [121] 53117 19764 86680 84105 77945 89113 91005 40248 64187 50857 [131] 56613 62792 72535 > 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]) [ 7176, 81240) [81240,341570] 67 66 > colnames(x) [1] "time_in_rfc" "logins" "blogged_computations" [4] "feedback_messages_p120" "totsize" "tothyperlinks." > colnames(x)[par1] [1] "time_in_rfc" > x[,par1] [1] [81240,341570] [81240,341570] [ 7176, 81240) [81240,341570] [81240,341570] [6] [81240,341570] [81240,341570] [81240,341570] [81240,341570] [81240,341570] [11] [81240,341570] [81240,341570] [ 7176, 81240) [81240,341570] [81240,341570] [16] [81240,341570] [81240,341570] [ 7176, 81240) [81240,341570] [ 7176, 81240) [21] [ 7176, 81240) [81240,341570] [81240,341570] [ 7176, 81240) [81240,341570] [26] [81240,341570] [81240,341570] [81240,341570] [81240,341570] [81240,341570] [31] [81240,341570] [81240,341570] [ 7176, 81240) [81240,341570] [81240,341570] [36] [81240,341570] [ 7176, 81240) [ 7176, 81240) [81240,341570] [81240,341570] [41] [ 7176, 81240) [ 7176, 81240) [81240,341570] [ 7176, 81240) [ 7176, 81240) [46] [ 7176, 81240) [81240,341570] [81240,341570] [81240,341570] [ 7176, 81240) [51] [ 7176, 81240) [81240,341570] [81240,341570] [81240,341570] [81240,341570] [56] [81240,341570] [ 7176, 81240) [81240,341570] [ 7176, 81240) [ 7176, 81240) [61] [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [66] [81240,341570] [81240,341570] [ 7176, 81240) [ 7176, 81240) [81240,341570] [71] [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [76] [81240,341570] [81240,341570] [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [81] [81240,341570] [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [81240,341570] [86] [81240,341570] [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [81240,341570] [91] [81240,341570] [81240,341570] [81240,341570] [ 7176, 81240) [81240,341570] [96] [81240,341570] [ 7176, 81240) [81240,341570] [81240,341570] [ 7176, 81240) [101] [ 7176, 81240) [81240,341570] [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [106] [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [81240,341570] [111] [ 7176, 81240) [ 7176, 81240) [81240,341570] [ 7176, 81240) [81240,341570] [116] [ 7176, 81240) [ 7176, 81240) [81240,341570] [ 7176, 81240) [ 7176, 81240) [121] [ 7176, 81240) [ 7176, 81240) [81240,341570] [81240,341570] [ 7176, 81240) [126] [81240,341570] [81240,341570] [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) [131] [ 7176, 81240) [ 7176, 81240) [ 7176, 81240) Levels: [ 7176, 81240) [81240,341570] > 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/1mo9q1324655167.tab") + } + } m.ct.i.pred m.ct.i.actu 1 2 1 377 231 2 54 538 [1] 0.6200658 [1] 0.9087838 [1] 0.7625 m.ct.x.pred m.ct.x.actu 1 2 1 30 32 2 9 59 [1] 0.483871 [1] 0.8676471 [1] 0.6846154 > m Conditional inference tree with 4 terminal nodes Response: as.factor(time_in_rfc) Inputs: logins, blogged_computations, feedback_messages_p120, totsize, tothyperlinks. Number of observations: 133 1) blogged_computations <= 16; criterion = 1, statistic = 33.918 2) logins <= 33; criterion = 0.998, statistic = 12.634 3)* weights = 26 2) logins > 33 4)* weights = 8 1) blogged_computations > 16 5) logins <= 28; criterion = 0.997, statistic = 11.99 6)* weights = 16 5) logins > 28 7)* weights = 83 > postscript(file="/var/wessaorg/rcomp/tmp/25vx01324655167.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/38o361324655167.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,] 2 2 [2,] 2 2 [3,] 1 1 [4,] 2 2 [5,] 2 2 [6,] 2 2 [7,] 2 2 [8,] 2 2 [9,] 2 2 [10,] 2 2 [11,] 2 2 [12,] 2 2 [13,] 1 2 [14,] 2 2 [15,] 2 2 [16,] 2 2 [17,] 2 2 [18,] 1 1 [19,] 2 2 [20,] 1 1 [21,] 1 1 [22,] 2 2 [23,] 2 1 [24,] 1 2 [25,] 2 2 [26,] 2 1 [27,] 2 2 [28,] 2 2 [29,] 2 2 [30,] 2 2 [31,] 2 2 [32,] 2 2 [33,] 1 2 [34,] 2 2 [35,] 2 2 [36,] 2 1 [37,] 1 2 [38,] 1 1 [39,] 2 2 [40,] 2 2 [41,] 1 1 [42,] 1 1 [43,] 2 2 [44,] 1 2 [45,] 1 2 [46,] 1 1 [47,] 2 2 [48,] 2 2 [49,] 2 2 [50,] 1 1 [51,] 1 2 [52,] 2 2 [53,] 2 2 [54,] 2 2 [55,] 2 2 [56,] 2 2 [57,] 1 1 [58,] 2 2 [59,] 1 1 [60,] 1 1 [61,] 1 2 [62,] 1 1 [63,] 1 1 [64,] 1 1 [65,] 1 2 [66,] 2 2 [67,] 2 2 [68,] 1 1 [69,] 1 1 [70,] 2 2 [71,] 1 2 [72,] 1 2 [73,] 1 2 [74,] 1 2 [75,] 1 1 [76,] 2 2 [77,] 2 2 [78,] 1 1 [79,] 1 2 [80,] 1 2 [81,] 2 2 [82,] 1 1 [83,] 1 1 [84,] 1 1 [85,] 2 2 [86,] 2 2 [87,] 1 2 [88,] 1 2 [89,] 1 2 [90,] 2 2 [91,] 2 2 [92,] 2 1 [93,] 2 2 [94,] 1 1 [95,] 2 2 [96,] 2 2 [97,] 1 1 [98,] 2 1 [99,] 2 2 [100,] 1 1 [101,] 1 1 [102,] 2 2 [103,] 1 1 [104,] 1 1 [105,] 1 1 [106,] 1 1 [107,] 1 1 [108,] 1 1 [109,] 1 2 [110,] 2 1 [111,] 1 2 [112,] 1 2 [113,] 2 2 [114,] 1 2 [115,] 2 2 [116,] 1 1 [117,] 1 1 [118,] 2 2 [119,] 1 1 [120,] 1 2 [121,] 1 1 [122,] 1 1 [123,] 2 2 [124,] 2 1 [125,] 1 1 [126,] 2 2 [127,] 2 2 [128,] 1 1 [129,] 1 1 [130,] 1 1 [131,] 1 1 [132,] 1 2 [133,] 1 1 [ 7176, 81240) [81240,341570] [ 7176, 81240) 43 24 [81240,341570] 7 59 > postscript(file="/var/wessaorg/rcomp/tmp/402wz1324655167.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/5c64g1324655167.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/6cm2x1324655167.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/7kr1r1324655167.tab") + } > > try(system("convert tmp/25vx01324655167.ps tmp/25vx01324655167.png",intern=TRUE)) character(0) > try(system("convert tmp/38o361324655167.ps tmp/38o361324655167.png",intern=TRUE)) character(0) > try(system("convert tmp/402wz1324655167.ps tmp/402wz1324655167.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.275 0.272 3.547