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(79 + ,30 + ,112285 + ,0 + ,3 + ,4 + ,58 + ,28 + ,84786 + ,0 + ,NA + ,NA + ,60 + ,38 + ,83123 + ,1 + ,1 + ,2 + ,108 + ,30 + ,101193 + ,NA + ,NA + ,NA + ,49 + ,22 + ,38361 + ,NA + ,NA + ,NA + ,0 + ,26 + ,68504 + ,NA + ,NA + ,NA + ,121 + ,25 + ,119182 + ,0 + ,2 + ,4 + ,1 + ,18 + ,22807 + ,NA + ,NA + ,NA + ,20 + ,11 + ,17140 + ,NA + ,NA + ,NA + ,43 + ,26 + ,116174 + ,0 + ,1 + ,4 + ,69 + ,25 + ,57635 + ,1 + ,2 + ,4 + ,78 + ,38 + ,66198 + ,1 + ,1 + ,5 + ,86 + ,44 + ,71701 + ,NA + ,NA + ,NA + ,44 + ,30 + ,57793 + ,1 + ,2 + ,4 + ,104 + ,40 + ,80444 + ,NA + ,NA + ,NA + ,63 + ,34 + ,53855 + ,NA + ,NA + ,NA + ,158 + ,47 + ,97668 + ,1 + ,1 + ,2 + ,102 + ,30 + ,133824 + ,0 + ,4 + ,2 + ,77 + ,31 + ,101481 + ,1 + ,2 + ,4 + ,82 + ,23 + ,99645 + ,0 + ,NA + ,NA + ,115 + ,36 + ,114789 + ,NA + ,NA + ,NA + ,101 + ,36 + ,99052 + ,0 + ,1 + ,4 + ,80 + ,30 + ,67654 + ,1 + ,1 + ,5 + ,50 + ,25 + ,65553 + ,0 + ,NA + ,NA + ,83 + ,39 + ,97500 + ,NA + ,NA + ,NA + ,123 + ,34 + ,69112 + ,1 + ,1 + ,4 + ,73 + ,31 + ,82753 + ,1 + ,2 + ,4 + ,81 + ,31 + ,85323 + ,0 + ,4 + ,5 + ,105 + ,33 + ,72654 + ,1 + ,2 + ,4 + ,47 + ,25 + ,30727 + ,1 + ,2 + ,4 + ,105 + ,33 + ,77873 + ,NA + ,NA + ,NA + ,94 + ,35 + ,117478 + ,0 + ,3 + ,3 + ,44 + ,42 + ,74007 + ,0 + ,2 + ,3 + ,114 + ,43 + ,90183 + ,NA + ,NA + ,NA + ,38 + ,30 + ,61542 + ,NA + ,NA + ,NA + ,107 + ,33 + ,101494 + ,0 + ,2 + ,5 + ,30 + ,13 + ,27570 + ,NA + ,NA + ,NA + ,71 + ,32 + ,55813 + ,NA + ,NA + ,NA + ,84 + ,36 + ,79215 + ,1 + ,3 + ,4 + ,0 + ,0 + ,1423 + ,1 + ,2 + ,4 + ,59 + ,28 + ,55461 + ,NA + ,NA + ,NA + ,33 + ,14 + ,31081 + ,0 + ,4 + ,2 + ,42 + ,17 + ,22996 + ,0 + ,4 + ,4 + ,96 + ,32 + ,83122 + ,1 + ,0 + ,5 + ,106 + ,30 + ,70106 + ,NA + ,NA + ,NA + ,56 + ,35 + ,60578 + ,0 + ,3 + ,3 + ,57 + ,20 + ,39992 + ,1 + ,1 + ,3 + ,59 + ,28 + ,79892 + ,0 + ,1 + ,4 + ,39 + ,28 + ,49810 + ,1 + ,1 + ,5 + ,34 + ,39 + ,71570 + ,NA + ,NA + ,NA + ,76 + ,34 + ,100708 + ,1 + ,2 + ,4 + ,20 + ,26 + ,33032 + ,NA + ,NA + ,NA + ,91 + ,39 + ,82875 + ,0 + ,3 + ,4 + ,115 + ,39 + ,139077 + ,NA + ,NA + ,NA + ,85 + ,33 + ,71595 + ,NA + ,NA + ,NA + ,76 + ,28 + ,72260 + ,1 + ,NA + ,NA + ,8 + ,4 + ,5950 + ,1 + ,NA + ,NA + ,79 + ,39 + ,115762 + ,1 + ,1 + ,4 + ,21 + ,18 + ,32551 + ,NA + ,NA + ,NA + ,30 + ,14 + ,31701 + ,NA + ,NA + ,NA + ,76 + ,29 + ,80670 + ,1 + ,3 + ,3 + ,101 + ,44 + ,143558 + ,1 + ,1 + ,4 + ,94 + ,21 + ,117105 + ,1 + ,2 + ,3 + ,27 + ,16 + ,23789 + ,0 + ,2 + ,4 + ,92 + ,28 + ,120733 + ,NA + ,NA + ,NA + ,123 + ,35 + ,105195 + ,1 + ,2 + ,4 + ,75 + ,28 + ,73107 + ,NA + ,NA + ,NA + ,128 + ,38 + ,132068 + ,NA + ,NA + ,NA + ,105 + ,23 + ,149193 + ,0 + ,NA + ,NA + ,55 + ,36 + ,46821 + ,NA + ,NA + ,NA + ,56 + ,32 + ,87011 + ,NA + ,NA + ,NA + ,41 + ,29 + ,95260 + ,1 + ,1 + ,4 + ,72 + ,25 + ,55183 + ,1 + ,NA + ,NA + ,67 + ,27 + ,106671 + ,0 + ,1 + ,5 + ,75 + ,36 + ,73511 + ,1 + ,NA + ,NA + ,114 + ,28 + ,92945 + ,0 + ,2 + ,4 + ,118 + ,23 + ,78664 + ,NA + ,NA + ,NA + ,77 + ,40 + ,70054 + ,NA + ,NA + ,NA + ,22 + ,23 + ,22618 + ,1 + ,1 + ,3 + ,66 + ,40 + ,74011 + ,NA + ,NA + ,NA + ,69 + ,28 + ,83737 + ,0 + ,1 + ,2 + ,105 + ,34 + ,69094 + ,0 + ,4 + ,4 + ,116 + ,33 + ,93133 + ,NA + ,NA + ,NA + ,88 + ,28 + ,95536 + ,0 + ,3 + ,4 + ,73 + ,34 + ,225920 + ,1 + ,NA + ,NA + ,99 + ,30 + ,62133 + ,NA + ,NA + ,NA + ,62 + ,33 + ,61370 + ,1 + ,1 + ,4 + ,53 + ,22 + ,43836 + ,NA + ,NA + ,NA + ,118 + ,38 + ,106117 + ,1 + ,3 + ,5 + ,30 + ,26 + ,38692 + ,NA + ,NA + ,NA + ,100 + ,35 + ,84651 + ,1 + ,2 + ,5 + ,49 + ,8 + ,56622 + ,NA + ,NA + ,NA + ,24 + ,24 + ,15986 + ,1 + ,1 + ,2 + ,67 + ,29 + ,95364 + ,0 + ,3 + ,1 + ,46 + ,20 + ,26706 + ,1 + ,3 + ,4 + ,57 + ,29 + ,89691 + ,1 + ,1 + ,4 + ,75 + ,45 + ,67267 + ,NA + ,NA + ,NA + ,135 + ,37 + ,126846 + ,1 + ,3 + ,4 + ,68 + ,33 + ,41140 + ,NA + ,NA + ,NA + ,124 + ,33 + ,102860 + ,0 + ,2 + ,1 + ,33 + ,25 + ,51715 + ,1 + ,1 + ,4 + ,98 + ,32 + ,55801 + ,1 + ,2 + ,4 + ,58 + ,29 + ,111813 + ,1 + ,1 + ,2 + ,68 + ,28 + ,120293 + ,1 + ,2 + ,4 + ,81 + ,28 + ,138599 + ,NA + ,NA + ,NA + ,131 + ,31 + ,161647 + ,1 + ,2 + ,5 + ,110 + ,52 + ,115929 + ,0 + ,1 + ,3 + ,37 + ,21 + ,24266 + ,1 + ,3 + ,4 + ,130 + ,24 + ,162901 + ,0 + ,NA + ,NA + ,93 + ,41 + ,109825 + ,0 + ,3 + ,2 + ,118 + ,33 + ,129838 + ,1 + ,4 + ,5 + ,39 + ,32 + ,37510 + ,0 + ,NA + ,NA + ,13 + ,19 + ,43750 + ,NA + ,NA + ,NA + ,74 + ,20 + ,40652 + ,NA + ,NA + ,NA + ,81 + ,31 + ,87771 + ,1 + ,3 + ,4 + ,109 + ,31 + ,85872 + ,NA + ,NA + ,NA + ,151 + ,32 + ,89275 + ,NA + ,NA + ,NA + ,51 + ,18 + ,44418 + ,1 + ,3 + ,4 + ,28 + ,23 + ,192565 + ,0 + ,2 + ,2 + ,40 + ,17 + ,35232 + ,1 + ,3 + ,3 + ,56 + ,20 + ,40909 + ,1 + ,3 + ,4 + ,27 + ,12 + ,13294 + ,1 + ,1 + ,2 + ,37 + ,17 + ,32387 + ,NA + ,NA + ,NA + ,83 + ,30 + ,140867 + ,1 + ,1 + ,4 + ,54 + ,31 + ,120662 + ,NA + ,NA + ,NA + ,27 + ,10 + ,21233 + ,NA + ,NA + ,NA + ,28 + ,13 + ,44332 + ,0 + ,3 + ,3 + ,59 + ,22 + ,61056 + ,1 + ,3 + ,4 + ,133 + ,42 + ,101338 + ,1 + ,1 + ,4 + ,12 + ,1 + ,1168 + ,1 + ,3 + ,2 + ,0 + ,9 + ,13497 + ,NA + ,NA + ,NA + ,106 + ,32 + ,65567 + ,1 + ,1 + ,4 + ,23 + ,11 + ,25162 + ,NA + ,NA + ,NA + ,44 + ,25 + ,32334 + ,0 + ,4 + ,2 + ,71 + ,36 + ,40735 + ,1 + ,3 + ,5 + ,116 + ,31 + ,91413 + ,0 + ,3 + ,4 + ,4 + ,0 + ,855 + ,1 + ,NA + ,NA + ,62 + ,24 + ,97068 + ,1 + ,NA + ,NA + ,12 + ,13 + ,44339 + ,0 + ,4 + ,3 + ,18 + ,8 + ,14116 + ,0 + ,NA + ,NA + ,14 + ,13 + ,10288 + ,1 + ,3 + ,3 + ,60 + ,19 + ,65622 + ,1 + ,1 + ,4 + ,7 + ,18 + ,16563 + ,NA + ,NA + ,NA + ,98 + ,33 + ,76643 + ,1 + ,3 + ,4 + ,64 + ,40 + ,110681 + ,NA + ,NA + ,NA + ,29 + ,22 + ,29011 + ,NA + ,NA + ,NA + ,32 + ,38 + ,92696 + ,0 + ,1 + ,4 + ,25 + ,24 + ,94785 + ,0 + ,4 + ,3 + ,16 + ,8 + ,8773 + ,NA + ,NA + ,NA + ,48 + ,35 + ,83209 + ,NA + ,NA + ,NA + ,100 + ,43 + ,93815 + ,1 + ,2 + ,4 + ,46 + ,43 + ,86687 + ,NA + ,2 + ,2 + ,45 + ,14 + ,34553 + ,1 + ,1 + ,4 + ,129 + ,41 + ,105547 + ,0 + ,3 + ,4 + ,130 + ,38 + ,103487 + ,NA + ,NA + ,NA + ,136 + ,45 + ,213688 + ,1 + ,4 + ,2 + ,59 + ,31 + ,71220 + ,0 + ,NA + ,NA + ,25 + ,13 + ,23517 + ,NA + ,NA + ,NA + ,32 + ,28 + ,56926 + ,NA + ,NA + ,NA + ,63 + ,31 + ,91721 + ,1 + ,2 + ,2 + ,95 + ,40 + ,115168 + ,NA + ,NA + ,NA + ,14 + ,30 + ,111194 + ,1 + ,NA + ,NA + ,36 + ,16 + ,51009 + ,0 + ,2 + ,4 + ,113 + ,37 + ,135777 + ,0 + ,3 + ,4 + ,47 + ,30 + ,51513 + ,0 + ,2 + ,4 + ,92 + ,35 + ,74163 + ,0 + ,4 + ,3 + ,70 + ,32 + ,51633 + ,NA + ,NA + ,NA + ,19 + ,27 + ,75345 + ,NA + ,NA + ,NA + ,50 + ,20 + ,33416 + ,0 + ,3 + ,2 + ,41 + ,18 + ,83305 + ,1 + ,1 + ,3 + ,91 + ,31 + ,98952 + ,1 + ,NA + ,NA + ,111 + ,31 + ,102372 + ,0 + ,1 + ,1 + ,41 + ,21 + ,37238 + ,1 + ,3 + ,4 + ,120 + ,39 + ,103772 + ,0 + ,1 + ,3 + ,135 + ,41 + ,123969 + ,NA + ,NA + ,NA + ,27 + ,13 + ,27142 + ,NA + ,NA + ,NA + ,87 + ,32 + ,135400 + ,NA + ,NA + ,NA + ,25 + ,18 + ,21399 + ,1 + ,3 + ,4 + ,131 + ,39 + ,130115 + ,0 + ,1 + ,4 + ,45 + ,14 + ,24874 + ,0 + ,1 + ,3 + ,29 + ,7 + ,34988 + ,1 + ,1 + ,5 + ,58 + ,17 + ,45549 + ,0 + ,4 + ,5 + ,4 + ,0 + ,6023 + ,NA + ,NA + ,NA + ,47 + ,30 + ,64466 + ,1 + ,1 + ,4 + ,109 + ,37 + ,54990 + ,1 + ,2 + ,4 + ,7 + ,0 + ,1644 + ,NA + ,NA + ,NA + ,12 + ,5 + ,6179 + ,NA + ,NA + ,NA + ,0 + ,1 + ,3926 + ,NA + ,NA + ,NA + ,37 + ,16 + ,32755 + ,NA + ,NA + ,NA + ,37 + ,32 + ,34777 + ,1 + ,1 + ,2 + ,46 + ,24 + ,73224 + ,NA + ,NA + ,NA + ,15 + ,17 + ,27114 + ,0 + ,2 + ,4 + ,42 + ,11 + ,20760 + ,NA + ,NA + ,NA + ,7 + ,24 + ,37636 + ,0 + ,4 + ,4 + ,54 + ,22 + ,65461 + ,1 + ,2 + ,4 + ,54 + ,12 + ,30080 + ,0 + ,1 + ,4 + ,14 + ,19 + ,24094 + ,1 + ,2 + ,3 + ,16 + ,13 + ,69008 + ,1 + ,2 + ,4 + ,33 + ,17 + ,54968 + ,NA + ,NA + ,NA + ,32 + ,15 + ,46090 + ,1 + ,NA + ,NA + ,21 + ,16 + ,27507 + ,NA + ,NA + ,NA + ,15 + ,24 + ,10672 + ,NA + ,NA + ,NA + ,38 + ,15 + ,34029 + ,0 + ,3 + ,2 + ,22 + ,17 + ,46300 + ,0 + ,2 + ,3 + ,28 + ,18 + ,24760 + ,NA + ,NA + ,NA + ,10 + ,20 + ,18779 + ,NA + ,NA + ,NA + ,31 + ,16 + ,21280 + ,NA + ,NA + ,NA + ,32 + ,16 + ,40662 + ,1 + ,1 + ,4 + ,32 + ,18 + ,28987 + ,1 + ,1 + ,4 + ,43 + ,22 + ,22827 + ,NA + ,NA + ,NA + ,27 + ,8 + ,18513 + ,NA + ,NA + ,NA + ,37 + ,17 + ,30594 + ,0 + ,1 + ,2 + ,20 + ,18 + ,24006 + ,NA + ,NA + ,NA + ,32 + ,16 + ,27913 + ,0 + ,2 + ,4 + ,0 + ,23 + ,42744 + ,0 + ,1 + ,4 + ,5 + ,22 + ,12934 + ,0 + ,4 + ,4 + ,26 + ,13 + ,22574 + ,NA + ,NA + ,NA + ,10 + ,13 + ,41385 + ,1 + ,1 + ,2 + ,27 + ,16 + ,18653 + ,1 + ,NA + ,NA + ,11 + ,16 + ,18472 + ,NA + ,NA + ,NA + ,29 + ,20 + ,30976 + ,1 + ,4 + ,4 + ,25 + ,22 + ,63339 + ,1 + ,1 + ,5 + ,55 + ,17 + ,25568 + ,0 + ,3 + ,3 + ,23 + ,18 + ,33747 + ,NA + ,NA + ,NA + ,5 + ,17 + ,4154 + ,1 + ,NA + ,NA + ,43 + ,12 + ,19474 + ,0 + ,NA + ,NA + ,23 + ,7 + ,35130 + ,NA + ,NA + ,NA + ,34 + ,17 + ,39067 + ,1 + ,2 + ,4 + ,36 + ,14 + ,13310 + ,NA + ,NA + ,NA + ,35 + ,23 + ,65892 + ,1 + ,3 + ,5 + ,0 + ,17 + ,4143 + ,0 + ,2 + ,4 + ,37 + ,14 + ,28579 + ,1 + ,3 + ,4 + ,28 + ,15 + ,51776 + ,NA + ,NA + ,NA + ,16 + ,17 + ,21152 + ,NA + ,NA + ,NA + ,26 + ,21 + ,38084 + ,1 + ,2 + ,4 + ,38 + ,18 + ,27717 + ,1 + ,2 + ,4 + ,23 + ,18 + ,32928 + ,1 + ,1 + ,2 + ,22 + ,17 + ,11342 + ,NA + ,NA + ,NA + ,30 + ,17 + ,19499 + ,1 + ,1 + ,4 + ,16 + ,16 + ,16380 + ,NA + ,NA + ,NA + ,18 + ,15 + ,36874 + ,1 + ,NA + ,NA + ,28 + ,21 + ,48259 + ,1 + ,NA + ,NA + ,32 + ,16 + ,16734 + ,NA + ,NA + ,NA + ,21 + ,14 + ,28207 + ,0 + ,1 + ,2 + ,23 + ,15 + ,30143 + ,NA + ,NA + ,NA + ,29 + ,17 + ,41369 + ,NA + ,NA + ,NA + ,50 + ,15 + ,45833 + ,0 + ,2 + ,4 + ,12 + ,15 + ,29156 + ,1 + ,1 + ,5 + ,21 + ,10 + ,35944 + ,NA + ,NA + ,NA + ,18 + ,6 + ,36278 + ,NA + ,NA + ,NA + ,27 + ,22 + ,45588 + ,1 + ,3 + ,4 + ,41 + ,21 + ,45097 + ,1 + ,3 + ,3 + ,13 + ,1 + ,3895 + ,NA + ,NA + ,NA + ,12 + ,18 + ,28394 + ,0 + ,2 + ,4 + ,21 + ,17 + ,18632 + ,0 + ,3 + ,2 + ,8 + ,4 + ,2325 + ,0 + ,4 + ,4 + ,26 + ,10 + ,25139 + ,1 + ,3 + ,5 + ,27 + ,16 + ,27975 + ,1 + ,NA + ,NA + ,13 + ,16 + ,14483 + ,NA + ,NA + ,NA + ,16 + ,9 + ,13127 + ,NA + ,NA + ,NA + ,2 + ,16 + ,5839 + ,NA + ,NA + ,NA + ,42 + ,17 + ,24069 + ,NA + ,NA + ,NA + ,5 + ,7 + ,3738 + ,NA + ,NA + ,NA + ,37 + ,15 + ,18625 + ,NA + ,3 + ,4 + ,17 + ,14 + ,36341 + ,NA + ,NA + ,NA + ,38 + ,14 + ,24548 + ,NA + ,NA + ,NA + ,37 + ,18 + ,21792 + ,0 + ,2 + ,4 + ,29 + ,12 + ,26263 + ,0 + ,2 + ,2 + ,32 + ,16 + ,23686 + ,0 + ,1 + ,2 + ,35 + ,21 + ,49303 + ,0 + ,NA + ,NA + ,17 + ,19 + ,25659 + ,NA + ,NA + ,NA + ,20 + ,16 + ,28904 + ,NA + ,NA + ,NA + ,7 + ,1 + ,2781 + ,NA + ,NA + ,NA + ,46 + ,16 + ,29236 + ,NA + ,NA + ,NA + ,24 + ,10 + ,19546 + ,NA + ,NA + ,NA + ,40 + ,19 + ,22818 + ,NA + ,NA + ,NA + ,3 + ,12 + ,32689 + ,NA + ,NA + ,NA + ,10 + ,2 + ,5752 + ,1 + ,NA + ,NA + ,37 + ,14 + ,22197 + ,NA + ,NA + ,NA + ,17 + ,17 + ,20055 + ,0 + ,2 + ,4 + ,28 + ,19 + ,25272 + ,NA + ,NA + ,NA + ,19 + ,14 + ,82206 + ,NA + ,NA + ,NA + ,29 + ,11 + ,32073 + ,NA + ,NA + ,NA + ,8 + ,4 + ,5444 + ,NA + ,NA + ,NA + ,10 + ,16 + ,20154 + ,1 + ,2 + ,4 + ,15 + ,20 + ,36944 + ,NA + ,NA + ,NA + ,15 + ,12 + ,8019 + ,NA + ,NA + ,NA + ,28 + ,15 + ,30884 + ,NA + ,NA + ,NA + ,17 + ,16 + ,19540 + ,1 + ,NA + ,NA) + ,dim=c(6 + ,289) + ,dimnames=list(c('blogged_computations' + ,'compendiums_reviewed' + ,'totsize' + ,'Gender' + ,'Restless' + ,'Software') + ,1:289)) > y <- array(NA,dim=c(6,289),dimnames=list(c('blogged_computations','compendiums_reviewed','totsize','Gender','Restless','Software'),1:289)) > 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 = '3' > par2 = 'none' > par1 = '6' > #'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] "Software" > x[,par1] [1] 4 2 4 4 4 5 4 2 2 4 4 5 4 4 5 4 4 3 3 5 4 4 2 4 5 3 3 4 5 4 4 4 3 4 3 4 4 [38] 4 5 4 3 2 4 4 4 5 5 2 1 4 4 4 1 4 4 2 4 5 3 4 2 5 4 4 2 3 4 2 4 3 4 4 2 4 [75] 2 5 4 3 3 4 4 4 3 4 2 4 4 2 2 4 4 4 3 2 3 1 4 3 4 4 3 5 5 4 4 2 4 4 4 4 3 [112] 4 2 3 4 4 2 4 4 4 2 4 5 3 4 5 4 4 4 4 2 4 2 4 5 4 3 4 2 4 5 4 4 2 2 4 4 > 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]) 1 2 3 4 5 3 25 21 80 18 > colnames(x) [1] "blogged_computations" "compendiums_reviewed" "totsize" [4] "Gender" "Restless" "Software" > colnames(x)[par1] [1] "Software" > x[,par1] [1] 4 2 4 4 4 5 4 2 2 4 4 5 4 4 5 4 4 3 3 5 4 4 2 4 5 3 3 4 5 4 4 4 3 4 3 4 4 [38] 4 5 4 3 2 4 4 4 5 5 2 1 4 4 4 1 4 4 2 4 5 3 4 2 5 4 4 2 3 4 2 4 3 4 4 2 4 [75] 2 5 4 3 3 4 4 4 3 4 2 4 4 2 2 4 4 4 3 2 3 1 4 3 4 4 3 5 5 4 4 2 4 4 4 4 3 [112] 4 2 3 4 4 2 4 4 4 2 4 5 3 4 5 4 4 4 4 2 4 2 4 5 4 3 4 2 4 5 4 4 2 2 4 4 > 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/1me631323978788.tab") + } + } > m Conditional inference tree with 2 terminal nodes Response: Software Inputs: blogged_computations, compendiums_reviewed, totsize, Gender, Restless Number of observations: 147 1) Gender <= 0; criterion = 0.986, statistic = 8.899 2)* weights = 62 1) Gender > 0 3)* weights = 85 > postscript(file="/var/wessaorg/rcomp/tmp/2mj4l1323978788.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/3btvw1323978788.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 4 3.306452 0.6935484 2 2 3.776471 -1.7764706 3 4 3.306452 0.6935484 4 4 3.306452 0.6935484 5 4 3.776471 0.2235294 6 5 3.776471 1.2235294 7 4 3.776471 0.2235294 8 2 3.776471 -1.7764706 9 2 3.306452 -1.3064516 10 4 3.776471 0.2235294 11 4 3.306452 0.6935484 12 5 3.776471 1.2235294 13 4 3.776471 0.2235294 14 4 3.776471 0.2235294 15 5 3.306452 1.6935484 16 4 3.776471 0.2235294 17 4 3.776471 0.2235294 18 3 3.306452 -0.3064516 19 3 3.306452 -0.3064516 20 5 3.306452 1.6935484 21 4 3.776471 0.2235294 22 4 3.776471 0.2235294 23 2 3.306452 -1.3064516 24 4 3.306452 0.6935484 25 5 3.776471 1.2235294 26 3 3.306452 -0.3064516 27 3 3.776471 -0.7764706 28 4 3.306452 0.6935484 29 5 3.776471 1.2235294 30 4 3.776471 0.2235294 31 4 3.306452 0.6935484 32 4 3.776471 0.2235294 33 3 3.776471 -0.7764706 34 4 3.776471 0.2235294 35 3 3.776471 -0.7764706 36 4 3.306452 0.6935484 37 4 3.776471 0.2235294 38 4 3.776471 0.2235294 39 5 3.306452 1.6935484 40 4 3.306452 0.6935484 41 3 3.776471 -0.7764706 42 2 3.306452 -1.3064516 43 4 3.306452 0.6935484 44 4 3.306452 0.6935484 45 4 3.776471 0.2235294 46 5 3.776471 1.2235294 47 5 3.776471 1.2235294 48 2 3.776471 -1.7764706 49 1 3.306452 -2.3064516 50 4 3.776471 0.2235294 51 4 3.776471 0.2235294 52 4 3.776471 0.2235294 53 1 3.306452 -2.3064516 54 4 3.776471 0.2235294 55 4 3.776471 0.2235294 56 2 3.776471 -1.7764706 57 4 3.776471 0.2235294 58 5 3.776471 1.2235294 59 3 3.306452 -0.3064516 60 4 3.776471 0.2235294 61 2 3.306452 -1.3064516 62 5 3.776471 1.2235294 63 4 3.776471 0.2235294 64 4 3.776471 0.2235294 65 2 3.306452 -1.3064516 66 3 3.776471 -0.7764706 67 4 3.776471 0.2235294 68 2 3.776471 -1.7764706 69 4 3.776471 0.2235294 70 3 3.306452 -0.3064516 71 4 3.776471 0.2235294 72 4 3.776471 0.2235294 73 2 3.776471 -1.7764706 74 4 3.776471 0.2235294 75 2 3.306452 -1.3064516 76 5 3.776471 1.2235294 77 4 3.306452 0.6935484 78 3 3.306452 -0.3064516 79 3 3.776471 -0.7764706 80 4 3.776471 0.2235294 81 4 3.776471 0.2235294 82 4 3.306452 0.6935484 83 3 3.306452 -0.3064516 84 4 3.776471 0.2235294 85 2 3.776471 -1.7764706 86 4 3.776471 0.2235294 87 4 3.306452 0.6935484 88 2 3.776471 -1.7764706 89 2 3.776471 -1.7764706 90 4 3.306452 0.6935484 91 4 3.306452 0.6935484 92 4 3.306452 0.6935484 93 3 3.306452 -0.3064516 94 2 3.306452 -1.3064516 95 3 3.776471 -0.7764706 96 1 3.306452 -2.3064516 97 4 3.776471 0.2235294 98 3 3.306452 -0.3064516 99 4 3.776471 0.2235294 100 4 3.306452 0.6935484 101 3 3.306452 -0.3064516 102 5 3.776471 1.2235294 103 5 3.306452 1.6935484 104 4 3.776471 0.2235294 105 4 3.776471 0.2235294 106 2 3.776471 -1.7764706 107 4 3.306452 0.6935484 108 4 3.306452 0.6935484 109 4 3.776471 0.2235294 110 4 3.306452 0.6935484 111 3 3.776471 -0.7764706 112 4 3.776471 0.2235294 113 2 3.306452 -1.3064516 114 3 3.306452 -0.3064516 115 4 3.776471 0.2235294 116 4 3.776471 0.2235294 117 2 3.306452 -1.3064516 118 4 3.306452 0.6935484 119 4 3.306452 0.6935484 120 4 3.306452 0.6935484 121 2 3.776471 -1.7764706 122 4 3.776471 0.2235294 123 5 3.776471 1.2235294 124 3 3.306452 -0.3064516 125 4 3.776471 0.2235294 126 5 3.776471 1.2235294 127 4 3.306452 0.6935484 128 4 3.776471 0.2235294 129 4 3.776471 0.2235294 130 4 3.776471 0.2235294 131 2 3.776471 -1.7764706 132 4 3.776471 0.2235294 133 2 3.306452 -1.3064516 134 4 3.306452 0.6935484 135 5 3.776471 1.2235294 136 4 3.776471 0.2235294 137 3 3.776471 -0.7764706 138 4 3.306452 0.6935484 139 2 3.306452 -1.3064516 140 4 3.306452 0.6935484 141 5 3.776471 1.2235294 142 4 3.776471 0.2235294 143 4 3.306452 0.6935484 144 2 3.306452 -1.3064516 145 2 3.306452 -1.3064516 146 4 3.306452 0.6935484 147 4 3.776471 0.2235294 > 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/4p4mt1323978788.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/5uiva1323978788.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/6ohrg1323978788.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/7fa5o1323978788.tab") + } > > try(system("convert tmp/2mj4l1323978788.ps tmp/2mj4l1323978788.png",intern=TRUE)) character(0) > try(system("convert tmp/3btvw1323978788.ps tmp/3btvw1323978788.png",intern=TRUE)) character(0) > try(system("convert tmp/4p4mt1323978788.ps tmp/4p4mt1323978788.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.524 0.297 3.817