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(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' + ,'compendiumsreveiwed' + ,'totsize' + ,'bloggedcomputations' + ,'totseconds') + ,1:289)) > y <- array(NA,dim=c(5,289),dimnames=list(c('Feedbackmessagesp120','compendiumsreveiwed','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 = '2' > par2 = 'quantiles' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > library(party) Loading required package: survival Loading required package: splines Loading required package: grid Loading required package: modeltools Loading required package: stats4 Loading required package: coin Loading required package: mvtnorm Loading required package: zoo Loading required package: sandwich Loading required package: strucchange Loading required package: vcd Loading required package: MASS Loading required package: colorspace > library(Hmisc) Attaching package: 'Hmisc' The following object(s) are masked from 'package:survival': untangle.specials The following object(s) are masked from 'package:base': format.pval, round.POSIXt, trunc.POSIXt, units > par1 <- as.numeric(par1) > par3 <- as.numeric(par3) > x <- data.frame(t(y)) > is.data.frame(x) [1] TRUE > x <- x[!is.na(x[,par1]),] > k <- length(x[1,]) > n <- length(x[,1]) > colnames(x)[par1] [1] "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, 67) [67,197] 145 144 > colnames(x) [1] "Feedbackmessagesp120" "compendiumsreveiwed" "totsize" [4] "bloggedcomputations" "totseconds" > colnames(x)[par1] [1] "Feedbackmessagesp120" > x[,par1] [1] [67,197] [67,197] [67,197] [67,197] [ 0, 67) [67,197] [67,197] [ 0, 67) [9] [ 0, 67) [67,197] [ 0, 67) [67,197] [67,197] [67,197] [67,197] [67,197] [17] [67,197] [67,197] [67,197] [ 0, 67) [67,197] [67,197] [67,197] [67,197] [25] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [33] [67,197] [67,197] [67,197] [67,197] [ 0, 67) [67,197] [67,197] [ 0, 67) [41] [67,197] [ 0, 67) [ 0, 67) [67,197] [67,197] [67,197] [67,197] [67,197] [49] [67,197] [ 0, 67) [67,197] [ 0, 67) [67,197] [67,197] [67,197] [67,197] [57] [ 0, 67) [67,197] [ 0, 67) [ 0, 67) [67,197] [67,197] [67,197] [ 0, 67) [65] [67,197] [67,197] [67,197] [67,197] [ 0, 67) [67,197] [67,197] [67,197] [73] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [81] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [89] [67,197] [67,197] [67,197] [ 0, 67) [67,197] [67,197] [67,197] [67,197] [97] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [67,197] [105] [67,197] [67,197] [67,197] [ 0, 67) [67,197] [67,197] [67,197] [ 0, 67) [113] [ 0, 67) [ 0, 67) [ 0, 67) [67,197] [67,197] [ 0, 67) [67,197] [ 0, 67) [121] [ 0, 67) [ 0, 67) [ 0, 67) [67,197] [67,197] [ 0, 67) [ 0, 67) [67,197] [129] [67,197] [ 0, 67) [ 0, 67) [67,197] [ 0, 67) [67,197] [67,197] [67,197] [137] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [67,197] [145] [67,197] [ 0, 67) [67,197] [ 0, 67) [ 0, 67) [67,197] [67,197] [67,197] [153] [ 0, 67) [67,197] [67,197] [67,197] [67,197] [ 0, 67) [67,197] [67,197] [161] [67,197] [67,197] [ 0, 67) [67,197] [67,197] [67,197] [67,197] [ 0, 67) [169] [ 0, 67) [ 0, 67) [67,197] [67,197] [67,197] [67,197] [67,197] [ 0, 67) [177] [67,197] [ 0, 67) [67,197] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [67,197] [185] [67,197] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [193] [ 0, 67) [67,197] [67,197] [ 0, 67) [67,197] [ 0, 67) [ 0, 67) [ 0, 67) [201] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [209] [ 0, 67) [67,197] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [67,197] [217] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [67,197] [67,197] [ 0, 67) [ 0, 67) [225] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [67,197] [ 0, 67) [ 0, 67) [233] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [241] [ 0, 67) [67,197] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [249] [ 0, 67) [ 0, 67) [67,197] [67,197] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [257] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [67,197] [ 0, 67) [ 0, 67) [265] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [273] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [281] [67,197] [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [ 0, 67) [289] [ 0, 67) Levels: [ 0, 67) [67,197] > 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/1qhab1324678222.tab") + } + } > m Conditional inference tree with 5 terminal nodes Response: as.factor(Feedbackmessagesp120) Inputs: compendiumsreveiwed, totsize, bloggedcomputations, totseconds Number of observations: 289 1) compendiumsreveiwed <= 20; criterion = 1, statistic = 175.964 2) compendiumsreveiwed <= 18; criterion = 0.968, statistic = 7.038 3)* weights = 118 2) compendiumsreveiwed > 18 4)* weights = 14 1) compendiumsreveiwed > 20 5) bloggedcomputations <= 39; criterion = 1, statistic = 18.281 6)* weights = 29 5) bloggedcomputations > 39 7) compendiumsreveiwed <= 24; criterion = 0.998, statistic = 12.137 8)* weights = 14 7) compendiumsreveiwed > 24 9)* weights = 114 > postscript(file="/var/wessaorg/rcomp/tmp/2hfnj1324678222.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/3hl831324678222.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,par1] ~ as.factor(where(m)),main='Response by Terminal Node',xlab='Terminal Node',ylab='Response') > dev.off() null device 1 > if (par2 == 'none') { + forec <- predict(m) + result <- as.data.frame(cbind(x[,par1],forec,x[,par1]-forec)) + colnames(result) <- c('Actuals','Forecasts','Residuals') + print(result) + } > if (par2 != 'none') { + print(cbind(as.factor(x[,par1]),predict(m))) + myt <- table(as.factor(x[,par1]),predict(m)) + print(myt) + } [,1] [,2] [1,] 2 2 [2,] 2 2 [3,] 2 2 [4,] 2 2 [5,] 1 2 [6,] 2 2 [7,] 2 2 [8,] 1 1 [9,] 1 1 [10,] 2 2 [11,] 1 2 [12,] 2 2 [13,] 2 2 [14,] 2 2 [15,] 2 2 [16,] 2 2 [17,] 2 2 [18,] 2 2 [19,] 2 2 [20,] 1 2 [21,] 2 2 [22,] 2 2 [23,] 2 2 [24,] 2 2 [25,] 2 2 [26,] 2 2 [27,] 2 2 [28,] 2 2 [29,] 2 2 [30,] 2 2 [31,] 2 2 [32,] 2 2 [33,] 2 2 [34,] 2 2 [35,] 2 2 [36,] 2 2 [37,] 1 1 [38,] 2 2 [39,] 2 2 [40,] 1 1 [41,] 2 2 [42,] 1 1 [43,] 1 1 [44,] 2 2 [45,] 2 2 [46,] 2 2 [47,] 2 1 [48,] 2 2 [49,] 2 2 [50,] 1 2 [51,] 2 2 [52,] 1 2 [53,] 2 2 [54,] 2 2 [55,] 2 2 [56,] 2 2 [57,] 1 1 [58,] 2 2 [59,] 1 1 [60,] 1 1 [61,] 2 2 [62,] 2 2 [63,] 2 2 [64,] 1 1 [65,] 2 2 [66,] 2 2 [67,] 2 2 [68,] 2 2 [69,] 1 2 [70,] 2 2 [71,] 2 2 [72,] 2 2 [73,] 2 2 [74,] 2 2 [75,] 2 2 [76,] 2 2 [77,] 2 2 [78,] 2 2 [79,] 2 2 [80,] 2 2 [81,] 2 2 [82,] 2 2 [83,] 2 2 [84,] 2 2 [85,] 2 2 [86,] 2 2 [87,] 2 2 [88,] 2 2 [89,] 2 2 [90,] 2 2 [91,] 2 2 [92,] 1 1 [93,] 2 2 [94,] 2 2 [95,] 2 1 [96,] 2 2 [97,] 2 2 [98,] 2 2 [99,] 2 2 [100,] 2 2 [101,] 2 2 [102,] 2 2 [103,] 2 2 [104,] 2 2 [105,] 2 2 [106,] 2 2 [107,] 2 2 [108,] 1 2 [109,] 2 2 [110,] 2 2 [111,] 2 2 [112,] 1 2 [113,] 1 1 [114,] 1 1 [115,] 1 2 [116,] 2 2 [117,] 2 2 [118,] 1 1 [119,] 2 2 [120,] 1 1 [121,] 1 1 [122,] 1 1 [123,] 1 1 [124,] 2 2 [125,] 2 2 [126,] 1 1 [127,] 1 1 [128,] 2 2 [129,] 2 2 [130,] 1 1 [131,] 1 1 [132,] 2 2 [133,] 1 1 [134,] 2 2 [135,] 2 2 [136,] 2 2 [137,] 1 1 [138,] 1 2 [139,] 1 1 [140,] 1 1 [141,] 1 1 [142,] 1 1 [143,] 1 1 [144,] 2 2 [145,] 2 2 [146,] 1 2 [147,] 2 2 [148,] 1 2 [149,] 1 1 [150,] 2 2 [151,] 2 2 [152,] 2 2 [153,] 1 1 [154,] 2 2 [155,] 2 2 [156,] 2 2 [157,] 2 2 [158,] 1 1 [159,] 2 2 [160,] 2 2 [161,] 2 2 [162,] 2 2 [163,] 1 1 [164,] 2 2 [165,] 2 2 [166,] 2 2 [167,] 2 2 [168,] 1 2 [169,] 1 1 [170,] 1 1 [171,] 2 2 [172,] 2 2 [173,] 2 2 [174,] 2 2 [175,] 2 2 [176,] 1 1 [177,] 2 2 [178,] 1 1 [179,] 2 2 [180,] 1 1 [181,] 1 1 [182,] 1 1 [183,] 1 1 [184,] 2 2 [185,] 2 2 [186,] 1 1 [187,] 1 1 [188,] 1 1 [189,] 1 1 [190,] 1 2 [191,] 1 2 [192,] 1 1 [193,] 1 1 [194,] 2 2 [195,] 2 2 [196,] 1 1 [197,] 2 1 [198,] 1 1 [199,] 1 1 [200,] 1 1 [201,] 1 1 [202,] 1 2 [203,] 1 1 [204,] 1 1 [205,] 1 1 [206,] 1 1 [207,] 1 1 [208,] 1 1 [209,] 1 1 [210,] 2 2 [211,] 1 1 [212,] 1 1 [213,] 1 1 [214,] 1 1 [215,] 1 2 [216,] 2 2 [217,] 1 1 [218,] 1 1 [219,] 1 1 [220,] 1 1 [221,] 2 1 [222,] 2 2 [223,] 1 1 [224,] 1 1 [225,] 1 1 [226,] 1 1 [227,] 1 1 [228,] 1 1 [229,] 1 1 [230,] 2 2 [231,] 1 1 [232,] 1 1 [233,] 1 1 [234,] 1 1 [235,] 1 2 [236,] 1 1 [237,] 1 1 [238,] 1 1 [239,] 1 1 [240,] 1 1 [241,] 1 1 [242,] 2 2 [243,] 1 1 [244,] 1 1 [245,] 1 1 [246,] 1 1 [247,] 1 1 [248,] 1 1 [249,] 1 1 [250,] 1 1 [251,] 2 2 [252,] 2 2 [253,] 1 1 [254,] 1 1 [255,] 1 1 [256,] 1 1 [257,] 1 1 [258,] 1 1 [259,] 1 1 [260,] 1 1 [261,] 1 1 [262,] 2 1 [263,] 1 1 [264,] 1 1 [265,] 1 1 [266,] 1 1 [267,] 1 1 [268,] 1 1 [269,] 1 1 [270,] 1 2 [271,] 1 1 [272,] 1 1 [273,] 1 1 [274,] 1 1 [275,] 1 1 [276,] 1 1 [277,] 1 1 [278,] 1 1 [279,] 1 1 [280,] 1 1 [281,] 2 1 [282,] 1 1 [283,] 1 1 [284,] 1 1 [285,] 1 1 [286,] 1 1 [287,] 1 1 [288,] 1 1 [289,] 1 1 [ 0, 67) [67,197] [ 0, 67) 126 19 [67,197] 6 138 > postscript(file="/var/wessaorg/rcomp/tmp/4vp8a1324678222.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/5xs501324678222.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/6i7zb1324678222.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/73m6i1324678222.tab") + } > > try(system("convert tmp/2hfnj1324678222.ps tmp/2hfnj1324678222.png",intern=TRUE)) character(0) > try(system("convert tmp/3hl831324678222.ps tmp/3hl831324678222.png",intern=TRUE)) character(0) > try(system("convert tmp/4vp8a1324678222.ps tmp/4vp8a1324678222.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.931 0.231 3.162