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 = 'female' > 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] 5123.100 5970.440 10441.130 7707.260 10489.060 12247.670 6713.040 [8] 9370.703 8282.810 8756.093 12624.320 8866.343 6063.610 7018.630 [15] 5517.950 9701.810 9810.060 7446.070 7954.650 6300.700 7142.280 [22] 9202.320 5867.790 4481.130 13707.573 9927.510 8741.737 7095.660 [29] 9186.730 8958.790 5701.560 6940.110 8452.860 13315.123 6301.370 [36] 5614.490 10239.780 7072.100 5381.770 10010.060 4844.830 7982.600 [43] 8956.813 8350.200 13201.790 5350.280 9404.760 6740.520 11055.210 [50] 10406.840 6996.910 6239.870 6184.580 7473.557 11568.240 8569.547 [57] 11914.480 6086.440 12749.660 5384.010 11344.700 7137.820 7297.280 [64] 7294.080 9876.430 8047.740 9801.260 11924.240 13083.540 8829.977 [71] 6959.310 9545.510 8963.523 4868.320 9288.220 8351.320 8579.560 [78] 13804.410 7377.957 7727.837 8735.850 13327.653 17394.270 8975.820 [85] 17338.590 7967.820 11613.870 7894.850 8315.490 15474.530 8821.300 [92] 11025.410 9762.970 12871.940 10142.820 10070.770 16068.910 11407.430 [99] 8652.820 17509.510 7451.380 8114.970 8409.370 9447.650 17281.480 [106] 5679.410 9826.740 11758.490 3928.270 20683.240 6783.190 8665.670 [113] 14167.730 362.340 4380.050 14235.200 5643.240 14639.780 8517.400 [120] 12805.950 5945.520 7642.430 19226.290 13625.030 8005.460 8254.530 [127] 15101.560 13953.020 10692.690 9730.570 12431.050 10350.380 7404.660 > 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]) 362.34 3928.27 4380.05 4481.13 1 1 1 1 4844.83 4868.32 5123.1 5350.28 1 1 1 1 5381.77 5384.01 5517.95 5614.49 1 1 1 1 5643.24 5679.41 5701.56 5867.79 1 1 1 1 5945.52 5970.44 6063.61 6086.44 1 1 1 1 6184.58 6239.87 6300.7 6301.37 1 1 1 1 6713.04 6740.52 6783.19 6940.11 1 1 1 1 6959.31 6996.91 7018.63 7072.1 1 1 1 1 7095.66 7137.82 7142.28 7294.08 1 1 1 1 7297.28 7377.9566666667 7404.66 7446.07 1 1 1 1 7451.38 7473.5566666667 7642.43 7707.26 1 1 1 1 7727.8366666667 7894.85 7954.65 7967.82 1 1 1 1 7982.6 8005.46 8047.74 8114.97 1 1 1 1 8254.53 8282.81 8315.49 8350.2 1 1 1 1 8351.32 8409.37 8452.86 8517.4 1 1 1 1 8569.5466666667 8579.56 8652.82 8665.67 1 1 1 1 8735.85 8741.7366666667 8756.0933333333 8821.3 1 1 1 1 8829.9766666667 8866.3433333333 8956.8133333333 8958.79 1 1 1 1 8963.5233333333 8975.82 9186.73 9202.32 1 1 1 1 9288.22 9370.7033333333 9404.76 9447.65 1 1 1 1 9545.51 9701.81 9730.57 9762.97 1 1 1 1 9801.26 9810.06 9826.74 9876.43 1 1 1 1 9927.51 10010.06 10070.77 10142.82 1 1 1 1 10239.78 10350.38 10406.84 10441.13 1 1 1 1 10489.06 10692.69 11025.41 11055.21 1 1 1 1 11344.7 11407.43 11568.24 11613.87 1 1 1 1 11758.49 11914.48 11924.24 12247.67 1 1 1 1 12431.05 12624.32 12749.66 12805.95 1 1 1 1 12871.94 13083.54 13201.79 13315.1233333333 1 1 1 1 13327.6533333333 13625.03 13707.5733333333 13804.41 1 1 1 1 13953.02 14167.73 14235.2 14639.78 1 1 1 1 15101.56 15474.53 16068.91 17281.48 1 1 1 1 17338.59 17394.27 17509.51 19226.29 1 1 1 1 20683.24 1 > colnames(x) [1] "endo" "BC" "NNZFG" "MRT" "AFL" "LPM" "LPC" "W" "WPA" > colnames(x)[par1] [1] "endo" > x[,par1] [1] 5123.100 5970.440 10441.130 7707.260 10489.060 12247.670 6713.040 [8] 9370.703 8282.810 8756.093 12624.320 8866.343 6063.610 7018.630 [15] 5517.950 9701.810 9810.060 7446.070 7954.650 6300.700 7142.280 [22] 9202.320 5867.790 4481.130 13707.573 9927.510 8741.737 7095.660 [29] 9186.730 8958.790 5701.560 6940.110 8452.860 13315.123 6301.370 [36] 5614.490 10239.780 7072.100 5381.770 10010.060 4844.830 7982.600 [43] 8956.813 8350.200 13201.790 5350.280 9404.760 6740.520 11055.210 [50] 10406.840 6996.910 6239.870 6184.580 7473.557 11568.240 8569.547 [57] 11914.480 6086.440 12749.660 5384.010 11344.700 7137.820 7297.280 [64] 7294.080 9876.430 8047.740 9801.260 11924.240 13083.540 8829.977 [71] 6959.310 9545.510 8963.523 4868.320 9288.220 8351.320 8579.560 [78] 13804.410 7377.957 7727.837 8735.850 13327.653 17394.270 8975.820 [85] 17338.590 7967.820 11613.870 7894.850 8315.490 15474.530 8821.300 [92] 11025.410 9762.970 12871.940 10142.820 10070.770 16068.910 11407.430 [99] 8652.820 17509.510 7451.380 8114.970 8409.370 9447.650 17281.480 [106] 5679.410 9826.740 11758.490 3928.270 20683.240 6783.190 8665.670 [113] 14167.730 362.340 4380.050 14235.200 5643.240 14639.780 8517.400 [120] 12805.950 5945.520 7642.430 19226.290 13625.030 8005.460 8254.530 [127] 15101.560 13953.020 10692.690 9730.570 12431.050 10350.380 7404.660 > 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/1tacr1335789398.tab") + } + } > m Conditional inference tree with 10 terminal nodes Response: endo Inputs: BC, NNZFG, MRT, AFL, LPM, LPC, W, WPA Number of observations: 133 1) W <= 6182; criterion = 1, statistic = 98.645 2) WPA <= 4213; criterion = 1, statistic = 75.773 3) W <= 3372; criterion = 1, statistic = 55.902 4) WPA <= 2569; criterion = 1, statistic = 18.751 5)* weights = 16 4) WPA > 2569 6)* weights = 13 3) W > 3372 7) W <= 4895; criterion = 0.998, statistic = 13.737 8) WPA <= 2358; criterion = 1, statistic = 25.679 9)* weights = 16 8) WPA > 2358 10)* weights = 17 7) W > 4895 11) WPA <= 2670.5; criterion = 1, statistic = 18.009 12)* weights = 16 11) WPA > 2670.5 13)* weights = 7 2) WPA > 4213 14) W <= 4917; criterion = 1, statistic = 21.725 15)* weights = 12 14) W > 4917 16)* weights = 16 1) W > 6182 17) WPA <= 6712; criterion = 0.964, statistic = 8.051 18)* weights = 13 17) WPA > 6712 19)* weights = 7 > postscript(file="/var/wessaorg/rcomp/tmp/2a0ty1335789398.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/3dxqr1335789398.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 5123.100 4895.273 227.827500 2 5970.440 6635.599 -665.159231 3 10441.130 10182.575 258.555000 4 7707.260 7168.524 538.736250 5 10489.060 14312.997 -3823.936923 6 12247.670 11971.916 275.754375 7 6713.040 6635.599 77.440769 8 9370.703 8617.292 753.411042 9 8282.810 6635.599 1647.210769 10 8756.093 8617.292 138.801042 11 12624.320 11971.916 652.404375 12 8866.343 8617.292 249.051042 13 6063.610 4895.273 1168.337500 14 7018.630 7168.524 -149.893750 15 5517.950 4895.273 622.677500 16 9701.810 9696.341 5.468571 17 9810.060 10182.575 -372.515000 18 7446.070 7168.524 277.546250 19 7954.650 8617.292 -662.642292 20 6300.700 7168.524 -867.823750 21 7142.280 6635.599 506.680769 22 9202.320 8500.402 701.918235 23 5867.790 6635.599 -767.809231 24 4481.130 4895.273 -414.142500 25 13707.573 14312.997 -605.423590 26 9927.510 9696.341 231.168571 27 8741.737 8617.292 124.444375 28 7095.660 7168.524 -72.863750 29 9186.730 8500.402 686.328235 30 8958.790 8500.402 458.388235 31 5701.560 4895.273 806.287500 32 6940.110 7168.524 -228.413750 33 8452.860 8500.402 -47.541765 34 13315.123 14312.997 -997.873590 35 6301.370 6635.599 -334.229231 36 5614.490 4895.273 719.217500 37 10239.780 10182.575 57.205000 38 7072.100 7168.524 -96.423750 39 5381.770 4895.273 486.497500 40 10010.060 10182.575 -172.515000 41 4844.830 4895.273 -50.442500 42 7982.600 8617.292 -634.692292 43 8956.813 8617.292 339.521042 44 8350.200 8500.402 -150.201765 45 13201.790 14312.997 -1111.206923 46 5350.280 4895.273 455.007500 47 9404.760 9696.341 -291.581429 48 6740.520 7168.524 -428.003750 49 11055.210 11971.916 -916.705625 50 10406.840 10182.575 224.265000 51 6996.910 7168.524 -171.613750 52 6239.870 6635.599 -395.729231 53 6184.580 6635.599 -451.019231 54 7473.557 7168.524 305.032917 55 11568.240 10182.575 1385.665000 56 8569.547 8617.292 -47.745625 57 11914.480 11971.916 -57.435625 58 6086.440 6635.599 -549.159231 59 12749.660 11971.916 777.744375 60 5384.010 4895.273 488.737500 61 11344.700 11971.916 -627.215625 62 7137.820 7168.524 -30.703750 63 7297.280 7168.524 128.756250 64 7294.080 6635.599 658.480769 65 9876.430 10182.575 -306.145000 66 8047.740 8617.292 -569.552292 67 9801.260 9696.341 104.918571 68 11924.240 11971.916 -47.675625 69 13083.540 11971.916 1111.624375 70 8829.977 8617.292 212.684375 71 6959.310 7168.524 -209.213750 72 9545.510 9696.341 -150.831429 73 8963.523 8617.292 346.231042 74 4868.320 4895.273 -26.952500 75 9288.220 8500.402 787.818235 76 8351.320 8617.292 -265.972292 77 8579.560 8617.292 -37.732292 78 13804.410 14312.997 -508.586923 79 7377.957 7168.524 209.432917 80 7727.837 7168.524 559.312917 81 8735.850 8617.292 118.557708 82 13327.653 14312.997 -985.343590 83 17394.270 14312.997 3081.273077 84 8975.820 8500.402 475.418235 85 17338.590 14312.997 3025.593077 86 7967.820 8500.402 -532.581765 87 11613.870 11971.916 -358.045625 88 7894.850 8500.402 -605.551765 89 8315.490 8500.402 -184.911765 90 15474.530 16925.113 -1450.582857 91 8821.300 8500.402 320.898235 92 11025.410 11971.916 -946.505625 93 9762.970 9696.341 66.628571 94 12871.940 11971.916 900.024375 95 10142.820 10182.575 -39.755000 96 10070.770 10182.575 -111.805000 97 16068.910 16925.113 -856.202857 98 11407.430 11971.916 -564.485625 99 8652.820 8617.292 35.527708 100 17509.510 14312.997 3196.513077 101 7451.380 6635.599 815.780769 102 8114.970 8500.402 -385.431765 103 8409.370 8500.402 -91.031765 104 9447.650 10182.575 -734.925000 105 17281.480 16925.113 356.367143 106 5679.410 4895.273 784.137500 107 9826.740 10182.575 -355.835000 108 11758.490 11971.916 -213.425625 109 3928.270 4895.273 -967.002500 110 20683.240 16925.113 3758.127143 111 6783.190 6635.599 147.590769 112 8665.670 8500.402 165.268235 113 14167.730 14312.997 -145.266923 114 362.340 4895.273 -4532.932500 115 4380.050 4895.273 -515.222500 116 14235.200 14312.997 -77.796923 117 5643.240 4895.273 747.967500 118 14639.780 16925.113 -2285.332857 119 8517.400 8617.292 -99.892292 120 12805.950 11971.916 834.034375 121 5945.520 6635.599 -690.079231 122 7642.430 8500.402 -857.971765 123 19226.290 16925.113 2301.177143 124 13625.030 14312.997 -687.966923 125 8005.460 8500.402 -494.941765 126 8254.530 8500.402 -245.871765 127 15101.560 16925.113 -1823.552857 128 13953.020 14312.997 -359.976923 129 10692.690 11971.916 -1279.225625 130 9730.570 9696.341 34.228571 131 12431.050 11971.916 459.134375 132 10350.380 10182.575 167.805000 133 7404.660 7168.524 236.136250 > 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/4vt251335789398.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/551s21335789398.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/6s8k61335789398.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/70rtn1335789398.tab") + } > > try(system("convert tmp/2a0ty1335789398.ps tmp/2a0ty1335789398.png",intern=TRUE)) character(0) > try(system("convert tmp/3dxqr1335789398.ps tmp/3dxqr1335789398.png",intern=TRUE)) character(0) > try(system("convert tmp/4vt251335789398.ps tmp/4vt251335789398.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.557 0.295 3.847