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(115 + ,112285 + ,24188 + ,146283 + ,109 + ,84786 + ,18273 + ,98364 + ,146 + ,83123 + ,14130 + ,86146 + ,116 + ,101193 + ,32287 + ,96933 + ,68 + ,38361 + ,8654 + ,79234 + ,101 + ,68504 + ,9245 + ,42551 + ,96 + ,119182 + ,33251 + ,195663 + ,67 + ,22807 + ,1271 + ,6853 + ,44 + ,17140 + ,5279 + ,21529 + ,100 + ,116174 + ,27101 + ,95757 + ,93 + ,57635 + ,16373 + ,85584 + ,140 + ,66198 + ,19716 + ,143983 + ,166 + ,71701 + ,17753 + ,75851 + ,99 + ,57793 + ,9028 + ,59238 + ,139 + ,80444 + ,18653 + ,93163 + ,130 + ,53855 + ,8828 + ,96037 + ,181 + ,97668 + ,29498 + ,151511 + ,116 + ,133824 + ,27563 + ,136368 + ,116 + ,101481 + ,18293 + ,112642 + ,88 + ,99645 + ,22530 + ,94728 + ,139 + ,114789 + ,15977 + ,105499 + ,135 + ,99052 + ,35082 + ,121527 + ,108 + ,67654 + ,16116 + ,127766 + ,89 + ,65553 + ,15849 + ,98958 + ,156 + ,97500 + ,16026 + ,77900 + ,129 + ,69112 + ,26569 + ,85646 + ,118 + ,82753 + ,24785 + ,98579 + ,118 + ,85323 + ,17569 + ,130767 + ,125 + ,72654 + ,23825 + ,131741 + ,95 + ,30727 + ,7869 + ,53907 + ,126 + ,77873 + ,14975 + ,178812 + ,135 + ,117478 + ,37791 + ,146761 + ,154 + ,74007 + ,9605 + ,82036 + ,165 + ,90183 + ,27295 + ,163253 + ,113 + ,61542 + ,2746 + ,27032 + ,127 + ,101494 + ,34461 + ,171975 + ,52 + ,27570 + ,8098 + ,65990 + ,121 + ,55813 + ,4787 + ,86572 + ,136 + ,79215 + ,24919 + ,159676 + ,0 + ,1423 + ,603 + ,1929 + ,108 + ,55461 + ,16329 + ,85371 + ,46 + ,31081 + ,12558 + ,58391 + ,54 + ,22996 + ,7784 + ,31580 + ,124 + ,83122 + ,28522 + ,136815 + ,115 + ,70106 + ,22265 + ,120642 + ,128 + ,60578 + ,14459 + ,69107 + ,80 + ,39992 + ,14526 + ,50495 + ,97 + ,79892 + ,22240 + ,108016 + ,104 + ,49810 + ,11802 + ,46341 + ,59 + ,71570 + ,7623 + ,78348 + ,125 + ,100708 + ,11912 + ,79336 + ,82 + ,33032 + ,7935 + ,56968 + ,149 + ,82875 + ,18220 + ,93176 + ,149 + ,139077 + ,19199 + ,161632 + ,122 + ,71595 + ,19918 + ,87850 + ,118 + ,72260 + ,21884 + ,127969 + ,12 + ,5950 + ,2694 + ,15049 + ,144 + ,115762 + ,15808 + ,155135 + ,67 + ,32551 + ,3597 + ,25109 + ,52 + ,31701 + ,5296 + ,45824 + ,108 + ,80670 + ,25239 + ,102996 + ,166 + ,143558 + ,29801 + ,160604 + ,80 + ,117105 + ,18450 + ,158051 + ,60 + ,23789 + ,7132 + ,44547 + ,107 + ,120733 + ,34861 + ,162647 + ,127 + ,105195 + ,35940 + ,174141 + ,107 + ,73107 + ,16688 + ,60622 + ,146 + ,132068 + ,24683 + ,179566 + ,84 + ,149193 + ,46230 + ,184301 + ,141 + ,46821 + ,10387 + ,75661 + ,123 + ,87011 + ,21436 + ,96144 + ,111 + ,95260 + ,30546 + ,129847 + ,98 + ,55183 + ,19746 + ,117286 + ,105 + ,106671 + ,15977 + ,71180 + ,135 + ,73511 + ,22583 + ,109377 + ,107 + ,92945 + ,17274 + ,85298 + ,85 + ,78664 + ,16469 + ,73631 + ,155 + ,70054 + ,14251 + ,86767 + ,88 + ,22618 + ,3007 + ,23824 + ,155 + ,74011 + ,16851 + ,93487 + ,104 + ,83737 + ,21113 + ,82981 + ,132 + ,69094 + ,17401 + ,73815 + ,127 + ,93133 + ,23958 + ,94552 + ,108 + ,95536 + ,23567 + ,132190 + ,129 + ,225920 + ,13065 + ,128754 + ,116 + ,62133 + ,15358 + ,66363 + ,122 + ,61370 + ,14587 + ,67808 + ,85 + ,43836 + ,12770 + ,61724 + ,147 + ,106117 + ,24021 + ,131722 + ,99 + ,38692 + ,9648 + ,68580 + ,87 + ,84651 + ,20537 + ,106175 + ,28 + ,56622 + ,7905 + ,55792 + ,90 + ,15986 + ,4527 + ,25157 + ,109 + ,95364 + ,30495 + ,76669 + ,78 + ,26706 + ,7117 + ,57283 + ,111 + ,89691 + ,17719 + ,105805 + ,158 + ,67267 + ,27056 + ,129484 + ,141 + ,126846 + ,33473 + ,72413 + ,122 + ,41140 + ,9758 + ,87831 + ,124 + ,102860 + ,21115 + ,96971 + ,93 + ,51715 + ,7236 + ,71299 + ,124 + ,55801 + ,13790 + ,77494 + ,112 + ,111813 + ,32902 + ,120336 + ,108 + ,120293 + ,25131 + ,93913 + ,99 + ,138599 + ,30910 + ,136048 + ,117 + ,161647 + ,35947 + ,181248 + ,199 + ,115929 + ,29848 + ,146123 + ,78 + ,24266 + ,6943 + ,32036 + ,91 + ,162901 + ,42705 + ,186646 + ,158 + ,109825 + ,31808 + ,102255 + ,126 + ,129838 + ,26675 + ,168237 + ,122 + ,37510 + ,8435 + ,64219 + ,71 + ,43750 + ,7409 + ,19630 + ,75 + ,40652 + ,14993 + ,76825 + ,115 + ,87771 + ,36867 + ,115338 + ,119 + ,85872 + ,33835 + ,109427 + ,124 + ,89275 + ,24164 + ,118168 + ,72 + ,44418 + ,12607 + ,84845 + ,91 + ,192565 + ,22609 + ,153197 + ,45 + ,35232 + ,5892 + ,29877 + ,78 + ,40909 + ,17014 + ,63506 + ,39 + ,13294 + ,5394 + ,22445 + ,68 + ,32387 + ,9178 + ,47695 + ,119 + ,140867 + ,6440 + ,68370 + ,117 + ,120662 + ,21916 + ,146304 + ,39 + ,21233 + ,4011 + ,38233 + ,50 + ,44332 + ,5818 + ,42071 + ,88 + ,61056 + ,18647 + ,50517 + ,155 + ,101338 + ,20556 + ,103950 + ,0 + ,1168 + ,238 + ,5841 + ,36 + ,13497 + ,70 + ,2341 + ,123 + ,65567 + ,22392 + ,84396 + ,32 + ,25162 + ,3913 + ,24610 + ,99 + ,32334 + ,12237 + ,35753 + ,136 + ,40735 + ,8388 + ,55515 + ,117 + ,91413 + ,22120 + ,209056 + ,0 + ,855 + ,338 + ,6622 + ,88 + ,97068 + ,11727 + ,115814 + ,39 + ,44339 + ,3704 + ,11609 + ,25 + ,14116 + ,3988 + ,13155 + ,52 + ,10288 + ,3030 + ,18274 + ,75 + ,65622 + ,13520 + ,72875 + ,71 + ,16563 + ,1421 + ,10112 + ,124 + ,76643 + ,20923 + ,142775 + ,151 + ,110681 + ,20237 + ,68847 + ,71 + ,29011 + ,3219 + ,17659 + ,145 + ,92696 + ,3769 + ,20112 + ,87 + ,94785 + ,12252 + ,61023 + ,27 + ,8773 + ,1888 + ,13983 + ,131 + ,83209 + ,14497 + ,65176 + ,162 + ,93815 + ,28864 + ,132432 + ,165 + ,86687 + ,21721 + ,112494 + ,54 + ,34553 + ,4821 + ,45109 + ,159 + ,105547 + ,33644 + ,170875 + ,147 + ,103487 + ,15923 + ,180759 + ,170 + ,213688 + ,42935 + ,214921 + ,119 + ,71220 + ,18864 + ,100226 + ,49 + ,23517 + ,4977 + ,32043 + ,104 + ,56926 + ,7785 + ,54454 + ,120 + ,91721 + ,17939 + ,78876 + ,150 + ,115168 + ,23436 + ,170745 + ,112 + ,111194 + ,325 + ,6940 + ,59 + ,51009 + ,13539 + ,49025 + ,136 + ,135777 + ,34538 + ,122037 + ,107 + ,51513 + ,12198 + ,53782 + ,130 + ,74163 + ,26924 + ,127748 + ,115 + ,51633 + ,12716 + ,86839 + ,107 + ,75345 + ,8172 + ,44830 + ,75 + ,33416 + ,10855 + ,77395 + ,71 + ,83305 + ,11932 + ,89324 + ,120 + ,98952 + ,14300 + ,103300 + ,116 + ,102372 + ,25515 + ,112283 + ,79 + ,37238 + ,2805 + ,10901 + ,150 + ,103772 + ,29402 + ,120691 + ,156 + ,123969 + ,16440 + ,58106 + ,51 + ,27142 + ,11221 + ,57140 + ,118 + ,135400 + ,28732 + ,122422 + ,71 + ,21399 + ,5250 + ,25899 + ,144 + ,130115 + ,28608 + ,139296 + ,47 + ,24874 + ,8092 + ,52678 + ,28 + ,34988 + ,4473 + ,23853 + ,68 + ,45549 + ,1572 + ,17306 + ,0 + ,6023 + ,2065 + ,7953 + ,110 + ,64466 + ,14817 + ,89455 + ,147 + ,54990 + ,16714 + ,147866 + ,0 + ,1644 + ,556 + ,4245 + ,15 + ,6179 + ,2089 + ,21509 + ,4 + ,3926 + ,2658 + ,7670 + ,64 + ,32755 + ,10695 + ,66675 + ,111 + ,34777 + ,1669 + ,14336 + ,85 + ,73224 + ,16267 + ,53608 + ,68 + ,27114 + ,7768 + ,30059 + ,40 + ,20760 + ,7252 + ,29668 + ,80 + ,37636 + ,6387 + ,22097 + ,88 + ,65461 + ,18715 + ,96841 + ,48 + ,30080 + ,7936 + ,41907 + ,76 + ,24094 + ,8643 + ,27080 + ,51 + ,69008 + ,7294 + ,35885 + ,67 + ,54968 + ,4570 + ,41247 + ,59 + ,46090 + ,7185 + ,28313 + ,61 + ,27507 + ,10058 + ,36845 + ,76 + ,10672 + ,2342 + ,16548 + ,60 + ,34029 + ,8509 + ,36134 + ,68 + ,46300 + ,13275 + ,55764 + ,71 + ,24760 + ,6816 + ,28910 + ,76 + ,18779 + ,1930 + ,13339 + ,62 + ,21280 + ,8086 + ,25319 + ,61 + ,40662 + ,10737 + ,66956 + ,67 + ,28987 + ,8033 + ,47487 + ,88 + ,22827 + ,7058 + ,52785 + ,30 + ,18513 + ,6782 + ,44683 + ,64 + ,30594 + ,5401 + ,35619 + ,68 + ,24006 + ,6521 + ,21920 + ,64 + ,27913 + ,10856 + ,45608 + ,91 + ,42744 + ,2154 + ,7721 + ,88 + ,12934 + ,6117 + ,20634 + ,52 + ,22574 + ,5238 + ,29788 + ,49 + ,41385 + ,4820 + ,31931 + ,62 + ,18653 + ,5615 + ,37754 + ,61 + ,18472 + ,4272 + ,32505 + ,76 + ,30976 + ,8702 + ,40557 + ,88 + ,63339 + ,15340 + ,94238 + ,66 + ,25568 + ,8030 + ,44197 + ,71 + ,33747 + ,9526 + ,43228 + ,68 + ,4154 + ,1278 + ,4103 + ,48 + ,19474 + ,4236 + ,44144 + ,25 + ,35130 + ,3023 + ,32868 + ,68 + ,39067 + ,7196 + ,27640 + ,41 + ,13310 + ,3394 + ,14063 + ,90 + ,65892 + ,6371 + ,28990 + ,66 + ,4143 + ,1574 + ,4694 + ,54 + ,28579 + ,9620 + ,42648 + ,59 + ,51776 + ,6978 + ,64329 + ,60 + ,21152 + ,4911 + ,21928 + ,77 + ,38084 + ,8645 + ,25836 + ,68 + ,27717 + ,8987 + ,22779 + ,72 + ,32928 + ,5544 + ,40820 + ,67 + ,11342 + ,3083 + ,27530 + ,64 + ,19499 + ,6909 + ,32378 + ,63 + ,16380 + ,3189 + ,10824 + ,59 + ,36874 + ,6745 + ,39613 + ,84 + ,48259 + ,16724 + ,60865 + ,64 + ,16734 + ,4850 + ,19787 + ,56 + ,28207 + ,7025 + ,20107 + ,54 + ,30143 + ,6047 + ,36605 + ,67 + ,41369 + ,7377 + ,40961 + ,58 + ,45833 + ,9078 + ,48231 + ,59 + ,29156 + ,4605 + ,39725 + ,40 + ,35944 + ,3238 + ,21455 + ,22 + ,36278 + ,8100 + ,23430 + ,83 + ,45588 + ,9653 + ,62991 + ,81 + ,45097 + ,8914 + ,49363 + ,2 + ,3895 + ,786 + ,9604 + ,72 + ,28394 + ,6700 + ,24552 + ,61 + ,18632 + ,5788 + ,31493 + ,15 + ,2325 + ,593 + ,3439 + ,32 + ,25139 + ,4506 + ,19555 + ,62 + ,27975 + ,6382 + ,21228 + ,58 + ,14483 + ,5621 + ,23177 + ,36 + ,13127 + ,3997 + ,22094 + ,59 + ,5839 + ,520 + ,2342 + ,68 + ,24069 + ,8891 + ,38798 + ,21 + ,3738 + ,999 + ,3255 + ,55 + ,18625 + ,7067 + ,24261 + ,54 + ,36341 + ,4639 + ,18511 + ,55 + ,24548 + ,5654 + ,40798 + ,72 + ,21792 + ,6928 + ,28893 + ,41 + ,26263 + ,1514 + ,21425 + ,61 + ,23686 + ,9238 + ,50276 + ,67 + ,49303 + ,8204 + ,37643 + ,76 + ,25659 + ,5926 + ,30377 + ,64 + ,28904 + ,5785 + ,27126 + ,3 + ,2781 + ,4 + ,13 + ,63 + ,29236 + ,5930 + ,42097 + ,40 + ,19546 + ,3710 + ,24451 + ,69 + ,22818 + ,705 + ,14335 + ,48 + ,32689 + ,443 + ,5084 + ,8 + ,5752 + ,2416 + ,9927 + ,52 + ,22197 + ,7747 + ,43527 + ,66 + ,20055 + ,5432 + ,27184 + ,76 + ,25272 + ,4913 + ,21610 + ,43 + ,82206 + ,2650 + ,20484 + ,39 + ,32073 + ,2370 + ,20156 + ,14 + ,5444 + ,775 + ,6012 + ,61 + ,20154 + ,5576 + ,18475 + ,71 + ,36944 + ,1352 + ,12645 + ,44 + ,8019 + ,3080 + ,11017 + ,60 + ,30884 + ,10205 + ,37623 + ,64 + ,19540 + ,6095 + ,35873) + ,dim=c(4 + ,289) + ,dimnames=list(c('feedback_messages_p1' + ,'totsize' + ,'totrevisions' + ,'totseconds ') + ,1:289)) > y <- array(NA,dim=c(4,289),dimnames=list(c('feedback_messages_p1','totsize','totrevisions','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 = 'yes' > par3 = '2' > par2 = 'quantiles' > par1 = '2' > #'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] "totsize" > x[,par1] [1] 112285 84786 83123 101193 38361 68504 119182 22807 17140 116174 [11] 57635 66198 71701 57793 80444 53855 97668 133824 101481 99645 [21] 114789 99052 67654 65553 97500 69112 82753 85323 72654 30727 [31] 77873 117478 74007 90183 61542 101494 27570 55813 79215 1423 [41] 55461 31081 22996 83122 70106 60578 39992 79892 49810 71570 [51] 100708 33032 82875 139077 71595 72260 5950 115762 32551 31701 [61] 80670 143558 117105 23789 120733 105195 73107 132068 149193 46821 [71] 87011 95260 55183 106671 73511 92945 78664 70054 22618 74011 [81] 83737 69094 93133 95536 225920 62133 61370 43836 106117 38692 [91] 84651 56622 15986 95364 26706 89691 67267 126846 41140 102860 [101] 51715 55801 111813 120293 138599 161647 115929 24266 162901 109825 [111] 129838 37510 43750 40652 87771 85872 89275 44418 192565 35232 [121] 40909 13294 32387 140867 120662 21233 44332 61056 101338 1168 [131] 13497 65567 25162 32334 40735 91413 855 97068 44339 14116 [141] 10288 65622 16563 76643 110681 29011 92696 94785 8773 83209 [151] 93815 86687 34553 105547 103487 213688 71220 23517 56926 91721 [161] 115168 111194 51009 135777 51513 74163 51633 75345 33416 83305 [171] 98952 102372 37238 103772 123969 27142 135400 21399 130115 24874 [181] 34988 45549 6023 64466 54990 1644 6179 3926 32755 34777 [191] 73224 27114 20760 37636 65461 30080 24094 69008 54968 46090 [201] 27507 10672 34029 46300 24760 18779 21280 40662 28987 22827 [211] 18513 30594 24006 27913 42744 12934 22574 41385 18653 18472 [221] 30976 63339 25568 33747 4154 19474 35130 39067 13310 65892 [231] 4143 28579 51776 21152 38084 27717 32928 11342 19499 16380 [241] 36874 48259 16734 28207 30143 41369 45833 29156 35944 36278 [251] 45588 45097 3895 28394 18632 2325 25139 27975 14483 13127 [261] 5839 24069 3738 18625 36341 24548 21792 26263 23686 49303 [271] 25659 28904 2781 29236 19546 22818 32689 5752 22197 20055 [281] 25272 82206 32073 5444 20154 36944 8019 30884 19540 > 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]) [ 855, 46090) [46090,225920] 145 144 > colnames(x) [1] "feedback_messages_p1" "totsize" "totrevisions" [4] "totseconds." > colnames(x)[par1] [1] "totsize" > x[,par1] [1] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [ 855, 46090) [6] [46090,225920] [46090,225920] [ 855, 46090) [ 855, 46090) [46090,225920] [11] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [16] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [21] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [26] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [ 855, 46090) [31] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [36] [46090,225920] [ 855, 46090) [46090,225920] [46090,225920] [ 855, 46090) [41] [46090,225920] [ 855, 46090) [ 855, 46090) [46090,225920] [46090,225920] [46] [46090,225920] [ 855, 46090) [46090,225920] [46090,225920] [46090,225920] [51] [46090,225920] [ 855, 46090) [46090,225920] [46090,225920] [46090,225920] [56] [46090,225920] [ 855, 46090) [46090,225920] [ 855, 46090) [ 855, 46090) [61] [46090,225920] [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [66] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [71] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [76] [46090,225920] [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [81] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [86] [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [ 855, 46090) [91] [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [ 855, 46090) [96] [46090,225920] [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [101] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [106] [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [46090,225920] [111] [46090,225920] [ 855, 46090) [ 855, 46090) [ 855, 46090) [46090,225920] [116] [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [ 855, 46090) [121] [ 855, 46090) [ 855, 46090) [ 855, 46090) [46090,225920] [46090,225920] [126] [ 855, 46090) [ 855, 46090) [46090,225920] [46090,225920] [ 855, 46090) [131] [ 855, 46090) [46090,225920] [ 855, 46090) [ 855, 46090) [ 855, 46090) [136] [46090,225920] [ 855, 46090) [46090,225920] [ 855, 46090) [ 855, 46090) [141] [ 855, 46090) [46090,225920] [ 855, 46090) [46090,225920] [46090,225920] [146] [ 855, 46090) [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [151] [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [46090,225920] [156] [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [46090,225920] [161] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [46090,225920] [166] [46090,225920] [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [171] [46090,225920] [46090,225920] [ 855, 46090) [46090,225920] [46090,225920] [176] [ 855, 46090) [46090,225920] [ 855, 46090) [46090,225920] [ 855, 46090) [181] [ 855, 46090) [ 855, 46090) [ 855, 46090) [46090,225920] [46090,225920] [186] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [191] [46090,225920] [ 855, 46090) [ 855, 46090) [ 855, 46090) [46090,225920] [196] [ 855, 46090) [ 855, 46090) [46090,225920] [46090,225920] [46090,225920] [201] [ 855, 46090) [ 855, 46090) [ 855, 46090) [46090,225920] [ 855, 46090) [206] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [211] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [216] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [221] [ 855, 46090) [46090,225920] [ 855, 46090) [ 855, 46090) [ 855, 46090) [226] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [46090,225920] [231] [ 855, 46090) [ 855, 46090) [46090,225920] [ 855, 46090) [ 855, 46090) [236] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [241] [ 855, 46090) [46090,225920] [ 855, 46090) [ 855, 46090) [ 855, 46090) [246] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [251] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [256] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [261] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [266] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [46090,225920] [271] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [276] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) [281] [ 855, 46090) [46090,225920] [ 855, 46090) [ 855, 46090) [ 855, 46090) [286] [ 855, 46090) [ 855, 46090) [ 855, 46090) [ 855, 46090) Levels: [ 855, 46090) [46090,225920] > 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/1lroj1324148917.tab") + } + } m.ct.i.pred m.ct.i.actu 1 2 1 1197 98 2 111 1182 [1] 0.9243243 [1] 0.9141531 [1] 0.9192427 m.ct.x.pred m.ct.x.actu 1 2 1 137 18 2 19 128 [1] 0.883871 [1] 0.8707483 [1] 0.8774834 > m Conditional inference tree with 4 terminal nodes Response: as.factor(totsize) Inputs: feedback_messages_p1, totrevisions, totseconds. Number of observations: 289 1) feedback_messages_p1 <= 83; criterion = 1, statistic = 158.726 2) totseconds. <= 48231; criterion = 1, statistic = 23.107 3)* weights = 120 2) totseconds. > 48231 4)* weights = 25 1) feedback_messages_p1 > 83 5) totrevisions <= 12770; criterion = 1, statistic = 26.253 6)* weights = 33 5) totrevisions > 12770 7)* weights = 111 > postscript(file="/var/wessaorg/rcomp/tmp/2pjki1324148917.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/3f1fd1324148917.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 1 [6,] 2 2 [7,] 2 2 [8,] 1 1 [9,] 1 1 [10,] 2 2 [11,] 2 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,] 2 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,] 1 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,] 1 1 [48,] 2 2 [49,] 2 2 [50,] 2 1 [51,] 2 2 [52,] 1 1 [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 1 [64,] 1 1 [65,] 2 2 [66,] 2 2 [67,] 2 2 [68,] 2 2 [69,] 2 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,] 1 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,] 1 2 [89,] 2 2 [90,] 1 2 [91,] 2 2 [92,] 2 1 [93,] 1 2 [94,] 2 2 [95,] 1 1 [96,] 2 2 [97,] 2 2 [98,] 2 2 [99,] 1 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 1 [109,] 2 2 [110,] 2 2 [111,] 2 2 [112,] 1 2 [113,] 1 1 [114,] 1 1 [115,] 2 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,] 1 2 [135,] 1 2 [136,] 2 2 [137,] 1 1 [138,] 2 2 [139,] 1 1 [140,] 1 1 [141,] 1 1 [142,] 2 1 [143,] 1 1 [144,] 2 2 [145,] 2 2 [146,] 1 1 [147,] 2 2 [148,] 2 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,] 2 1 [164,] 2 2 [165,] 2 2 [166,] 2 2 [167,] 2 2 [168,] 2 2 [169,] 1 1 [170,] 2 1 [171,] 2 2 [172,] 2 2 [173,] 1 1 [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,] 2 2 [192,] 1 1 [193,] 1 1 [194,] 1 1 [195,] 2 2 [196,] 1 1 [197,] 1 1 [198,] 2 1 [199,] 2 1 [200,] 2 1 [201,] 1 1 [202,] 1 1 [203,] 1 1 [204,] 2 1 [205,] 1 1 [206,] 1 1 [207,] 1 1 [208,] 1 1 [209,] 1 1 [210,] 1 2 [211,] 1 1 [212,] 1 1 [213,] 1 1 [214,] 1 1 [215,] 1 2 [216,] 1 2 [217,] 1 1 [218,] 1 1 [219,] 1 1 [220,] 1 1 [221,] 1 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,] 2 1 [234,] 1 1 [235,] 1 1 [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,] 1 1 [252,] 1 1 [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,] 1 1 [263,] 1 1 [264,] 1 1 [265,] 1 1 [266,] 1 1 [267,] 1 1 [268,] 1 1 [269,] 1 1 [270,] 2 1 [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,] 1 1 [282,] 2 1 [283,] 1 1 [284,] 1 1 [285,] 1 1 [286,] 1 1 [287,] 1 1 [288,] 1 1 [289,] 1 1 [ 855, 46090) [46090,225920] [ 855, 46090) 132 13 [46090,225920] 13 131 > postscript(file="/var/wessaorg/rcomp/tmp/4y0jc1324148917.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/5ljww1324148917.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/6rsnp1324148917.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/761811324148917.tab") + } > > try(system("convert tmp/2pjki1324148917.ps tmp/2pjki1324148917.png",intern=TRUE)) character(0) > try(system("convert tmp/3f1fd1324148917.ps tmp/3f1fd1324148917.png",intern=TRUE)) character(0) > try(system("convert tmp/4y0jc1324148917.ps tmp/4y0jc1324148917.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.599 0.267 3.864