R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(94 + ,30 + ,112285 + ,79 + ,146283 + ,103 + ,28 + ,84786 + ,58 + ,98364 + ,93 + ,38 + ,83123 + ,60 + ,86146 + ,103 + ,30 + ,101193 + ,108 + ,96933 + ,51 + ,22 + ,38361 + ,49 + ,79234 + ,70 + ,26 + ,68504 + ,0 + ,42551 + ,91 + ,25 + ,119182 + ,121 + ,195663 + ,22 + ,18 + ,22807 + ,1 + ,6853 + ,38 + ,11 + ,17140 + ,20 + ,21529 + ,93 + ,26 + ,116174 + ,43 + ,95757 + ,60 + ,25 + ,57635 + ,69 + ,85584 + ,123 + ,38 + ,66198 + ,78 + ,143983 + ,148 + ,44 + ,71701 + ,86 + ,75851 + ,90 + ,30 + ,57793 + ,44 + ,59238 + ,124 + ,40 + ,80444 + ,104 + ,93163 + ,70 + ,34 + ,53855 + ,63 + ,96037 + ,168 + ,47 + ,97668 + ,158 + ,151511 + ,115 + ,30 + ,133824 + ,102 + ,136368 + ,71 + ,31 + ,101481 + ,77 + ,112642 + ,66 + ,23 + ,99645 + ,82 + ,94728 + ,134 + ,36 + ,114789 + ,115 + ,105499 + ,117 + ,36 + ,99052 + ,101 + ,121527 + ,108 + ,30 + ,67654 + ,80 + ,127766 + ,84 + ,25 + ,65553 + ,50 + ,98958 + ,156 + ,39 + ,97500 + ,83 + ,77900 + ,120 + ,34 + ,69112 + ,123 + ,85646 + ,114 + ,31 + ,82753 + ,73 + ,98579 + ,94 + ,31 + ,85323 + ,81 + ,130767 + ,120 + ,33 + ,72654 + ,105 + ,131741 + ,81 + ,25 + ,30727 + ,47 + ,53907 + ,110 + ,33 + ,77873 + ,105 + ,178812 + ,133 + ,35 + ,117478 + ,94 + ,146761 + ,122 + ,42 + ,74007 + ,44 + ,82036 + ,158 + ,43 + ,90183 + ,114 + ,163253 + ,109 + ,30 + ,61542 + ,38 + ,27032 + ,124 + ,33 + ,101494 + ,107 + ,171975 + ,39 + ,13 + ,27570 + ,30 + ,65990 + ,92 + ,32 + ,55813 + ,71 + ,86572 + ,126 + ,36 + ,79215 + ,84 + ,159676 + ,0 + ,0 + ,1423 + ,0 + ,1929 + ,70 + ,28 + ,55461 + ,59 + ,85371 + ,37 + ,14 + ,31081 + ,33 + ,58391 + ,38 + ,17 + ,22996 + ,42 + ,31580 + ,120 + ,32 + ,83122 + ,96 + ,136815 + ,93 + ,30 + ,70106 + ,106 + ,120642 + ,95 + ,35 + ,60578 + ,56 + ,69107 + ,77 + ,20 + ,39992 + ,57 + ,50495 + ,90 + ,28 + ,79892 + ,59 + ,108016 + ,80 + ,28 + ,49810 + ,39 + ,46341 + ,31 + ,39 + ,71570 + ,34 + ,78348 + ,110 + ,34 + ,100708 + ,76 + ,79336 + ,66 + ,26 + ,33032 + ,20 + ,56968 + ,138 + ,39 + ,82875 + ,91 + ,93176 + ,133 + ,39 + ,139077 + ,115 + ,161632 + ,113 + ,33 + ,71595 + ,85 + ,87850 + ,100 + ,28 + ,72260 + ,76 + ,127969 + ,7 + ,4 + ,5950 + ,8 + ,15049 + ,140 + ,39 + ,115762 + ,79 + ,155135 + ,61 + ,18 + ,32551 + ,21 + ,25109 + ,41 + ,14 + ,31701 + ,30 + ,45824 + ,96 + ,29 + ,80670 + ,76 + ,102996 + ,164 + ,44 + ,143558 + ,101 + ,160604 + ,78 + ,21 + ,117105 + ,94 + ,158051 + ,49 + ,16 + ,23789 + ,27 + ,44547 + ,102 + ,28 + ,120733 + ,92 + ,162647 + ,124 + ,35 + ,105195 + ,123 + ,174141 + ,99 + ,28 + ,73107 + ,75 + ,60622 + ,129 + ,38 + ,132068 + ,128 + ,179566 + ,62 + ,23 + ,149193 + ,105 + ,184301 + ,73 + ,36 + ,46821 + ,55 + ,75661 + ,114 + ,32 + ,87011 + ,56 + ,96144 + ,99 + ,29 + ,95260 + ,41 + ,129847 + ,70 + ,25 + ,55183 + ,72 + ,117286 + ,104 + ,27 + ,106671 + ,67 + ,71180 + ,116 + ,36 + ,73511 + ,75 + ,109377 + ,91 + ,28 + ,92945 + ,114 + ,85298 + ,74 + ,23 + ,78664 + ,118 + ,73631 + ,138 + ,40 + ,70054 + ,77 + ,86767 + ,67 + ,23 + ,22618 + ,22 + ,23824 + ,151 + ,40 + ,74011 + ,66 + ,93487 + ,72 + ,28 + ,83737 + ,69 + ,82981 + ,120 + ,34 + ,69094 + ,105 + ,73815 + ,115 + ,33 + ,93133 + ,116 + ,94552 + ,105 + ,28 + ,95536 + ,88 + ,132190 + ,104 + ,34 + ,225920 + ,73 + ,128754 + ,108 + ,30 + ,62133 + ,99 + ,66363 + ,98 + ,33 + ,61370 + ,62 + ,67808 + ,69 + ,22 + ,43836 + ,53 + ,61724 + ,111 + ,38 + ,106117 + ,118 + ,131722 + ,99 + ,26 + ,38692 + ,30 + ,68580 + ,71 + ,35 + ,84651 + ,100 + ,106175 + ,27 + ,8 + ,56622 + ,49 + ,55792 + ,69 + ,24 + ,15986 + ,24 + ,25157 + ,107 + ,29 + ,95364 + ,67 + ,76669 + ,73 + ,20 + ,26706 + ,46 + ,57283 + ,107 + ,29 + ,89691 + ,57 + ,105805 + ,93 + ,45 + ,67267 + ,75 + ,129484 + ,129 + ,37 + ,126846 + ,135 + ,72413 + ,69 + ,33 + ,41140 + ,68 + ,87831 + ,118 + ,33 + ,102860 + ,124 + ,96971 + ,73 + ,25 + ,51715 + ,33 + ,71299 + ,119 + ,32 + ,55801 + ,98 + ,77494 + ,104 + ,29 + ,111813 + ,58 + ,120336 + ,107 + ,28 + ,120293 + ,68 + ,93913 + ,99 + ,28 + ,138599 + ,81 + ,136048 + ,90 + ,31 + ,161647 + ,131 + ,181248 + ,197 + ,52 + ,115929 + ,110 + ,146123 + ,36 + ,21 + ,24266 + ,37 + ,32036 + ,85 + ,24 + ,162901 + ,130 + ,186646 + ,139 + ,41 + ,109825 + ,93 + ,102255 + ,106 + ,33 + ,129838 + ,118 + ,168237 + ,50 + ,32 + ,37510 + ,39 + ,64219 + ,64 + ,19 + ,43750 + ,13 + ,19630 + ,31 + ,20 + ,40652 + ,74 + ,76825 + ,63 + ,31 + ,87771 + ,81 + ,115338 + ,92 + ,31 + ,85872 + ,109 + ,109427 + ,106 + ,32 + ,89275 + ,151 + ,118168 + ,63 + ,18 + ,44418 + ,51 + ,84845 + ,69 + ,23 + ,192565 + ,28 + ,153197 + ,41 + ,17 + ,35232 + ,40 + ,29877 + ,56 + ,20 + ,40909 + ,56 + ,63506 + ,25 + ,12 + ,13294 + ,27 + ,22445 + ,65 + ,17 + ,32387 + ,37 + ,47695 + ,93 + ,30 + ,140867 + ,83 + ,68370 + ,114 + ,31 + ,120662 + ,54 + ,146304 + ,38 + ,10 + ,21233 + ,27 + ,38233 + ,44 + ,13 + ,44332 + ,28 + ,42071 + ,87 + ,22 + ,61056 + ,59 + ,50517 + ,110 + ,42 + ,101338 + ,133 + ,103950 + ,0 + ,1 + ,1168 + ,12 + ,5841 + ,27 + ,9 + ,13497 + ,0 + ,2341 + ,83 + ,32 + ,65567 + ,106 + ,84396 + ,30 + ,11 + ,25162 + ,23 + ,24610 + ,80 + ,25 + ,32334 + ,44 + ,35753 + ,98 + ,36 + ,40735 + ,71 + ,55515 + ,82 + ,31 + ,91413 + ,116 + ,209056 + ,0 + ,0 + ,855 + ,4 + ,6622 + ,60 + ,24 + ,97068 + ,62 + ,115814 + ,28 + ,13 + ,44339 + ,12 + ,11609 + ,9 + ,8 + ,14116 + ,18 + ,13155 + ,33 + ,13 + ,10288 + ,14 + ,18274 + ,59 + ,19 + ,65622 + ,60 + ,72875 + ,49 + ,18 + ,16563 + ,7 + ,10112 + ,115 + ,33 + ,76643 + ,98 + ,142775 + ,140 + ,40 + ,110681 + ,64 + ,68847 + ,49 + ,22 + ,29011 + ,29 + ,17659 + ,120 + ,38 + ,92696 + ,32 + ,20112 + ,66 + ,24 + ,94785 + ,25 + ,61023 + ,21 + ,8 + ,8773 + ,16 + ,13983 + ,124 + ,35 + ,83209 + ,48 + ,65176 + ,152 + ,43 + ,93815 + ,100 + ,132432 + ,139 + ,43 + ,86687 + ,46 + ,112494 + ,38 + ,14 + ,34553 + ,45 + ,45109 + ,144 + ,41 + ,105547 + ,129 + ,170875 + ,120 + ,38 + ,103487 + ,130 + ,180759 + ,160 + ,45 + ,213688 + ,136 + ,214921 + ,114 + ,31 + ,71220 + ,59 + ,100226 + ,39 + ,13 + ,23517 + ,25 + ,32043 + ,78 + ,28 + ,56926 + ,32 + ,54454 + ,119 + ,31 + ,91721 + ,63 + ,78876 + ,141 + ,40 + ,115168 + ,95 + ,170745 + ,101 + ,30 + ,111194 + ,14 + ,6940 + ,56 + ,16 + ,51009 + ,36 + ,49025 + ,133 + ,37 + ,135777 + ,113 + ,122037 + ,83 + ,30 + ,51513 + ,47 + ,53782 + ,116 + ,35 + ,74163 + ,92 + ,127748 + ,90 + ,32 + ,51633 + ,70 + ,86839 + ,36 + ,27 + ,75345 + ,19 + ,44830 + ,50 + ,20 + ,33416 + ,50 + ,77395 + ,61 + ,18 + ,83305 + ,41 + ,89324 + ,97 + ,31 + ,98952 + ,91 + ,103300 + ,98 + ,31 + ,102372 + ,111 + ,112283 + ,78 + ,21 + ,37238 + ,41 + ,10901 + ,117 + ,39 + ,103772 + ,120 + ,120691 + ,148 + ,41 + ,123969 + ,135 + ,58106 + ,41 + ,13 + ,27142 + ,27 + ,57140 + ,105 + ,32 + ,135400 + ,87 + ,122422 + ,55 + ,18 + ,21399 + ,25 + ,25899 + ,132 + ,39 + ,130115 + ,131 + ,139296 + ,44 + ,14 + ,24874 + ,45 + ,52678 + ,21 + ,7 + ,34988 + ,29 + ,23853 + ,50 + ,17 + ,45549 + ,58 + ,17306 + ,0 + ,0 + ,6023 + ,4 + ,7953 + ,73 + ,30 + ,64466 + ,47 + ,89455 + ,86 + ,37 + ,54990 + ,109 + ,147866 + ,0 + ,0 + ,1644 + ,7 + ,4245 + ,13 + ,5 + ,6179 + ,12 + ,21509 + ,4 + ,1 + ,3926 + ,0 + ,7670 + ,57 + ,16 + ,32755 + ,37 + ,66675 + ,48 + ,32 + ,34777 + ,37 + ,14336 + ,46 + ,24 + ,73224 + ,46 + ,53608 + ,48 + ,17 + ,27114 + ,15 + ,30059 + ,32 + ,11 + ,20760 + ,42 + ,29668 + ,68 + ,24 + ,37636 + ,7 + ,22097 + ,87 + ,22 + ,65461 + ,54 + ,96841 + ,43 + ,12 + ,30080 + ,54 + ,41907 + ,67 + ,19 + ,24094 + ,14 + ,27080 + ,46 + ,13 + ,69008 + ,16 + ,35885 + ,46 + ,17 + ,54968 + ,33 + ,41247 + ,56 + ,15 + ,46090 + ,32 + ,28313 + ,48 + ,16 + ,27507 + ,21 + ,36845 + ,44 + ,24 + ,10672 + ,15 + ,16548 + ,60 + ,15 + ,34029 + ,38 + ,36134 + ,65 + ,17 + ,46300 + ,22 + ,55764 + ,55 + ,18 + ,24760 + ,28 + ,28910 + ,38 + ,20 + ,18779 + ,10 + ,13339 + ,52 + ,16 + ,21280 + ,31 + ,25319 + ,60 + ,16 + ,40662 + ,32 + ,66956 + ,54 + ,18 + ,28987 + ,32 + ,47487 + ,86 + ,22 + ,22827 + ,43 + ,52785 + ,24 + ,8 + ,18513 + ,27 + ,44683 + ,52 + ,17 + ,30594 + ,37 + ,35619 + ,49 + ,18 + ,24006 + ,20 + ,21920 + ,61 + ,16 + ,27913 + ,32 + ,45608 + ,61 + ,23 + ,42744 + ,0 + ,7721 + ,81 + ,22 + ,12934 + ,5 + ,20634 + ,43 + ,13 + ,22574 + ,26 + ,29788 + ,40 + ,13 + ,41385 + ,10 + ,31931 + ,40 + ,16 + ,18653 + ,27 + ,37754 + ,56 + ,16 + ,18472 + ,11 + ,32505 + ,68 + ,20 + ,30976 + ,29 + ,40557 + ,79 + ,22 + ,63339 + ,25 + ,94238 + ,47 + ,17 + ,25568 + ,55 + ,44197 + ,57 + ,18 + ,33747 + ,23 + ,43228 + ,41 + ,17 + ,4154 + ,5 + ,4103 + ,29 + ,12 + ,19474 + ,43 + ,44144 + ,3 + ,7 + ,35130 + ,23 + ,32868 + ,60 + ,17 + ,39067 + ,34 + ,27640 + ,30 + ,14 + ,13310 + ,36 + ,14063 + ,79 + ,23 + ,65892 + ,35 + ,28990 + ,47 + ,17 + ,4143 + ,0 + ,4694 + ,40 + ,14 + ,28579 + ,37 + ,42648 + ,48 + ,15 + ,51776 + ,28 + ,64329 + ,36 + ,17 + ,21152 + ,16 + ,21928 + ,42 + ,21 + ,38084 + ,26 + ,25836 + ,49 + ,18 + ,27717 + ,38 + ,22779 + ,57 + ,18 + ,32928 + ,23 + ,40820 + ,12 + ,17 + ,11342 + ,22 + ,27530 + ,40 + ,17 + ,19499 + ,30 + ,32378 + ,43 + ,16 + ,16380 + ,16 + ,10824 + ,33 + ,15 + ,36874 + ,18 + ,39613 + ,77 + ,21 + ,48259 + ,28 + ,60865 + ,43 + ,16 + ,16734 + ,32 + ,19787 + ,45 + ,14 + ,28207 + ,21 + ,20107 + ,47 + ,15 + ,30143 + ,23 + ,36605 + ,43 + ,17 + ,41369 + ,29 + ,40961 + ,45 + ,15 + ,45833 + ,50 + ,48231 + ,50 + ,15 + ,29156 + ,12 + ,39725 + ,35 + ,10 + ,35944 + ,21 + ,21455 + ,7 + ,6 + ,36278 + ,18 + ,23430 + ,71 + ,22 + ,45588 + ,27 + ,62991 + ,67 + ,21 + ,45097 + ,41 + ,49363 + ,0 + ,1 + ,3895 + ,13 + ,9604 + ,62 + ,18 + ,28394 + ,12 + ,24552 + ,54 + ,17 + ,18632 + ,21 + ,31493 + ,4 + ,4 + ,2325 + ,8 + ,3439 + ,25 + ,10 + ,25139 + ,26 + ,19555 + ,40 + ,16 + ,27975 + ,27 + ,21228 + ,38 + ,16 + ,14483 + ,13 + ,23177 + ,19 + ,9 + ,13127 + ,16 + ,22094 + ,17 + ,16 + ,5839 + ,2 + ,2342 + ,67 + ,17 + ,24069 + ,42 + ,38798 + ,14 + ,7 + ,3738 + ,5 + ,3255 + ,30 + ,15 + ,18625 + ,37 + ,24261 + ,54 + ,14 + ,36341 + ,17 + ,18511 + ,35 + ,14 + ,24548 + ,38 + ,40798 + ,59 + ,18 + ,21792 + ,37 + ,28893 + ,24 + ,12 + ,26263 + ,29 + ,21425 + ,58 + ,16 + ,23686 + ,32 + ,50276 + ,42 + ,21 + ,49303 + ,35 + ,37643 + ,46 + ,19 + ,25659 + ,17 + ,30377 + ,61 + ,16 + ,28904 + ,20 + ,27126 + ,3 + ,1 + ,2781 + ,7 + ,13 + ,52 + ,16 + ,29236 + ,46 + ,42097 + ,25 + ,10 + ,19546 + ,24 + ,24451 + ,40 + ,19 + ,22818 + ,40 + ,14335 + ,32 + ,12 + ,32689 + ,3 + ,5084 + ,4 + ,2 + ,5752 + ,10 + ,9927 + ,49 + ,14 + ,22197 + ,37 + ,43527 + ,63 + ,17 + ,20055 + ,17 + ,27184 + ,67 + ,19 + ,25272 + ,28 + ,21610 + ,32 + ,14 + ,82206 + ,19 + ,20484 + ,23 + ,11 + ,32073 + ,29 + ,20156 + ,7 + ,4 + ,5444 + ,8 + ,6012 + ,54 + ,16 + ,20154 + ,10 + ,18475 + ,37 + ,20 + ,36944 + ,15 + ,12645 + ,35 + ,12 + ,8019 + ,15 + ,11017 + ,51 + ,15 + ,30884 + ,28 + ,37623 + ,39 + ,16 + ,19540 + ,17 + ,35873) + ,dim=c(5 + ,289) + ,dimnames=list(c('Feedbackmessagesp120' + ,'compendiumsreviewed' + ,'totsize' + ,'bloggedcomputations' + ,'totseconds') + ,1:289)) > y <- array(NA,dim=c(5,289),dimnames=list(c('Feedbackmessagesp120','compendiumsreviewed','totsize','bloggedcomputations','totseconds'),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 = '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] "Feedbackmessagesp120" > x[,par1] [1] 94 103 93 103 51 70 91 22 38 93 60 123 148 90 124 70 168 115 [19] 71 66 134 117 108 84 156 120 114 94 120 81 110 133 122 158 109 124 [37] 39 92 126 0 70 37 38 120 93 95 77 90 80 31 110 66 138 133 [55] 113 100 7 140 61 41 96 164 78 49 102 124 99 129 62 73 114 99 [73] 70 104 116 91 74 138 67 151 72 120 115 105 104 108 98 69 111 99 [91] 71 27 69 107 73 107 93 129 69 118 73 119 104 107 99 90 197 36 [109] 85 139 106 50 64 31 63 92 106 63 69 41 56 25 65 93 114 38 [127] 44 87 110 0 27 83 30 80 98 82 0 60 28 9 33 59 49 115 [145] 140 49 120 66 21 124 152 139 38 144 120 160 114 39 78 119 141 101 [163] 56 133 83 116 90 36 50 61 97 98 78 117 148 41 105 55 132 44 [181] 21 50 0 73 86 0 13 4 57 48 46 48 32 68 87 43 67 46 [199] 46 56 48 44 60 65 55 38 52 60 54 86 24 52 49 61 61 81 [217] 43 40 40 56 68 79 47 57 41 29 3 60 30 79 47 40 48 36 [235] 42 49 57 12 40 43 33 77 43 45 47 43 45 50 35 7 71 67 [253] 0 62 54 4 25 40 38 19 17 67 14 30 54 35 59 24 58 42 [271] 46 61 3 52 25 40 32 4 49 63 67 32 23 7 54 37 35 51 [289] 39 > 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 3 4 7 9 12 13 14 17 19 21 22 23 24 25 27 28 29 30 31 6 2 3 3 1 1 1 1 1 1 2 1 1 2 3 2 1 1 3 2 32 33 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 3 2 3 3 2 6 3 6 4 2 5 3 2 4 3 4 6 4 2 3 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 4 2 4 3 1 2 5 5 2 3 1 2 3 5 2 4 4 3 1 4 74 77 78 79 80 81 82 83 84 85 86 87 90 91 92 93 94 95 96 97 1 2 3 2 2 2 1 2 1 1 2 2 4 2 2 5 2 1 1 1 98 99 100 101 102 103 104 105 106 107 108 109 110 111 113 114 115 116 117 118 3 4 1 1 1 2 3 2 2 3 2 1 3 1 1 4 3 2 2 1 119 120 122 123 124 126 129 132 133 134 138 139 140 141 144 148 151 152 156 158 2 6 1 1 4 1 2 1 3 1 2 2 2 1 1 2 1 1 1 1 160 164 168 197 1 1 1 1 > colnames(x) [1] "Feedbackmessagesp120" "compendiumsreviewed" "totsize" [4] "bloggedcomputations" "totseconds" > colnames(x)[par1] [1] "Feedbackmessagesp120" > x[,par1] [1] 94 103 93 103 51 70 91 22 38 93 60 123 148 90 124 70 168 115 [19] 71 66 134 117 108 84 156 120 114 94 120 81 110 133 122 158 109 124 [37] 39 92 126 0 70 37 38 120 93 95 77 90 80 31 110 66 138 133 [55] 113 100 7 140 61 41 96 164 78 49 102 124 99 129 62 73 114 99 [73] 70 104 116 91 74 138 67 151 72 120 115 105 104 108 98 69 111 99 [91] 71 27 69 107 73 107 93 129 69 118 73 119 104 107 99 90 197 36 [109] 85 139 106 50 64 31 63 92 106 63 69 41 56 25 65 93 114 38 [127] 44 87 110 0 27 83 30 80 98 82 0 60 28 9 33 59 49 115 [145] 140 49 120 66 21 124 152 139 38 144 120 160 114 39 78 119 141 101 [163] 56 133 83 116 90 36 50 61 97 98 78 117 148 41 105 55 132 44 [181] 21 50 0 73 86 0 13 4 57 48 46 48 32 68 87 43 67 46 [199] 46 56 48 44 60 65 55 38 52 60 54 86 24 52 49 61 61 81 [217] 43 40 40 56 68 79 47 57 41 29 3 60 30 79 47 40 48 36 [235] 42 49 57 12 40 43 33 77 43 45 47 43 45 50 35 7 71 67 [253] 0 62 54 4 25 40 38 19 17 67 14 30 54 35 59 24 58 42 [271] 46 61 3 52 25 40 32 4 49 63 67 32 23 7 54 37 35 51 [289] 39 > if (par2 == 'none') { + m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x) + } > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/161or1324677279.tab") + } + } > m Conditional inference tree with 13 terminal nodes Response: Feedbackmessagesp120 Inputs: compendiumsreviewed, totsize, bloggedcomputations, totseconds Number of observations: 289 1) compendiumsreviewed <= 24; criterion = 1, statistic = 242.787 2) compendiumsreviewed <= 12; criterion = 1, statistic = 115.984 3) compendiumsreviewed <= 7; criterion = 1, statistic = 29.442 4)* weights = 17 3) compendiumsreviewed > 7 5)* weights = 20 2) compendiumsreviewed > 12 6) compendiumsreviewed <= 20; criterion = 1, statistic = 43.007 7) compendiumsreviewed <= 14; criterion = 1, statistic = 15.577 8)* weights = 20 7) compendiumsreviewed > 14 9) totseconds <= 14335; criterion = 0.994, statistic = 10.084 10)* weights = 9 9) totseconds > 14335 11) compendiumsreviewed <= 17; criterion = 0.986, statistic = 8.474 12)* weights = 43 11) compendiumsreviewed > 17 13)* weights = 23 6) compendiumsreviewed > 20 14)* weights = 30 1) compendiumsreviewed > 24 15) compendiumsreviewed <= 38; criterion = 1, statistic = 61.665 16) compendiumsreviewed <= 32; criterion = 1, statistic = 25.302 17) totsize <= 55461; criterion = 0.998, statistic = 11.955 18)* weights = 12 17) totsize > 55461 19) compendiumsreviewed <= 27; criterion = 0.979, statistic = 7.744 20)* weights = 7 19) compendiumsreviewed > 27 21)* weights = 46 16) compendiumsreviewed > 32 22) bloggedcomputations <= 73; criterion = 0.964, statistic = 6.783 23)* weights = 10 22) bloggedcomputations > 73 24)* weights = 26 15) compendiumsreviewed > 38 25)* weights = 26 > postscript(file="/var/www/rcomp/tmp/2binu1324677279.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/www/rcomp/tmp/3cagr1324677279.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 94 98.543478 -4.54347826 2 103 98.543478 4.45652174 3 93 94.400000 -1.40000000 4 103 98.543478 4.45652174 5 51 66.533333 -15.53333333 6 70 76.857143 -6.85714286 7 91 76.857143 14.14285714 8 22 37.111111 -15.11111111 9 38 28.050000 9.95000000 10 93 76.857143 16.14285714 11 60 76.857143 -16.85714286 12 123 116.884615 6.11538462 13 148 137.807692 10.19230769 14 90 98.543478 -8.54347826 15 124 137.807692 -13.80769231 16 70 94.400000 -24.40000000 17 168 137.807692 30.19230769 18 115 98.543478 16.45652174 19 71 98.543478 -27.54347826 20 66 66.533333 -0.53333333 21 134 116.884615 17.11538462 22 117 116.884615 0.11538462 23 108 98.543478 9.45652174 24 84 76.857143 7.14285714 25 156 137.807692 18.19230769 26 120 116.884615 3.11538462 27 114 98.543478 15.45652174 28 94 98.543478 -4.54347826 29 120 116.884615 3.11538462 30 81 74.166667 6.83333333 31 110 116.884615 -6.88461538 32 133 116.884615 16.11538462 33 122 137.807692 -15.80769231 34 158 137.807692 20.19230769 35 109 98.543478 10.45652174 36 124 116.884615 7.11538462 37 39 39.900000 -0.90000000 38 92 98.543478 -6.54347826 39 126 116.884615 9.11538462 40 0 5.117647 -5.11764706 41 70 74.166667 -4.16666667 42 37 39.900000 -2.90000000 43 38 49.093023 -11.09302326 44 120 98.543478 21.45652174 45 93 98.543478 -5.54347826 46 95 94.400000 0.60000000 47 77 58.260870 18.73913043 48 90 98.543478 -8.54347826 49 80 74.166667 5.83333333 50 31 137.807692 -106.80769231 51 110 116.884615 -6.88461538 52 66 74.166667 -8.16666667 53 138 137.807692 0.19230769 54 133 137.807692 -4.80769231 55 113 116.884615 -3.88461538 56 100 98.543478 1.45652174 57 7 5.117647 1.88235294 58 140 137.807692 2.19230769 59 61 58.260870 2.73913043 60 41 39.900000 1.10000000 61 96 98.543478 -2.54347826 62 164 137.807692 26.19230769 63 78 66.533333 11.46666667 64 49 49.093023 -0.09302326 65 102 98.543478 3.45652174 66 124 116.884615 7.11538462 67 99 98.543478 0.45652174 68 129 116.884615 12.11538462 69 62 66.533333 -4.53333333 70 73 94.400000 -21.40000000 71 114 98.543478 15.45652174 72 99 98.543478 0.45652174 73 70 74.166667 -4.16666667 74 104 76.857143 27.14285714 75 116 116.884615 -0.88461538 76 91 98.543478 -7.54347826 77 74 66.533333 7.46666667 78 138 137.807692 0.19230769 79 67 66.533333 0.46666667 80 151 137.807692 13.19230769 81 72 98.543478 -26.54347826 82 120 116.884615 3.11538462 83 115 116.884615 -1.88461538 84 105 98.543478 6.45652174 85 104 94.400000 9.60000000 86 108 98.543478 9.45652174 87 98 94.400000 3.60000000 88 69 66.533333 2.46666667 89 111 116.884615 -5.88461538 90 99 74.166667 24.83333333 91 71 116.884615 -45.88461538 92 27 28.050000 -1.05000000 93 69 66.533333 2.46666667 94 107 98.543478 8.45652174 95 73 58.260870 14.73913043 96 107 98.543478 8.45652174 97 93 137.807692 -44.80769231 98 129 116.884615 12.11538462 99 69 94.400000 -25.40000000 100 118 116.884615 1.11538462 101 73 74.166667 -1.16666667 102 119 98.543478 20.45652174 103 104 98.543478 5.45652174 104 107 98.543478 8.45652174 105 99 98.543478 0.45652174 106 90 98.543478 -8.54347826 107 197 137.807692 59.19230769 108 36 66.533333 -30.53333333 109 85 66.533333 18.46666667 110 139 137.807692 1.19230769 111 106 116.884615 -10.88461538 112 50 74.166667 -24.16666667 113 64 58.260870 5.73913043 114 31 58.260870 -27.26086957 115 63 98.543478 -35.54347826 116 92 98.543478 -6.54347826 117 106 98.543478 7.45652174 118 63 58.260870 4.73913043 119 69 66.533333 2.46666667 120 41 49.093023 -8.09302326 121 56 58.260870 -2.26086957 122 25 28.050000 -3.05000000 123 65 49.093023 15.90697674 124 93 98.543478 -5.54347826 125 114 98.543478 15.45652174 126 38 28.050000 9.95000000 127 44 39.900000 4.10000000 128 87 66.533333 20.46666667 129 110 137.807692 -27.80769231 130 0 5.117647 -5.11764706 131 27 28.050000 -1.05000000 132 83 98.543478 -15.54347826 133 30 28.050000 1.95000000 134 80 74.166667 5.83333333 135 98 94.400000 3.60000000 136 82 98.543478 -16.54347826 137 0 5.117647 -5.11764706 138 60 66.533333 -6.53333333 139 28 39.900000 -11.90000000 140 9 28.050000 -19.05000000 141 33 39.900000 -6.90000000 142 59 58.260870 0.73913043 143 49 37.111111 11.88888889 144 115 116.884615 -1.88461538 145 140 137.807692 2.19230769 146 49 66.533333 -17.53333333 147 120 94.400000 25.60000000 148 66 66.533333 -0.53333333 149 21 28.050000 -7.05000000 150 124 94.400000 29.60000000 151 152 137.807692 14.19230769 152 139 137.807692 1.19230769 153 38 39.900000 -1.90000000 154 144 137.807692 6.19230769 155 120 116.884615 3.11538462 156 160 137.807692 22.19230769 157 114 98.543478 15.45652174 158 39 39.900000 -0.90000000 159 78 98.543478 -20.54347826 160 119 98.543478 20.45652174 161 141 137.807692 3.19230769 162 101 98.543478 2.45652174 163 56 49.093023 6.90697674 164 133 116.884615 16.11538462 165 83 74.166667 8.83333333 166 116 116.884615 -0.88461538 167 90 74.166667 15.83333333 168 36 76.857143 -40.85714286 169 50 58.260870 -8.26086957 170 61 58.260870 2.73913043 171 97 98.543478 -1.54347826 172 98 98.543478 -0.54347826 173 78 66.533333 11.46666667 174 117 137.807692 -20.80769231 175 148 137.807692 10.19230769 176 41 39.900000 1.10000000 177 105 98.543478 6.45652174 178 55 58.260870 -3.26086957 179 132 137.807692 -5.80769231 180 44 39.900000 4.10000000 181 21 5.117647 15.88235294 182 50 49.093023 0.90697674 183 0 5.117647 -5.11764706 184 73 98.543478 -25.54347826 185 86 116.884615 -30.88461538 186 0 5.117647 -5.11764706 187 13 5.117647 7.88235294 188 4 5.117647 -1.11764706 189 57 49.093023 7.90697674 190 48 74.166667 -26.16666667 191 46 66.533333 -20.53333333 192 48 49.093023 -1.09302326 193 32 28.050000 3.95000000 194 68 66.533333 1.46666667 195 87 66.533333 20.46666667 196 43 28.050000 14.95000000 197 67 58.260870 8.73913043 198 46 39.900000 6.10000000 199 46 49.093023 -3.09302326 200 56 49.093023 6.90697674 201 48 49.093023 -1.09302326 202 44 66.533333 -22.53333333 203 60 49.093023 10.90697674 204 65 49.093023 15.90697674 205 55 58.260870 -3.26086957 206 38 37.111111 0.88888889 207 52 49.093023 2.90697674 208 60 49.093023 10.90697674 209 54 58.260870 -4.26086957 210 86 66.533333 19.46666667 211 24 28.050000 -4.05000000 212 52 49.093023 2.90697674 213 49 58.260870 -9.26086957 214 61 49.093023 11.90697674 215 61 66.533333 -5.53333333 216 81 66.533333 14.46666667 217 43 39.900000 3.10000000 218 40 39.900000 0.10000000 219 40 49.093023 -9.09302326 220 56 49.093023 6.90697674 221 68 58.260870 9.73913043 222 79 66.533333 12.46666667 223 47 49.093023 -2.09302326 224 57 58.260870 -1.26086957 225 41 37.111111 3.88888889 226 29 28.050000 0.95000000 227 3 5.117647 -2.11764706 228 60 49.093023 10.90697674 229 30 39.900000 -9.90000000 230 79 66.533333 12.46666667 231 47 37.111111 9.88888889 232 40 39.900000 0.10000000 233 48 49.093023 -1.09302326 234 36 49.093023 -13.09302326 235 42 66.533333 -24.53333333 236 49 58.260870 -9.26086957 237 57 58.260870 -1.26086957 238 12 49.093023 -37.09302326 239 40 49.093023 -9.09302326 240 43 37.111111 5.88888889 241 33 49.093023 -16.09302326 242 77 66.533333 10.46666667 243 43 49.093023 -6.09302326 244 45 39.900000 5.10000000 245 47 49.093023 -2.09302326 246 43 49.093023 -6.09302326 247 45 49.093023 -4.09302326 248 50 49.093023 0.90697674 249 35 28.050000 6.95000000 250 7 5.117647 1.88235294 251 71 66.533333 4.46666667 252 67 66.533333 0.46666667 253 0 5.117647 -5.11764706 254 62 58.260870 3.73913043 255 54 49.093023 4.90697674 256 4 5.117647 -1.11764706 257 25 28.050000 -3.05000000 258 40 49.093023 -9.09302326 259 38 49.093023 -11.09302326 260 19 28.050000 -9.05000000 261 17 37.111111 -20.11111111 262 67 49.093023 17.90697674 263 14 5.117647 8.88235294 264 30 49.093023 -19.09302326 265 54 39.900000 14.10000000 266 35 39.900000 -4.90000000 267 59 58.260870 0.73913043 268 24 28.050000 -4.05000000 269 58 49.093023 8.90697674 270 42 66.533333 -24.53333333 271 46 58.260870 -12.26086957 272 61 49.093023 11.90697674 273 3 5.117647 -2.11764706 274 52 49.093023 2.90697674 275 25 28.050000 -3.05000000 276 40 37.111111 2.88888889 277 32 28.050000 3.95000000 278 4 5.117647 -1.11764706 279 49 39.900000 9.10000000 280 63 49.093023 13.90697674 281 67 58.260870 8.73913043 282 32 39.900000 -7.90000000 283 23 28.050000 -5.05000000 284 7 5.117647 1.88235294 285 54 49.093023 4.90697674 286 37 37.111111 -0.11111111 287 35 28.050000 6.95000000 288 51 49.093023 1.90697674 289 39 49.093023 -10.09302326 > if (par2 != 'none') { + print(cbind(as.factor(x[,par1]),predict(m))) + myt <- table(as.factor(x[,par1]),predict(m)) + print(myt) + } > postscript(file="/var/www/rcomp/tmp/4e6o71324677279.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/www/rcomp/tmp/5utv61324677279.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/www/rcomp/tmp/6bhc01324677279.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/www/rcomp/tmp/7cspa1324677279.tab") + } > > try(system("convert tmp/2binu1324677279.ps tmp/2binu1324677279.png",intern=TRUE)) character(0) > try(system("convert tmp/3cagr1324677279.ps tmp/3cagr1324677279.png",intern=TRUE)) character(0) > try(system("convert tmp/4e6o71324677279.ps tmp/4e6o71324677279.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.290 0.110 4.365