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(146283 + ,112285 + ,94 + ,79 + ,98364 + ,84786 + ,103 + ,58 + ,86146 + ,83123 + ,93 + ,60 + ,96933 + ,101193 + ,103 + ,108 + ,79234 + ,38361 + ,51 + ,49 + ,42551 + ,68504 + ,70 + ,0 + ,195663 + ,119182 + ,91 + ,121 + ,6853 + ,22807 + ,22 + ,1 + ,21529 + ,17140 + ,38 + ,20 + ,95757 + ,116174 + ,93 + ,43 + ,85584 + ,57635 + ,60 + ,69 + ,143983 + ,66198 + ,123 + ,78 + ,75851 + ,71701 + ,148 + ,86 + ,59238 + ,57793 + ,90 + ,44 + ,93163 + ,80444 + ,124 + ,104 + ,96037 + ,53855 + ,70 + ,63 + ,151511 + ,97668 + ,168 + ,158 + ,136368 + ,133824 + ,115 + ,102 + ,112642 + ,101481 + ,71 + ,77 + ,94728 + ,99645 + ,66 + ,82 + ,105499 + ,114789 + ,134 + ,115 + ,121527 + ,99052 + ,117 + ,101 + ,127766 + ,67654 + ,108 + ,80 + ,98958 + ,65553 + ,84 + ,50 + ,77900 + ,97500 + ,156 + ,83 + ,85646 + ,69112 + ,120 + ,123 + ,98579 + ,82753 + ,114 + ,73 + ,130767 + ,85323 + ,94 + ,81 + ,131741 + ,72654 + ,120 + ,105 + ,53907 + ,30727 + ,81 + ,47 + ,178812 + ,77873 + ,110 + ,105 + ,146761 + ,117478 + ,133 + ,94 + ,82036 + ,74007 + ,122 + ,44 + ,163253 + ,90183 + ,158 + ,114 + ,27032 + ,61542 + ,109 + ,38 + ,171975 + ,101494 + ,124 + ,107 + ,65990 + ,27570 + ,39 + ,30 + ,86572 + ,55813 + ,92 + ,71 + ,159676 + ,79215 + ,126 + ,84 + ,1929 + ,1423 + ,0 + ,0 + ,85371 + ,55461 + ,70 + ,59 + ,58391 + ,31081 + ,37 + ,33 + ,31580 + ,22996 + ,38 + ,42 + ,136815 + ,83122 + ,120 + ,96 + ,120642 + ,70106 + ,93 + ,106 + ,69107 + ,60578 + ,95 + ,56 + ,50495 + ,39992 + ,77 + ,57 + ,108016 + ,79892 + ,90 + ,59 + ,46341 + ,49810 + ,80 + ,39 + ,78348 + ,71570 + ,31 + ,34 + ,79336 + ,100708 + ,110 + ,76 + ,56968 + ,33032 + ,66 + ,20 + ,93176 + ,82875 + ,138 + ,91 + ,161632 + ,139077 + ,133 + ,115 + ,87850 + ,71595 + ,113 + ,85 + ,127969 + ,72260 + ,100 + ,76 + ,15049 + ,5950 + ,7 + ,8 + ,155135 + ,115762 + ,140 + ,79 + ,25109 + ,32551 + ,61 + ,21 + ,45824 + ,31701 + ,41 + ,30 + ,102996 + ,80670 + ,96 + ,76 + ,160604 + ,143558 + ,164 + ,101 + ,158051 + ,117105 + ,78 + ,94 + ,44547 + ,23789 + ,49 + ,27 + ,162647 + ,120733 + ,102 + ,92 + ,174141 + ,105195 + ,124 + ,123 + ,60622 + ,73107 + ,99 + ,75 + ,179566 + ,132068 + ,129 + ,128 + ,184301 + ,149193 + ,62 + ,105 + ,75661 + ,46821 + ,73 + ,55 + ,96144 + ,87011 + ,114 + ,56 + ,129847 + ,95260 + ,99 + ,41 + ,117286 + ,55183 + ,70 + ,72 + ,71180 + ,106671 + ,104 + ,67 + ,109377 + ,73511 + ,116 + ,75 + ,85298 + ,92945 + ,91 + ,114 + ,73631 + ,78664 + ,74 + ,118 + ,86767 + ,70054 + ,138 + ,77 + ,23824 + ,22618 + ,67 + ,22 + ,93487 + ,74011 + ,151 + ,66 + ,82981 + ,83737 + ,72 + ,69 + ,73815 + ,69094 + ,120 + ,105 + ,94552 + ,93133 + ,115 + ,116 + ,132190 + ,95536 + ,105 + ,88 + ,128754 + ,225920 + ,104 + ,73 + ,66363 + ,62133 + ,108 + ,99 + ,67808 + ,61370 + ,98 + ,62 + ,61724 + ,43836 + ,69 + ,53 + ,131722 + ,106117 + ,111 + ,118 + ,68580 + ,38692 + ,99 + ,30 + ,106175 + ,84651 + ,71 + ,100 + ,55792 + ,56622 + ,27 + ,49 + ,25157 + ,15986 + ,69 + ,24 + ,76669 + ,95364 + ,107 + ,67 + ,57283 + ,26706 + ,73 + ,46 + ,105805 + ,89691 + ,107 + ,57 + ,129484 + ,67267 + ,93 + ,75 + ,72413 + ,126846 + ,129 + ,135 + ,87831 + ,41140 + ,69 + ,68 + ,96971 + ,102860 + ,118 + ,124 + ,71299 + ,51715 + ,73 + ,33 + ,77494 + ,55801 + ,119 + ,98 + ,120336 + ,111813 + ,104 + ,58 + ,93913 + ,120293 + ,107 + ,68 + ,136048 + ,138599 + ,99 + ,81 + ,181248 + ,161647 + ,90 + ,131 + ,146123 + ,115929 + ,197 + ,110 + ,32036 + ,24266 + ,36 + ,37 + ,186646 + ,162901 + ,85 + ,130 + ,102255 + ,109825 + ,139 + ,93 + ,168237 + ,129838 + ,106 + ,118 + ,64219 + ,37510 + ,50 + ,39 + ,19630 + ,43750 + ,64 + ,13 + ,76825 + ,40652 + ,31 + ,74 + ,115338 + ,87771 + ,63 + ,81 + ,109427 + ,85872 + ,92 + ,109 + ,118168 + ,89275 + ,106 + ,151 + ,84845 + ,44418 + ,63 + ,51 + ,153197 + ,192565 + ,69 + ,28 + ,29877 + ,35232 + ,41 + ,40 + ,63506 + ,40909 + ,56 + ,56 + ,22445 + ,13294 + ,25 + ,27 + ,47695 + ,32387 + ,65 + ,37 + ,68370 + ,140867 + ,93 + ,83 + ,146304 + ,120662 + ,114 + ,54 + ,38233 + ,21233 + ,38 + ,27 + ,42071 + ,44332 + ,44 + ,28 + ,50517 + ,61056 + ,87 + ,59 + ,103950 + ,101338 + ,110 + ,133 + ,5841 + ,1168 + ,0 + ,12 + ,2341 + ,13497 + ,27 + ,0 + ,84396 + ,65567 + ,83 + ,106 + ,24610 + ,25162 + ,30 + ,23 + ,35753 + ,32334 + ,80 + ,44 + ,55515 + ,40735 + ,98 + ,71 + ,209056 + ,91413 + ,82 + ,116 + ,6622 + ,855 + ,0 + ,4 + ,115814 + ,97068 + ,60 + ,62 + ,11609 + ,44339 + ,28 + ,12 + ,13155 + ,14116 + ,9 + ,18 + ,18274 + ,10288 + ,33 + ,14 + ,72875 + ,65622 + ,59 + ,60 + ,10112 + ,16563 + ,49 + ,7 + ,142775 + ,76643 + ,115 + ,98 + ,68847 + ,110681 + ,140 + ,64 + ,17659 + ,29011 + ,49 + ,29 + ,20112 + ,92696 + ,120 + ,32 + ,61023 + ,94785 + ,66 + ,25 + ,13983 + ,8773 + ,21 + ,16 + ,65176 + ,83209 + ,124 + ,48 + ,132432 + ,93815 + ,152 + ,100 + ,112494 + ,86687 + ,139 + ,46 + ,45109 + ,34553 + ,38 + ,45 + ,170875 + ,105547 + ,144 + ,129 + ,180759 + ,103487 + ,120 + ,130 + ,214921 + ,213688 + ,160 + ,136 + ,100226 + ,71220 + ,114 + ,59 + ,32043 + ,23517 + ,39 + ,25 + ,54454 + ,56926 + ,78 + ,32 + ,78876 + ,91721 + ,119 + ,63 + ,170745 + ,115168 + ,141 + ,95 + ,6940 + ,111194 + ,101 + ,14 + ,49025 + ,51009 + ,56 + ,36 + ,122037 + ,135777 + ,133 + ,113 + ,53782 + ,51513 + ,83 + ,47 + ,127748 + ,74163 + ,116 + ,92 + ,86839 + ,51633 + ,90 + ,70 + ,44830 + ,75345 + ,36 + ,19 + ,77395 + ,33416 + ,50 + ,50 + ,89324 + ,83305 + ,61 + ,41 + ,103300 + ,98952 + ,97 + ,91 + ,112283 + ,102372 + ,98 + ,111 + ,10901 + ,37238 + ,78 + ,41 + ,120691 + ,103772 + ,117 + ,120 + ,58106 + ,123969 + ,148 + ,135 + ,57140 + ,27142 + ,41 + ,27 + ,122422 + ,135400 + ,105 + ,87 + ,25899 + ,21399 + ,55 + ,25 + ,139296 + ,130115 + ,132 + ,131 + ,52678 + ,24874 + ,44 + ,45 + ,23853 + ,34988 + ,21 + ,29 + ,17306 + ,45549 + ,50 + ,58 + ,7953 + ,6023 + ,0 + ,4 + ,89455 + ,64466 + ,73 + ,47 + ,147866 + ,54990 + ,86 + ,109 + ,4245 + ,1644 + ,0 + ,7 + ,21509 + ,6179 + ,13 + ,12 + ,7670 + ,3926 + ,4 + ,0 + ,66675 + ,32755 + ,57 + ,37 + ,14336 + ,34777 + ,48 + ,37 + ,53608 + ,73224 + ,46 + ,46 + ,30059 + ,27114 + ,48 + ,15 + ,29668 + ,20760 + ,32 + ,42 + ,22097 + ,37636 + ,68 + ,7 + ,96841 + ,65461 + ,87 + ,54 + ,41907 + ,30080 + ,43 + ,54 + ,27080 + ,24094 + ,67 + ,14 + ,35885 + ,69008 + ,46 + ,16 + ,41247 + ,54968 + ,46 + ,33 + ,28313 + ,46090 + ,56 + ,32 + ,36845 + ,27507 + ,48 + ,21 + ,16548 + ,10672 + ,44 + ,15 + ,36134 + ,34029 + ,60 + ,38 + ,55764 + ,46300 + ,65 + ,22 + ,28910 + ,24760 + ,55 + ,28 + ,13339 + ,18779 + ,38 + ,10 + ,25319 + ,21280 + ,52 + ,31 + ,66956 + ,40662 + ,60 + ,32 + ,47487 + ,28987 + ,54 + ,32 + ,52785 + ,22827 + ,86 + ,43 + ,44683 + ,18513 + ,24 + ,27 + ,35619 + ,30594 + ,52 + ,37 + ,21920 + ,24006 + ,49 + ,20 + ,45608 + ,27913 + ,61 + ,32 + ,7721 + ,42744 + ,61 + ,0 + ,20634 + ,12934 + ,81 + ,5 + ,29788 + ,22574 + ,43 + ,26 + ,31931 + ,41385 + ,40 + ,10 + ,37754 + ,18653 + ,40 + ,27 + ,32505 + ,18472 + ,56 + ,11 + ,40557 + ,30976 + ,68 + ,29 + ,94238 + ,63339 + ,79 + ,25 + ,44197 + ,25568 + ,47 + ,55 + ,43228 + ,33747 + ,57 + ,23 + ,4103 + ,4154 + ,41 + ,5 + ,44144 + ,19474 + ,29 + ,43 + ,32868 + ,35130 + ,3 + ,23 + ,27640 + ,39067 + ,60 + ,34 + ,14063 + ,13310 + ,30 + ,36 + ,28990 + ,65892 + ,79 + ,35 + ,4694 + ,4143 + ,47 + ,0 + ,42648 + ,28579 + ,40 + ,37 + ,64329 + ,51776 + ,48 + ,28 + ,21928 + ,21152 + ,36 + ,16 + ,25836 + ,38084 + ,42 + ,26 + ,22779 + ,27717 + ,49 + ,38 + ,40820 + ,32928 + ,57 + ,23 + ,27530 + ,11342 + ,12 + ,22 + ,32378 + ,19499 + ,40 + ,30 + ,10824 + ,16380 + ,43 + ,16 + ,39613 + ,36874 + ,33 + ,18 + ,60865 + ,48259 + ,77 + ,28 + ,19787 + ,16734 + ,43 + ,32 + ,20107 + ,28207 + ,45 + ,21 + ,36605 + ,30143 + ,47 + ,23 + ,40961 + ,41369 + ,43 + ,29 + ,48231 + ,45833 + ,45 + ,50 + ,39725 + ,29156 + ,50 + ,12 + ,21455 + ,35944 + ,35 + ,21 + ,23430 + ,36278 + ,7 + ,18 + ,62991 + ,45588 + ,71 + ,27 + ,49363 + ,45097 + ,67 + ,41 + ,9604 + ,3895 + ,0 + ,13 + ,24552 + ,28394 + ,62 + ,12 + ,31493 + ,18632 + ,54 + ,21 + ,3439 + ,2325 + ,4 + ,8 + ,19555 + ,25139 + ,25 + ,26 + ,21228 + ,27975 + ,40 + ,27 + ,23177 + ,14483 + ,38 + ,13 + ,22094 + ,13127 + ,19 + ,16 + ,2342 + ,5839 + ,17 + ,2 + ,38798 + ,24069 + ,67 + ,42 + ,3255 + ,3738 + ,14 + ,5 + ,24261 + ,18625 + ,30 + ,37 + ,18511 + ,36341 + ,54 + ,17 + ,40798 + ,24548 + ,35 + ,38 + ,28893 + ,21792 + ,59 + ,37 + ,21425 + ,26263 + ,24 + ,29 + ,50276 + ,23686 + ,58 + ,32 + ,37643 + ,49303 + ,42 + ,35 + ,30377 + ,25659 + ,46 + ,17 + ,27126 + ,28904 + ,61 + ,20 + ,13 + ,2781 + ,3 + ,7 + ,42097 + ,29236 + ,52 + ,46 + ,24451 + ,19546 + ,25 + ,24 + ,14335 + ,22818 + ,40 + ,40 + ,5084 + ,32689 + ,32 + ,3 + ,9927 + ,5752 + ,4 + ,10 + ,43527 + ,22197 + ,49 + ,37 + ,27184 + ,20055 + ,63 + ,17 + ,21610 + ,25272 + ,67 + ,28 + ,20484 + ,82206 + ,32 + ,19 + ,20156 + ,32073 + ,23 + ,29 + ,6012 + ,5444 + ,7 + ,8 + ,18475 + ,20154 + ,54 + ,10 + ,12645 + ,36944 + ,37 + ,15 + ,11017 + ,8019 + ,35 + ,15 + ,37623 + ,30884 + ,51 + ,28 + ,35873 + ,19540 + ,39 + ,17) + ,dim=c(4 + ,289) + ,dimnames=list(c('Tot._Sec' + ,'Tot._Size' + ,'#Feedback>p120' + ,'#Blogged_comp.') + ,1:289)) > y <- array(NA,dim=c(4,289),dimnames=list(c('Tot._Sec','Tot._Size','#Feedback>p120','#Blogged_comp.'),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 = '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] "Tot._Size" > 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 1168 1423 1644 2325 2781 3738 3895 3926 4143 4154 1 1 1 1 1 1 1 1 1 1 1 5444 5752 5839 5950 6023 6179 8019 8773 10288 10672 11342 1 1 1 1 1 1 1 1 1 1 1 12934 13127 13294 13310 13497 14116 14483 15986 16380 16563 16734 1 1 1 1 1 1 1 1 1 1 1 17140 18472 18513 18625 18632 18653 18779 19474 19499 19540 19546 1 1 1 1 1 1 1 1 1 1 1 20055 20154 20760 21152 21233 21280 21399 21792 22197 22574 22618 1 1 1 1 1 1 1 1 1 1 1 22807 22818 22827 22996 23517 23686 23789 24006 24069 24094 24266 1 1 1 1 1 1 1 1 1 1 1 24548 24760 24874 25139 25162 25272 25568 25659 26263 26706 27114 1 1 1 1 1 1 1 1 1 1 1 27142 27507 27570 27717 27913 27975 28207 28394 28579 28904 28987 1 1 1 1 1 1 1 1 1 1 1 29011 29156 29236 30080 30143 30594 30727 30884 30976 31081 31701 1 1 1 1 1 1 1 1 1 1 1 32073 32334 32387 32551 32689 32755 32928 33032 33416 33747 34029 1 1 1 1 1 1 1 1 1 1 1 34553 34777 34988 35130 35232 35944 36278 36341 36874 36944 37238 1 1 1 1 1 1 1 1 1 1 1 37510 37636 38084 38361 38692 39067 39992 40652 40662 40735 40909 1 1 1 1 1 1 1 1 1 1 1 41140 41369 41385 42744 43750 43836 44332 44339 44418 45097 45549 1 1 1 1 1 1 1 1 1 1 1 45588 45833 46090 46300 46821 48259 49303 49810 51009 51513 51633 1 1 1 1 1 1 1 1 1 1 1 51715 51776 53855 54968 54990 55183 55461 55801 55813 56622 56926 1 1 1 1 1 1 1 1 1 1 1 57635 57793 60578 61056 61370 61542 62133 63339 64466 65461 65553 1 1 1 1 1 1 1 1 1 1 1 65567 65622 65892 66198 67267 67654 68504 69008 69094 69112 70054 1 1 1 1 1 1 1 1 1 1 1 70106 71220 71570 71595 71701 72260 72654 73107 73224 73511 74007 1 1 1 1 1 1 1 1 1 1 1 74011 74163 75345 76643 77873 78664 79215 79892 80444 80670 82206 1 1 1 1 1 1 1 1 1 1 1 82753 82875 83122 83123 83209 83305 83737 84651 84786 85323 85872 1 1 1 1 1 1 1 1 1 1 1 86687 87011 87771 89275 89691 90183 91413 91721 92696 92945 93133 1 1 1 1 1 1 1 1 1 1 1 93815 94785 95260 95364 95536 97068 97500 97668 98952 99052 99645 1 1 1 1 1 1 1 1 1 1 1 100708 101193 101338 101481 101494 102372 102860 103487 103772 105195 105547 1 1 1 1 1 1 1 1 1 1 1 106117 106671 109825 110681 111194 111813 112285 114789 115168 115762 115929 1 1 1 1 1 1 1 1 1 1 1 116174 117105 117478 119182 120293 120662 120733 123969 126846 129838 130115 1 1 1 1 1 1 1 1 1 1 1 132068 133824 135400 135777 138599 139077 140867 143558 149193 161647 162901 1 1 1 1 1 1 1 1 1 1 1 192565 213688 225920 1 1 1 > colnames(x) [1] "Tot._Sec" "Tot._Size" "X.Feedback.p120" "X.Blogged_comp." > colnames(x)[par1] [1] "Tot._Size" > 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 == '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/1s8dn1324672386.tab") + } + } > m Conditional inference tree with 9 terminal nodes Response: Tot._Size Inputs: Tot._Sec, X.Feedback.p120, X.Blogged_comp. Number of observations: 289 1) Tot._Sec <= 67808; criterion = 1, statistic = 195.162 2) X.Feedback.p120 <= 86; criterion = 1, statistic = 75.84 3) Tot._Sec <= 16548; criterion = 1, statistic = 48.545 4) X.Feedback.p120 <= 21; criterion = 1, statistic = 15.178 5)* weights = 16 4) X.Feedback.p120 > 21 6)* weights = 17 3) Tot._Sec > 16548 7) Tot._Sec <= 44683; criterion = 1, statistic = 17.795 8)* weights = 89 7) Tot._Sec > 44683 9)* weights = 34 2) X.Feedback.p120 > 86 10)* weights = 11 1) Tot._Sec > 67808 11) Tot._Sec <= 120642; criterion = 1, statistic = 36.68 12) X.Feedback.p120 <= 90; criterion = 0.999, statistic = 13.682 13) Tot._Sec <= 87831; criterion = 0.988, statistic = 8.235 14)* weights = 15 13) Tot._Sec > 87831 15)* weights = 13 12) X.Feedback.p120 > 90 16)* weights = 45 11) Tot._Sec > 120642 17)* weights = 49 > postscript(file="/var/www/rcomp/tmp/2dqkk1324672386.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/3y2vi1324672386.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 112285 113150.51 -865.51020 2 84786 88767.27 -3981.26667 3 83123 88767.27 -5644.26667 4 101193 88767.27 12425.73333 5 38361 55094.13 -16733.13333 6 68504 29065.75 39438.24719 7 119182 113150.51 6031.48980 8 22807 22345.47 461.52941 9 17140 29065.75 -11925.75281 10 116174 88767.27 27406.73333 11 57635 55094.13 2540.86667 12 66198 113150.51 -46952.51020 13 71701 88767.27 -17066.26667 14 57793 75345.82 -17552.81818 15 80444 88767.27 -8323.26667 16 53855 77051.54 -23196.53846 17 97668 113150.51 -15482.51020 18 133824 113150.51 20673.48980 19 101481 77051.54 24429.46154 20 99645 77051.54 22593.46154 21 114789 88767.27 26021.73333 22 99052 113150.51 -14098.51020 23 67654 113150.51 -45496.51020 24 65553 77051.54 -11498.53846 25 97500 88767.27 8732.73333 26 69112 88767.27 -19655.26667 27 82753 88767.27 -6014.26667 28 85323 113150.51 -27827.51020 29 72654 113150.51 -40496.51020 30 30727 42086.38 -11359.38235 31 77873 113150.51 -35277.51020 32 117478 113150.51 4327.48980 33 74007 88767.27 -14760.26667 34 90183 113150.51 -22967.51020 35 61542 75345.82 -13803.81818 36 101494 113150.51 -11656.51020 37 27570 42086.38 -14516.38235 38 55813 88767.27 -32954.26667 39 79215 113150.51 -33935.51020 40 1423 4603.25 -3180.25000 41 55461 55094.13 366.86667 42 31081 42086.38 -11005.38235 43 22996 29065.75 -6069.75281 44 83122 113150.51 -30028.51020 45 70106 88767.27 -18661.26667 46 60578 88767.27 -28189.26667 47 39992 42086.38 -2094.38235 48 79892 77051.54 2840.46154 49 49810 42086.38 7723.61765 50 71570 55094.13 16475.86667 51 100708 88767.27 11940.73333 52 33032 42086.38 -9054.38235 53 82875 88767.27 -5892.26667 54 139077 113150.51 25926.48980 55 71595 88767.27 -17172.26667 56 72260 113150.51 -40890.51020 57 5950 4603.25 1346.75000 58 115762 113150.51 2611.48980 59 32551 29065.75 3485.24719 60 31701 42086.38 -10385.38235 61 80670 88767.27 -8097.26667 62 143558 113150.51 30407.48980 63 117105 113150.51 3954.48980 64 23789 29065.75 -5276.75281 65 120733 113150.51 7582.48980 66 105195 113150.51 -7955.51020 67 73107 75345.82 -2238.81818 68 132068 113150.51 18917.48980 69 149193 113150.51 36042.48980 70 46821 55094.13 -8273.13333 71 87011 88767.27 -1756.26667 72 95260 113150.51 -17890.51020 73 55183 77051.54 -21868.53846 74 106671 88767.27 17903.73333 75 73511 88767.27 -15256.26667 76 92945 88767.27 4177.73333 77 78664 55094.13 23569.86667 78 70054 88767.27 -18713.26667 79 22618 29065.75 -6447.75281 80 74011 88767.27 -14756.26667 81 83737 55094.13 28642.86667 82 69094 88767.27 -19673.26667 83 93133 88767.27 4365.73333 84 95536 113150.51 -17614.51020 85 225920 113150.51 112769.48980 86 62133 75345.82 -13212.81818 87 61370 75345.82 -13975.81818 88 43836 42086.38 1749.61765 89 106117 113150.51 -7033.51020 90 38692 88767.27 -50075.26667 91 84651 77051.54 7599.46154 92 56622 42086.38 14535.61765 93 15986 29065.75 -13079.75281 94 95364 88767.27 6596.73333 95 26706 42086.38 -15380.38235 96 89691 88767.27 923.73333 97 67267 113150.51 -45883.51020 98 126846 88767.27 38078.73333 99 41140 55094.13 -13954.13333 100 102860 88767.27 14092.73333 101 51715 55094.13 -3379.13333 102 55801 88767.27 -32966.26667 103 111813 88767.27 23045.73333 104 120293 88767.27 31525.73333 105 138599 113150.51 25448.48980 106 161647 113150.51 48496.48980 107 115929 113150.51 2778.48980 108 24266 29065.75 -4799.75281 109 162901 113150.51 49750.48980 110 109825 88767.27 21057.73333 111 129838 113150.51 16687.48980 112 37510 42086.38 -4576.38235 113 43750 29065.75 14684.24719 114 40652 55094.13 -14442.13333 115 87771 77051.54 10719.46154 116 85872 88767.27 -2895.26667 117 89275 88767.27 507.73333 118 44418 55094.13 -10676.13333 119 192565 113150.51 79414.48980 120 35232 29065.75 6166.24719 121 40909 42086.38 -1177.38235 122 13294 29065.75 -15771.75281 123 32387 42086.38 -9699.38235 124 140867 88767.27 52099.73333 125 120662 113150.51 7511.48980 126 21233 29065.75 -7832.75281 127 44332 29065.75 15266.24719 128 61056 75345.82 -14289.81818 129 101338 88767.27 12570.73333 130 1168 4603.25 -3435.25000 131 13497 22345.47 -8848.47059 132 65567 55094.13 10472.86667 133 25162 29065.75 -3903.75281 134 32334 29065.75 3268.24719 135 40735 75345.82 -34610.81818 136 91413 113150.51 -21737.51020 137 855 4603.25 -3748.25000 138 97068 77051.54 20016.46154 139 44339 22345.47 21993.52941 140 14116 4603.25 9512.75000 141 10288 29065.75 -18777.75281 142 65622 55094.13 10527.86667 143 16563 22345.47 -5782.47059 144 76643 113150.51 -36507.51020 145 110681 88767.27 21913.73333 146 29011 29065.75 -54.75281 147 92696 75345.82 17350.18182 148 94785 42086.38 52698.61765 149 8773 4603.25 4169.75000 150 83209 75345.82 7863.18182 151 93815 113150.51 -19335.51020 152 86687 88767.27 -2080.26667 153 34553 42086.38 -7533.38235 154 105547 113150.51 -7603.51020 155 103487 113150.51 -9663.51020 156 213688 113150.51 100537.48980 157 71220 88767.27 -17547.26667 158 23517 29065.75 -5548.75281 159 56926 42086.38 14839.61765 160 91721 88767.27 2953.73333 161 115168 113150.51 2017.48980 162 111194 75345.82 35848.18182 163 51009 42086.38 8922.61765 164 135777 113150.51 22626.48980 165 51513 42086.38 9426.61765 166 74163 113150.51 -38987.51020 167 51633 55094.13 -3461.13333 168 75345 42086.38 33258.61765 169 33416 55094.13 -21678.13333 170 83305 77051.54 6253.46154 171 98952 88767.27 10184.73333 172 102372 88767.27 13604.73333 173 37238 22345.47 14892.52941 174 103772 113150.51 -9378.51020 175 123969 75345.82 48623.18182 176 27142 42086.38 -14944.38235 177 135400 113150.51 22249.48980 178 21399 29065.75 -7666.75281 179 130115 113150.51 16964.48980 180 24874 42086.38 -17212.38235 181 34988 29065.75 5922.24719 182 45549 29065.75 16483.24719 183 6023 4603.25 1419.75000 184 64466 77051.54 -12585.53846 185 54990 113150.51 -58160.51020 186 1644 4603.25 -2959.25000 187 6179 29065.75 -22886.75281 188 3926 4603.25 -677.25000 189 32755 42086.38 -9331.38235 190 34777 22345.47 12431.52941 191 73224 42086.38 31137.61765 192 27114 29065.75 -1951.75281 193 20760 29065.75 -8305.75281 194 37636 29065.75 8570.24719 195 65461 77051.54 -11590.53846 196 30080 29065.75 1014.24719 197 24094 29065.75 -4971.75281 198 69008 29065.75 39942.24719 199 54968 29065.75 25902.24719 200 46090 29065.75 17024.24719 201 27507 29065.75 -1558.75281 202 10672 22345.47 -11673.47059 203 34029 29065.75 4963.24719 204 46300 42086.38 4213.61765 205 24760 29065.75 -4305.75281 206 18779 22345.47 -3566.47059 207 21280 29065.75 -7785.75281 208 40662 42086.38 -1424.38235 209 28987 42086.38 -13099.38235 210 22827 42086.38 -19259.38235 211 18513 29065.75 -10552.75281 212 30594 29065.75 1528.24719 213 24006 29065.75 -5059.75281 214 27913 42086.38 -14173.38235 215 42744 22345.47 20398.52941 216 12934 29065.75 -16131.75281 217 22574 29065.75 -6491.75281 218 41385 29065.75 12319.24719 219 18653 29065.75 -10412.75281 220 18472 29065.75 -10593.75281 221 30976 29065.75 1910.24719 222 63339 77051.54 -13712.53846 223 25568 29065.75 -3497.75281 224 33747 29065.75 4681.24719 225 4154 22345.47 -18191.47059 226 19474 29065.75 -9591.75281 227 35130 29065.75 6064.24719 228 39067 29065.75 10001.24719 229 13310 22345.47 -9035.47059 230 65892 29065.75 36826.24719 231 4143 22345.47 -18202.47059 232 28579 29065.75 -486.75281 233 51776 42086.38 9689.61765 234 21152 29065.75 -7913.75281 235 38084 29065.75 9018.24719 236 27717 29065.75 -1348.75281 237 32928 29065.75 3862.24719 238 11342 29065.75 -17723.75281 239 19499 29065.75 -9566.75281 240 16380 22345.47 -5965.47059 241 36874 29065.75 7808.24719 242 48259 42086.38 6172.61765 243 16734 29065.75 -12331.75281 244 28207 29065.75 -858.75281 245 30143 29065.75 1077.24719 246 41369 29065.75 12303.24719 247 45833 42086.38 3746.61765 248 29156 29065.75 90.24719 249 35944 29065.75 6878.24719 250 36278 29065.75 7212.24719 251 45588 42086.38 3501.61765 252 45097 42086.38 3010.61765 253 3895 4603.25 -708.25000 254 28394 29065.75 -671.75281 255 18632 29065.75 -10433.75281 256 2325 4603.25 -2278.25000 257 25139 29065.75 -3926.75281 258 27975 29065.75 -1090.75281 259 14483 29065.75 -14582.75281 260 13127 29065.75 -15938.75281 261 5839 4603.25 1235.75000 262 24069 29065.75 -4996.75281 263 3738 4603.25 -865.25000 264 18625 29065.75 -10440.75281 265 36341 29065.75 7275.24719 266 24548 29065.75 -4517.75281 267 21792 29065.75 -7273.75281 268 26263 29065.75 -2802.75281 269 23686 42086.38 -18400.38235 270 49303 29065.75 20237.24719 271 25659 29065.75 -3406.75281 272 28904 29065.75 -161.75281 273 2781 4603.25 -1822.25000 274 29236 29065.75 170.24719 275 19546 29065.75 -9519.75281 276 22818 22345.47 472.52941 277 32689 22345.47 10343.52941 278 5752 4603.25 1148.75000 279 22197 29065.75 -6868.75281 280 20055 29065.75 -9010.75281 281 25272 29065.75 -3793.75281 282 82206 29065.75 53140.24719 283 32073 29065.75 3007.24719 284 5444 4603.25 840.75000 285 20154 29065.75 -8911.75281 286 36944 22345.47 14598.52941 287 8019 22345.47 -14326.47059 288 30884 29065.75 1818.24719 289 19540 29065.75 -9525.75281 > 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/44y9i1324672386.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/5nkfm1324672386.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/6evb01324672386.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/7dgnm1324672386.tab") + } > > try(system("convert tmp/2dqkk1324672386.ps tmp/2dqkk1324672386.png",intern=TRUE)) character(0) > try(system("convert tmp/3y2vi1324672386.ps tmp/3y2vi1324672386.png",intern=TRUE)) character(0) > try(system("convert tmp/44y9i1324672386.ps tmp/44y9i1324672386.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.440 0.120 4.551