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. > par9 = 'Learning Activities' > par8 = 'Learning Activities' > par7 = 'all' > par6 = 'bachelor' > par5 = 'male' > par4 = 'no' > par3 = '3' > par2 = 'none' > par1 = '0' > 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 <- as.data.frame(read.table(file='http://www.wessa.net/download/utaut.csv',sep=',',header=T)) > x$U25 <- 6-x$U25 > if(par5 == 'female') x <- x[x$Gender==0,] > if(par5 == 'male') x <- x[x$Gender==1,] > if(par6 == 'prep') x <- x[x$Pop==1,] > if(par6 == 'bachelor') x <- x[x$Pop==0,] > if(par7 != 'all') { + x <- x[x$Year==as.numeric(par7),] + } > cAc <- with(x,cbind( A1, A2, A3, A4, A5, A6, A7, A8, A9,A10)) > cAs <- with(x,cbind(A11,A12,A13,A14,A15,A16,A17,A18,A19,A20)) > cA <- cbind(cAc,cAs) > cCa <- with(x,cbind(C1,C3,C5,C7, C9,C11,C13,C15,C17,C19,C21,C23,C25,C27,C29,C31,C33,C35,C37,C39,C41,C43,C45,C47)) > cCp <- with(x,cbind(C2,C4,C6,C8,C10,C12,C14,C16,C18,C20,C22,C24,C26,C28,C30,C32,C34,C36,C38,C40,C42,C44,C46,C48)) > cC <- cbind(cCa,cCp) > cU <- with(x,cbind(U1,U2,U3,U4,U5,U6,U7,U8,U9,U10,U11,U12,U13,U14,U15,U16,U17,U18,U19,U20,U21,U22,U23,U24,U25,U26,U27,U28,U29,U30,U31,U32,U33)) > cE <- with(x,cbind(BC,NNZFG,MRT,AFL,LPM,LPC,W,WPA)) > cX <- with(x,cbind(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18)) > if (par8=='ATTLES connected') x <- cAc > if (par8=='ATTLES separate') x <- cAs > if (par8=='ATTLES all') x <- cA > if (par8=='COLLES actuals') x <- cCa > if (par8=='COLLES preferred') x <- cCp > if (par8=='COLLES all') x <- cC > if (par8=='CSUQ') x <- cU > if (par8=='Learning Activities') x <- cE > if (par8=='Exam Items') x <- cX > if (par9=='ATTLES connected') y <- cAc > if (par9=='ATTLES separate') y <- cAs > if (par9=='ATTLES all') y <- cA > if (par9=='COLLES actuals') y <- cCa > if (par9=='COLLES preferred') y <- cCp > if (par9=='COLLES all') y <- cC > if (par9=='CSUQ') y <- cU > if (par9=='Learning Activities') y <- cE > if (par9=='Exam Items') y <- cX > if (par1==0) { + nr <- length(y[,1]) + nc <- length(y[1,]) + mysum <- array(0,dim=nr) + for(jjj in 1:nr) { + for(iii in 1:nc) { + mysum[jjj] = mysum[jjj] + y[jjj,iii] + } + } + y <- mysum + } else { + y <- y[,par1] + } > nx <- cbind(y,x) > colnames(nx) <- c('endo',colnames(x)) > x <- nx > par1=1 > ncol <- length(x[1,]) > for (jjj in 1:ncol) { + x <- x[!is.na(x[,jjj]),] + } > x <- as.data.frame(x) > k <- length(x[1,]) > n <- length(x[,1]) > colnames(x)[par1] [1] "endo" > x[,par1] [1] 6704.730 7365.200 9735.730 11423.860 8446.730 8115.670 7432.140 [8] 8028.263 8106.133 7122.570 6550.880 7519.270 5721.450 7941.540 [15] 6734.700 9659.920 10472.940 8335.453 7171.570 4366.980 6905.900 [22] 6411.900 4046.330 4520.670 8171.440 7045.030 7138.500 3540.170 [29] 12068.390 6796.870 9300.490 8714.340 7139.600 9678.670 10139.580 [36] 9533.680 9268.450 5769.620 5108.870 9521.070 6015.800 7660.520 [43] 7290.230 9303.930 9820.990 6982.560 6696.290 6068.490 9784.520 [50] 7368.020 8711.650 7038.440 8736.020 12375.840 13022.310 9815.300 [57] 8057.830 6213.800 9314.640 11078.190 9024.670 8439.600 6591.210 [64] 6619.700 5469.090 8972.963 6410.880 8098.200 6317.420 14159.910 [71] 9635.520 7360.020 10485.310 9096.530 13043.260 8228.390 11392.940 [78] 14565.620 6399.880 8761.830 4324.310 15740.780 9649.980 12950.090 [85] 10007.320 13029.740 14456.690 312.320 8000.230 12670.050 10443.820 [92] 7380.800 12364.370 7685.110 13917.620 4260.960 4263.650 9808.160 [99] 503.930 6106.860 9756.570 7559.880 9480.000 10012.880 14942.560 [106] 10118.750 9503.110 9389.230 2078.300 5959.400 4008.600 11099.220 [113] 12040.950 7242.240 19323.430 8379.810 3626.590 906.040 4100.630 [120] 14625.770 6894.780 7148.200 8562.890 8514.390 5641.340 8592.500 [127] 13820.830 15285.880 10996.040 8228.670 7955.020 7690.870 0.000 [134] 7861.300 13104.850 5915.810 5504.230 402.040 6631.440 8687.310 [141] 1943.900 8117.730 > 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 312.32 402.04 503.93 906.04 1 1 1 1 1 1943.9 2078.3 3540.17 3626.59 4008.6 1 1 1 1 1 4046.33 4100.63 4260.96 4263.65 4324.31 1 1 1 1 1 4366.98 4520.67 5108.87 5469.09 5504.23 1 1 1 1 1 5641.34 5721.45 5769.62 5915.81 5959.4 1 1 1 1 1 6015.8 6068.49 6106.86 6213.8 6317.42 1 1 1 1 1 6399.88 6410.88 6411.9 6550.88 6591.21 1 1 1 1 1 6619.7 6631.44 6696.29 6704.73 6734.7 1 1 1 1 1 6796.87 6894.78 6905.9 6982.56 7038.44 1 1 1 1 1 7045.03 7122.57 7138.5 7139.6 7148.2 1 1 1 1 1 7171.57 7242.24 7290.23 7360.02 7365.2 1 1 1 1 1 7368.02 7380.8 7432.14 7519.27 7559.88 1 1 1 1 1 7660.52 7685.11 7690.87 7861.3 7941.54 1 1 1 1 1 7955.02 8000.23 8028.2633333333 8057.83 8098.2 1 1 1 1 1 8106.1333333333 8115.67 8117.73 8171.44 8228.39 1 1 1 1 1 8228.67 8335.4533333333 8379.81 8439.6 8446.73 1 1 1 1 1 8514.39 8562.89 8592.5 8687.31 8711.65 1 1 1 1 1 8714.34 8736.02 8761.83 8972.9633333333 9024.67 1 1 1 1 1 9096.53 9268.45 9300.49 9303.93 9314.64 1 1 1 1 1 9389.23 9480 9503.11 9521.07 9533.68 1 1 1 1 1 9635.52 9649.98 9659.92 9678.67 9735.73 1 1 1 1 1 9756.57 9784.52 9808.16 9815.3 9820.99 1 1 1 1 1 10007.32 10012.88 10118.75 10139.58 10443.82 1 1 1 1 1 10472.94 10485.31 10996.04 11078.19 11099.22 1 1 1 1 1 11392.94 11423.86 12040.95 12068.39 12364.37 1 1 1 1 1 12375.84 12670.05 12950.09 13022.31 13029.74 1 1 1 1 1 13043.26 13104.85 13820.83 13917.62 14159.91 1 1 1 1 1 14456.69 14565.62 14625.77 14942.56 15285.88 1 1 1 1 1 15740.78 19323.43 1 1 > colnames(x) [1] "endo" "BC" "NNZFG" "MRT" "AFL" "LPM" "LPC" "W" "WPA" > colnames(x)[par1] [1] "endo" > x[,par1] [1] 6704.730 7365.200 9735.730 11423.860 8446.730 8115.670 7432.140 [8] 8028.263 8106.133 7122.570 6550.880 7519.270 5721.450 7941.540 [15] 6734.700 9659.920 10472.940 8335.453 7171.570 4366.980 6905.900 [22] 6411.900 4046.330 4520.670 8171.440 7045.030 7138.500 3540.170 [29] 12068.390 6796.870 9300.490 8714.340 7139.600 9678.670 10139.580 [36] 9533.680 9268.450 5769.620 5108.870 9521.070 6015.800 7660.520 [43] 7290.230 9303.930 9820.990 6982.560 6696.290 6068.490 9784.520 [50] 7368.020 8711.650 7038.440 8736.020 12375.840 13022.310 9815.300 [57] 8057.830 6213.800 9314.640 11078.190 9024.670 8439.600 6591.210 [64] 6619.700 5469.090 8972.963 6410.880 8098.200 6317.420 14159.910 [71] 9635.520 7360.020 10485.310 9096.530 13043.260 8228.390 11392.940 [78] 14565.620 6399.880 8761.830 4324.310 15740.780 9649.980 12950.090 [85] 10007.320 13029.740 14456.690 312.320 8000.230 12670.050 10443.820 [92] 7380.800 12364.370 7685.110 13917.620 4260.960 4263.650 9808.160 [99] 503.930 6106.860 9756.570 7559.880 9480.000 10012.880 14942.560 [106] 10118.750 9503.110 9389.230 2078.300 5959.400 4008.600 11099.220 [113] 12040.950 7242.240 19323.430 8379.810 3626.590 906.040 4100.630 [120] 14625.770 6894.780 7148.200 8562.890 8514.390 5641.340 8592.500 [127] 13820.830 15285.880 10996.040 8228.670 7955.020 7690.870 0.000 [134] 7861.300 13104.850 5915.810 5504.230 402.040 6631.440 8687.310 [141] 1943.900 8117.730 > 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/1lwcg1335789475.tab") + } + } > m Conditional inference tree with 10 terminal nodes Response: endo Inputs: BC, NNZFG, MRT, AFL, LPM, LPC, W, WPA Number of observations: 142 1) W <= 4300; criterion = 1, statistic = 114.997 2) W <= 2045; criterion = 1, statistic = 62.359 3)* weights = 15 2) W > 2045 4) WPA <= 3199; criterion = 1, statistic = 40.845 5) W <= 2875; criterion = 0.993, statistic = 11.166 6)* weights = 8 5) W > 2875 7)* weights = 26 4) WPA > 3199 8) W <= 3609; criterion = 1, statistic = 22.028 9)* weights = 11 8) W > 3609 10)* weights = 13 1) W > 4300 11) WPA <= 4454; criterion = 1, statistic = 54.116 12) WPA <= 2670.5; criterion = 0.999, statistic = 15.558 13) W <= 5991; criterion = 0.999, statistic = 14.266 14)* weights = 14 13) W > 5991 15)* weights = 7 12) WPA > 2670.5 16)* weights = 16 11) WPA > 4454 17) W <= 5778; criterion = 1, statistic = 23.43 18)* weights = 16 17) W > 5778 19)* weights = 16 > postscript(file="/var/wessaorg/rcomp/tmp/2pbql1335789475.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/311gv1335789475.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 6704.730 6515.672 189.05769 2 7365.200 7427.373 -62.17273 3 9735.730 9621.178 114.55187 4 11423.860 10934.193 489.66688 5 8446.730 8516.488 -69.75846 6 8115.670 8002.834 112.83643 7 7432.140 8002.834 -570.69357 8 8028.263 8002.834 25.42976 9 8106.133 8002.834 103.29976 10 7122.570 6515.672 606.89769 11 6550.880 6515.672 35.20769 12 7519.270 8002.834 -483.56357 13 5721.450 6515.672 -794.22231 14 7941.540 8002.834 -61.29357 15 6734.700 6515.672 219.02769 16 9659.920 9621.178 38.74187 17 10472.940 9124.072 1348.86810 18 8335.453 8002.834 332.61976 19 7171.570 6515.672 655.89769 20 4366.980 5517.523 -1150.54250 21 6905.900 6515.672 390.22769 22 6411.900 6515.672 -103.77231 23 4046.330 2554.518 1491.81200 24 4520.670 5517.523 -996.85250 25 8171.440 8516.488 -345.04846 26 7045.030 6515.672 529.35769 27 7138.500 6515.672 622.82769 28 3540.170 2554.518 985.65200 29 12068.390 10934.193 1134.19687 30 6796.870 6515.672 281.19769 31 9300.490 8516.488 784.00154 32 8714.340 9124.072 -409.73190 33 7139.600 7427.373 -287.77273 34 9678.670 9621.178 57.49187 35 10139.580 9621.178 518.40187 36 9533.680 9621.178 -87.49813 37 9268.450 9621.178 -352.72812 38 5769.620 6515.672 -746.05231 39 5108.870 6515.672 -1406.80231 40 9521.070 9621.178 -100.10813 41 6015.800 5517.523 498.27750 42 7660.520 7427.373 233.14727 43 7290.230 7427.373 -137.14273 44 9303.930 9621.178 -317.24813 45 9820.990 9124.072 696.91810 46 6982.560 6515.672 466.88769 47 6696.290 6515.672 180.61769 48 6068.490 5517.523 550.96750 49 9784.520 9621.178 163.34188 50 7368.020 7427.373 -59.35273 51 8711.650 9124.072 -412.42190 52 7038.440 6515.672 522.76769 53 8736.020 9124.072 -388.05190 54 12375.840 10934.193 1441.64688 55 13022.310 14291.212 -1268.90187 56 9815.300 9621.178 194.12187 57 8057.830 8516.488 -458.65846 58 6213.800 6515.672 -301.87231 59 9314.640 9621.178 -306.53813 60 11078.190 10934.193 143.99688 61 9024.670 8516.488 508.18154 62 8439.600 9124.072 -684.47190 63 6591.210 6515.672 75.53769 64 6619.700 6515.672 104.02769 65 5469.090 6515.672 -1046.58231 66 8972.963 9124.072 -151.10857 67 6410.880 6515.672 -104.79231 68 8098.200 8002.834 95.36643 69 6317.420 6515.672 -198.25231 70 14159.910 14291.212 -131.30187 71 9635.520 9621.178 14.34188 72 7360.020 8002.834 -642.81357 73 10485.310 10934.193 -448.88312 74 9096.530 8516.488 580.04154 75 13043.260 14291.212 -1247.95187 76 8228.390 8516.488 -288.09846 77 11392.940 10934.193 458.74688 78 14565.620 14291.212 274.40812 79 6399.880 6515.672 -115.79231 80 8761.830 8516.488 245.34154 81 4324.310 2554.518 1769.79200 82 15740.780 14291.212 1449.56813 83 9649.980 10934.193 -1284.21313 84 12950.090 14291.212 -1341.12187 85 10007.320 10934.193 -926.87313 86 13029.740 14291.212 -1261.47187 87 14456.690 14291.212 165.47813 88 312.320 2554.518 -2242.19800 89 8000.230 8516.488 -516.25846 90 12670.050 14291.212 -1621.16187 91 10443.820 10934.193 -490.37313 92 7380.800 7427.373 -46.57273 93 12364.370 10934.193 1430.17687 94 7685.110 7427.373 257.73727 95 13917.620 14291.212 -373.59188 96 4260.960 2554.518 1706.44200 97 4263.650 2554.518 1709.13200 98 9808.160 9621.178 186.98187 99 503.930 2554.518 -2050.58800 100 6106.860 5517.523 589.33750 101 9756.570 9621.178 135.39187 102 7559.880 7427.373 132.50727 103 9480.000 9621.178 -141.17813 104 10012.880 10934.193 -921.31312 105 14942.560 14291.212 651.34813 106 10118.750 10934.193 -815.44312 107 9503.110 9621.178 -118.06812 108 9389.230 10934.193 -1544.96313 109 2078.300 2554.518 -476.21800 110 5959.400 6515.672 -556.27231 111 4008.600 2554.518 1454.08200 112 11099.220 10934.193 165.02688 113 12040.950 10934.193 1106.75688 114 7242.240 7427.373 -185.13273 115 19323.430 14291.212 5032.21813 116 8379.810 8002.834 376.97643 117 3626.590 2554.518 1072.07200 118 906.040 2554.518 -1648.47800 119 4100.630 2554.518 1546.11200 120 14625.770 14291.212 334.55813 121 6894.780 6515.672 379.10769 122 7148.200 7427.373 -279.17273 123 8562.890 8002.834 560.05643 124 8514.390 8002.834 511.55643 125 5641.340 5517.523 123.81750 126 8592.500 8516.488 76.01154 127 13820.830 14291.212 -470.38187 128 15285.880 14291.212 994.66813 129 10996.040 10934.193 61.84688 130 8228.670 8516.488 -287.81846 131 7955.020 8002.834 -47.81357 132 7690.870 8002.834 -311.96357 133 0.000 2554.518 -2554.51800 134 7861.300 7427.373 433.92727 135 13104.850 14291.212 -1186.36187 136 5915.810 5517.523 398.28750 137 5504.230 5517.523 -13.29250 138 402.040 2554.518 -2152.47800 139 6631.440 6515.672 115.76769 140 8687.310 8516.488 170.82154 141 1943.900 2554.518 -610.61800 142 8117.730 8516.488 -398.75846 > 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/410bz1335789475.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/5twgk1335789475.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/6z5lo1335789475.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/7qyr81335789475.tab") + } > > try(system("convert tmp/2pbql1335789475.ps tmp/2pbql1335789475.png",intern=TRUE)) character(0) > try(system("convert tmp/311gv1335789475.ps tmp/311gv1335789475.png",intern=TRUE)) character(0) > try(system("convert tmp/410bz1335789475.ps tmp/410bz1335789475.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.672 0.321 3.984