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(276257 + ,492 + ,3 + ,41 + ,126 + ,140824 + ,32033 + ,165 + ,165 + ,180480 + ,436 + ,4 + ,34 + ,127 + ,110459 + ,20654 + ,135 + ,132 + ,229040 + ,694 + ,16 + ,44 + ,111 + ,105079 + ,16346 + ,121 + ,121 + ,218443 + ,1137 + ,2 + ,38 + ,133 + ,112098 + ,35926 + ,148 + ,145 + ,171533 + ,380 + ,1 + ,27 + ,64 + ,43929 + ,10621 + ,73 + ,71 + ,70849 + ,179 + ,3 + ,35 + ,89 + ,76173 + ,10024 + ,49 + ,47 + ,536497 + ,2354 + ,0 + ,33 + ,122 + ,187326 + ,43068 + ,185 + ,177 + ,33186 + ,111 + ,0 + ,18 + ,22 + ,22807 + ,1271 + ,5 + ,5 + ,217320 + ,740 + ,7 + ,34 + ,117 + ,144408 + ,34416 + ,125 + ,124 + ,213274 + ,595 + ,0 + ,33 + ,82 + ,66485 + ,20318 + ,93 + ,92 + ,310843 + ,809 + ,0 + ,46 + ,147 + ,79089 + ,24409 + ,154 + ,149 + ,242788 + ,693 + ,7 + ,57 + ,192 + ,81625 + ,20648 + ,98 + ,93 + ,195022 + ,738 + ,10 + ,37 + ,113 + ,68788 + ,12347 + ,70 + ,70 + ,367785 + ,1184 + ,4 + ,55 + ,171 + ,103297 + ,21857 + ,148 + ,148 + ,261990 + ,713 + ,10 + ,44 + ,87 + ,69446 + ,11034 + ,100 + ,100 + ,392509 + ,1729 + ,0 + ,62 + ,207 + ,114948 + ,33433 + ,150 + ,142 + ,335528 + ,844 + ,8 + ,40 + ,153 + ,167949 + ,35902 + ,197 + ,194 + ,376673 + ,1298 + ,4 + ,39 + ,92 + ,125081 + ,22355 + ,114 + ,113 + ,181980 + ,514 + ,3 + ,32 + ,95 + ,125818 + ,31219 + ,169 + ,162 + ,266736 + ,689 + ,8 + ,51 + ,193 + ,136588 + ,21983 + ,200 + ,186 + ,278265 + ,837 + ,0 + ,49 + ,160 + ,112431 + ,40085 + ,148 + ,147 + ,461287 + ,1330 + ,1 + ,39 + ,144 + ,103037 + ,18507 + ,140 + ,137 + ,195786 + ,491 + ,5 + ,25 + ,84 + ,82317 + ,16278 + ,74 + ,71 + ,197058 + ,622 + ,9 + ,56 + ,223 + ,118906 + ,24662 + ,128 + ,123 + ,250284 + ,1332 + ,1 + ,45 + ,154 + ,83515 + ,31452 + ,140 + ,134 + ,245373 + ,1043 + ,0 + ,38 + ,139 + ,104581 + ,32580 + ,116 + ,115 + ,274121 + ,1082 + ,5 + ,45 + ,142 + ,103129 + ,22883 + ,147 + ,138 + ,278027 + ,636 + ,0 + ,43 + ,148 + ,83243 + ,27652 + ,132 + ,125 + ,165597 + ,586 + ,0 + ,32 + ,99 + ,37110 + ,9845 + ,70 + ,66 + ,371452 + ,1170 + ,0 + ,41 + ,135 + ,113344 + ,20190 + ,144 + ,137 + ,295296 + ,973 + ,3 + ,50 + ,179 + ,139165 + ,46201 + ,155 + ,152 + ,248320 + ,721 + ,6 + ,50 + ,149 + ,86652 + ,10971 + ,165 + ,159 + ,351980 + ,863 + ,1 + ,51 + ,187 + ,112302 + ,34811 + ,161 + ,159 + ,101014 + ,343 + ,4 + ,37 + ,137 + ,69652 + ,3029 + ,31 + ,31 + ,412722 + ,1278 + ,4 + ,44 + ,163 + ,119442 + ,38941 + ,199 + ,185 + ,273950 + ,1186 + ,0 + ,42 + ,127 + ,69867 + ,4958 + ,78 + ,78 + ,425531 + ,1334 + ,0 + ,44 + ,151 + ,101629 + ,32344 + ,121 + ,117 + ,231912 + ,652 + ,2 + ,36 + ,89 + ,70168 + ,19433 + ,112 + ,109 + ,115658 + ,284 + ,1 + ,17 + ,46 + ,31081 + ,12558 + ,41 + ,41 + ,376008 + ,1273 + ,2 + ,43 + ,156 + ,103925 + ,36524 + ,158 + ,149 + ,335039 + ,1518 + ,10 + ,41 + ,128 + ,92622 + ,26041 + ,123 + ,123 + ,194127 + ,715 + ,10 + ,41 + ,111 + ,79011 + ,16637 + ,104 + ,103 + ,206947 + ,671 + ,5 + ,38 + ,114 + ,93487 + ,28395 + ,94 + ,87 + ,182286 + ,486 + ,6 + ,49 + ,148 + ,64520 + ,16747 + ,73 + ,71 + ,153778 + ,1022 + ,1 + ,45 + ,45 + ,93473 + ,9105 + ,52 + ,51 + ,457592 + ,2084 + ,2 + ,42 + ,134 + ,114360 + ,11941 + ,71 + ,70 + ,78800 + ,330 + ,2 + ,26 + ,66 + ,33032 + ,7935 + ,21 + ,21 + ,208277 + ,658 + ,0 + ,52 + ,180 + ,96125 + ,19499 + ,155 + ,155 + ,359144 + ,1385 + ,10 + ,50 + ,177 + ,151911 + ,22938 + ,174 + ,172 + ,184648 + ,930 + ,3 + ,45 + ,146 + ,89256 + ,25314 + ,136 + ,133 + ,234078 + ,620 + ,0 + ,40 + ,137 + ,95676 + ,28527 + ,128 + ,125 + ,24188 + ,218 + ,0 + ,4 + ,7 + ,5950 + ,2694 + ,7 + ,7 + ,380576 + ,840 + ,8 + ,44 + ,157 + ,149695 + ,20867 + ,165 + ,158 + ,65029 + ,255 + ,5 + ,18 + ,61 + ,32551 + ,3597 + ,21 + ,21 + ,101097 + ,454 + ,3 + ,14 + ,41 + ,31701 + ,5296 + ,35 + ,35 + ,288327 + ,1149 + ,1 + ,38 + ,123 + ,100087 + ,32982 + ,137 + ,133 + ,334829 + ,684 + ,5 + ,61 + ,228 + ,169707 + ,38975 + ,174 + ,169 + ,359400 + ,1190 + ,6 + ,39 + ,137 + ,150491 + ,42721 + ,257 + ,256 + ,369577 + ,1079 + ,0 + ,42 + ,150 + ,120192 + ,41455 + ,207 + ,190 + ,269961 + ,883 + ,12 + ,40 + ,141 + ,95893 + ,23923 + ,103 + ,100 + ,389738 + ,1331 + ,10 + ,51 + ,181 + ,151715 + ,26719 + ,171 + ,171 + ,309474 + ,1159 + ,12 + ,28 + ,73 + ,176225 + ,53405 + ,279 + ,267 + ,282769 + ,1217 + ,11 + ,43 + ,97 + ,59900 + ,12526 + ,83 + ,80 + ,269324 + ,946 + ,8 + ,42 + ,142 + ,104767 + ,26584 + ,130 + ,126 + ,234773 + ,579 + ,2 + ,37 + ,125 + ,114799 + ,37062 + ,131 + ,132 + ,237561 + ,474 + ,0 + ,30 + ,87 + ,72128 + ,25696 + ,126 + ,121 + ,211396 + ,626 + ,6 + ,39 + ,140 + ,143592 + ,24634 + ,158 + ,156 + ,240376 + ,843 + ,10 + ,44 + ,148 + ,89626 + ,27269 + ,138 + ,133 + ,247447 + ,893 + ,2 + ,36 + ,116 + ,131072 + ,25270 + ,200 + ,199 + ,181550 + ,633 + ,5 + ,28 + ,89 + ,126817 + ,24634 + ,104 + ,98 + ,242152 + ,873 + ,13 + ,47 + ,160 + ,81351 + ,17828 + ,111 + ,109 + ,73566 + ,385 + ,6 + ,23 + ,67 + ,22618 + ,3007 + ,26 + ,25 + ,246125 + ,729 + ,7 + ,48 + ,179 + ,88977 + ,20065 + ,115 + ,113 + ,199565 + ,774 + ,2 + ,38 + ,90 + ,92059 + ,24648 + ,127 + ,126 + ,222676 + ,769 + ,4 + ,42 + ,144 + ,81897 + ,21588 + ,140 + ,137 + ,363558 + ,996 + ,4 + ,46 + ,144 + ,108146 + ,25217 + ,121 + ,121 + ,365442 + ,1194 + ,3 + ,37 + ,135 + ,126372 + ,30927 + ,183 + ,178 + ,217036 + ,575 + ,6 + ,41 + ,125 + ,249771 + ,18487 + ,68 + ,63 + ,213466 + ,725 + ,2 + ,42 + ,146 + ,71154 + ,18050 + ,112 + ,109 + ,204477 + ,706 + ,0 + ,41 + ,121 + ,71571 + ,17696 + ,103 + ,101 + ,169080 + ,665 + ,1 + ,36 + ,109 + ,55918 + ,17326 + ,63 + ,61 + ,478396 + ,1259 + ,0 + ,45 + ,138 + ,160141 + ,39361 + ,166 + ,157 + ,145943 + ,653 + ,5 + ,26 + ,99 + ,38692 + ,9648 + ,38 + ,38 + ,288626 + ,694 + ,2 + ,44 + ,92 + ,102812 + ,26759 + ,163 + ,159 + ,80953 + ,437 + ,0 + ,8 + ,27 + ,56622 + ,7905 + ,59 + ,58 + ,150221 + ,822 + ,0 + ,27 + ,77 + ,15986 + ,4527 + ,27 + ,27 + ,179317 + ,458 + ,6 + ,38 + ,137 + ,123534 + ,41517 + ,108 + ,108 + ,395368 + ,1545 + ,1 + ,38 + ,140 + ,108535 + ,21261 + ,88 + ,83 + ,349460 + ,987 + ,0 + ,57 + ,122 + ,93879 + ,36099 + ,92 + ,88 + ,180679 + ,1051 + ,1 + ,45 + ,159 + ,144551 + ,39039 + ,170 + ,164 + ,286578 + ,838 + ,1 + ,40 + ,97 + ,56750 + ,13841 + ,98 + ,96 + ,274477 + ,703 + ,3 + ,42 + ,144 + ,127654 + ,23841 + ,205 + ,192 + ,195623 + ,613 + ,10 + ,31 + ,90 + ,65594 + ,8589 + ,96 + ,94 + ,282361 + ,1128 + ,1 + ,36 + ,135 + ,59938 + ,15049 + ,107 + ,107 + ,329121 + ,967 + ,4 + ,40 + ,147 + ,146975 + ,39038 + ,150 + ,144 + ,198658 + ,617 + ,4 + ,40 + ,155 + ,165904 + ,36774 + ,138 + ,136 + ,262630 + ,654 + ,5 + ,35 + ,127 + ,169265 + ,40076 + ,177 + ,171 + ,300481 + ,805 + ,0 + ,39 + ,104 + ,183500 + ,43840 + ,213 + ,210 + ,403404 + ,1355 + ,12 + ,65 + ,248 + ,165986 + ,43146 + ,208 + ,193 + ,406613 + ,1456 + ,13 + ,33 + ,116 + ,184923 + ,50099 + ,307 + ,297 + ,294371 + ,878 + ,8 + ,51 + ,176 + ,140358 + ,40312 + ,125 + ,125 + ,313267 + ,887 + ,0 + ,42 + ,133 + ,149959 + ,32616 + ,208 + ,204 + ,189276 + ,663 + ,0 + ,36 + ,59 + ,57224 + ,11338 + ,73 + ,70 + ,43287 + ,214 + ,4 + ,19 + ,64 + ,43750 + ,7409 + ,49 + ,49 + ,189520 + ,733 + ,4 + ,25 + ,40 + ,48029 + ,18213 + ,82 + ,82 + ,250254 + ,830 + ,0 + ,44 + ,98 + ,104978 + ,45873 + ,206 + ,205 + ,268886 + ,1174 + ,0 + ,40 + ,125 + ,100046 + ,39844 + ,112 + ,111 + ,314153 + ,1068 + ,0 + ,44 + ,135 + ,101047 + ,28317 + ,139 + ,135 + ,160308 + ,413 + ,0 + ,30 + ,83 + ,197426 + ,24797 + ,60 + ,59 + ,162843 + ,946 + ,0 + ,45 + ,138 + ,160902 + ,7471 + ,70 + ,70 + ,344925 + ,657 + ,5 + ,42 + ,149 + ,147172 + ,27259 + ,112 + ,108 + ,300526 + ,690 + ,0 + ,45 + ,115 + ,109432 + ,23201 + ,142 + ,141 + ,23623 + ,156 + ,0 + ,1 + ,0 + ,1168 + ,238 + ,11 + ,11 + ,195817 + ,779 + ,0 + ,40 + ,103 + ,83248 + ,28830 + ,130 + ,130 + ,61857 + ,192 + ,4 + ,11 + ,30 + ,25162 + ,3913 + ,31 + ,28 + ,163931 + ,461 + ,0 + ,45 + ,119 + ,45724 + ,9935 + ,132 + ,101 + ,428191 + ,1213 + ,1 + ,38 + ,102 + ,110529 + ,27738 + ,219 + ,216 + ,21054 + ,146 + ,0 + ,0 + ,0 + ,855 + ,338 + ,4 + ,4 + ,252805 + ,866 + ,5 + ,30 + ,77 + ,101382 + ,13326 + ,102 + ,97 + ,31961 + ,200 + ,0 + ,8 + ,9 + ,14116 + ,3988 + ,39 + ,39 + ,335888 + ,1290 + ,3 + ,41 + ,143 + ,89506 + ,24347 + ,125 + ,119 + ,246100 + ,715 + ,7 + ,48 + ,163 + ,135356 + ,27111 + ,121 + ,118 + ,180591 + ,514 + ,13 + ,48 + ,146 + ,116066 + ,3938 + ,42 + ,41 + ,163400 + ,697 + ,3 + ,32 + ,94 + ,144244 + ,17416 + ,111 + ,107 + ,38214 + ,276 + ,0 + ,8 + ,21 + ,8773 + ,1888 + ,16 + ,16 + ,224597 + ,752 + ,3 + ,43 + ,151 + ,102153 + ,18700 + ,70 + ,69 + ,357602 + ,1021 + ,0 + ,52 + ,187 + ,117440 + ,36809 + ,162 + ,160 + ,198104 + ,481 + ,0 + ,53 + ,171 + ,104128 + ,24959 + ,173 + ,158 + ,424398 + ,1626 + ,4 + ,49 + ,170 + ,134238 + ,37343 + ,171 + ,161 + ,348017 + ,884 + ,0 + ,48 + ,145 + ,134047 + ,21849 + ,172 + ,165 + ,421610 + ,1187 + ,3 + ,56 + ,198 + ,279488 + ,49809 + ,254 + ,246 + ,192170 + ,488 + ,0 + ,40 + ,137 + ,79756 + ,21654 + ,90 + ,89 + ,102510 + ,403 + ,0 + ,36 + ,100 + ,66089 + ,8728 + ,50 + ,49 + ,302158 + ,977 + ,4 + ,44 + ,162 + ,102070 + ,20920 + ,113 + ,107 + ,444599 + ,1525 + ,5 + ,46 + ,163 + ,146760 + ,27195 + ,187 + ,182 + ,148707 + ,551 + ,15 + ,43 + ,153 + ,154771 + ,1037 + ,16 + ,16 + ,407736 + ,1807 + ,5 + ,46 + ,161 + ,165933 + ,42570 + ,175 + ,173 + ,164406 + ,723 + ,5 + ,39 + ,112 + ,64593 + ,17672 + ,90 + ,90 + ,278077 + ,632 + ,2 + ,41 + ,135 + ,92280 + ,34245 + ,140 + ,140 + ,282461 + ,898 + ,1 + ,46 + ,124 + ,67150 + ,16786 + ,145 + ,142 + ,219544 + ,621 + ,0 + ,32 + ,45 + ,128692 + ,20954 + ,141 + ,126 + ,384177 + ,1606 + ,9 + ,45 + ,144 + ,124089 + ,16378 + ,125 + ,123 + ,246963 + ,811 + ,1 + ,39 + ,126 + ,125386 + ,31852 + ,241 + ,239 + ,173260 + ,716 + ,3 + ,21 + ,78 + ,37238 + ,2805 + ,16 + ,15 + ,336715 + ,1001 + ,11 + ,49 + ,149 + ,140015 + ,38086 + ,175 + ,170 + ,176654 + ,732 + ,5 + ,55 + ,196 + ,150047 + ,21166 + ,132 + ,123 + ,253341 + ,1024 + ,2 + ,36 + ,118 + ,154451 + ,34672 + ,154 + ,151 + ,307133 + ,831 + ,1 + ,48 + ,159 + ,156349 + ,36171 + ,198 + ,194 + ,1 + ,0 + ,9 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,14688 + ,85 + ,0 + ,0 + ,0 + ,6023 + ,2065 + ,5 + ,5 + ,98 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,455 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,260901 + ,773 + ,2 + ,43 + ,88 + ,84601 + ,19354 + ,125 + ,122 + ,409280 + ,1128 + ,3 + ,52 + ,129 + ,68946 + ,22124 + ,174 + ,173 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,203 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,7199 + ,74 + ,0 + ,0 + ,0 + ,1644 + ,556 + ,6 + ,6 + ,46660 + ,259 + ,0 + ,5 + ,13 + ,6179 + ,2089 + ,13 + ,13 + ,17547 + ,69 + ,0 + ,1 + ,4 + ,3926 + ,2658 + ,3 + ,3 + ,118589 + ,301 + ,0 + ,45 + ,82 + ,52789 + ,1813 + ,35 + ,35 + ,969 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,233108 + ,668 + ,2 + ,34 + ,71 + ,100350 + ,17372 + ,80 + ,72) + ,dim=c(9 + ,164) + ,dimnames=list(c('TotalTime' + ,'CourseCompendiumViews' + ,'SharedbyotherAuthors' + ,'ReviewedCompendiums' + ,'PeerReviews' + ,'CWnumberOfCharacters' + ,'CWNumberOfRevisions' + ,'CWNumberOfHyperlinks' + ,'CWNumberOfBlogs') + ,1:164)) > y <- array(NA,dim=c(9,164),dimnames=list(c('TotalTime','CourseCompendiumViews','SharedbyotherAuthors','ReviewedCompendiums','PeerReviews','CWnumberOfCharacters','CWNumberOfRevisions','CWNumberOfHyperlinks','CWNumberOfBlogs'),1:164)) > 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 = '6' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > library(party) Loading required package: survival Loading required package: splines Loading required package: grid Loading required package: modeltools Loading required package: stats4 Loading required package: coin Loading required package: mvtnorm Loading required package: zoo Loading required package: sandwich Loading required package: strucchange Loading required package: vcd Loading required package: MASS Loading required package: colorspace > library(Hmisc) Attaching package: 'Hmisc' The following object(s) are masked from 'package:survival': untangle.specials The following object(s) are masked from 'package:base': format.pval, round.POSIXt, trunc.POSIXt, units > par1 <- as.numeric(par1) > par3 <- as.numeric(par3) > x <- data.frame(t(y)) > is.data.frame(x) [1] TRUE > x <- x[!is.na(x[,par1]),] > k <- length(x[1,]) > n <- length(x[,1]) > colnames(x)[par1] [1] "CWnumberOfCharacters" > x[,par1] [1] 140824 110459 105079 112098 43929 76173 187326 22807 144408 66485 [11] 79089 81625 68788 103297 69446 114948 167949 125081 125818 136588 [21] 112431 103037 82317 118906 83515 104581 103129 83243 37110 113344 [31] 139165 86652 112302 69652 119442 69867 101629 70168 31081 103925 [41] 92622 79011 93487 64520 93473 114360 33032 96125 151911 89256 [51] 95676 5950 149695 32551 31701 100087 169707 150491 120192 95893 [61] 151715 176225 59900 104767 114799 72128 143592 89626 131072 126817 [71] 81351 22618 88977 92059 81897 108146 126372 249771 71154 71571 [81] 55918 160141 38692 102812 56622 15986 123534 108535 93879 144551 [91] 56750 127654 65594 59938 146975 165904 169265 183500 165986 184923 [101] 140358 149959 57224 43750 48029 104978 100046 101047 197426 160902 [111] 147172 109432 1168 83248 25162 45724 110529 855 101382 14116 [121] 89506 135356 116066 144244 8773 102153 117440 104128 134238 134047 [131] 279488 79756 66089 102070 146760 154771 165933 64593 92280 67150 [141] 128692 124089 125386 37238 140015 150047 154451 156349 0 6023 [151] 0 0 0 0 84601 68946 0 0 1644 6179 [161] 3926 52789 0 100350 > 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]) [0e+00,100350) [1e+05,279488] 82 82 > colnames(x) [1] "TotalTime" "CourseCompendiumViews" "SharedbyotherAuthors" [4] "ReviewedCompendiums" "PeerReviews" "CWnumberOfCharacters" [7] "CWNumberOfRevisions" "CWNumberOfHyperlinks" "CWNumberOfBlogs" > colnames(x)[par1] [1] "CWnumberOfCharacters" > x[,par1] [1] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [6] [0e+00,100350) [1e+05,279488] [0e+00,100350) [1e+05,279488] [0e+00,100350) [11] [0e+00,100350) [0e+00,100350) [0e+00,100350) [1e+05,279488] [0e+00,100350) [16] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [21] [1e+05,279488] [1e+05,279488] [0e+00,100350) [1e+05,279488] [0e+00,100350) [26] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [1e+05,279488] [31] [1e+05,279488] [0e+00,100350) [1e+05,279488] [0e+00,100350) [1e+05,279488] [36] [0e+00,100350) [1e+05,279488] [0e+00,100350) [0e+00,100350) [1e+05,279488] [41] [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [46] [1e+05,279488] [0e+00,100350) [0e+00,100350) [1e+05,279488] [0e+00,100350) [51] [0e+00,100350) [0e+00,100350) [1e+05,279488] [0e+00,100350) [0e+00,100350) [56] [0e+00,100350) [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [61] [1e+05,279488] [1e+05,279488] [0e+00,100350) [1e+05,279488] [1e+05,279488] [66] [0e+00,100350) [1e+05,279488] [0e+00,100350) [1e+05,279488] [1e+05,279488] [71] [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [76] [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [81] [0e+00,100350) [1e+05,279488] [0e+00,100350) [1e+05,279488] [0e+00,100350) [86] [0e+00,100350) [1e+05,279488] [1e+05,279488] [0e+00,100350) [1e+05,279488] [91] [0e+00,100350) [1e+05,279488] [0e+00,100350) [0e+00,100350) [1e+05,279488] [96] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [101] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [0e+00,100350) [106] [1e+05,279488] [0e+00,100350) [1e+05,279488] [1e+05,279488] [1e+05,279488] [111] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [0e+00,100350) [116] [0e+00,100350) [1e+05,279488] [0e+00,100350) [1e+05,279488] [0e+00,100350) [121] [0e+00,100350) [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [126] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [1e+05,279488] [131] [1e+05,279488] [0e+00,100350) [0e+00,100350) [1e+05,279488] [1e+05,279488] [136] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [0e+00,100350) [141] [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [1e+05,279488] [146] [1e+05,279488] [1e+05,279488] [1e+05,279488] [0e+00,100350) [0e+00,100350) [151] [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [156] [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [0e+00,100350) [161] [0e+00,100350) [0e+00,100350) [0e+00,100350) [1e+05,279488] Levels: [0e+00,100350) [1e+05,279488] > 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/1r4641324658945.tab") + } + } m.ct.i.pred m.ct.i.actu 1 2 1 592 146 2 137 604 [1] 0.802168 [1] 0.8151147 [1] 0.8086545 m.ct.x.pred m.ct.x.actu 1 2 1 62 20 2 26 53 [1] 0.7560976 [1] 0.6708861 [1] 0.7142857 > m Conditional inference tree with 5 terminal nodes Response: as.factor(CWnumberOfCharacters) Inputs: TotalTime, CourseCompendiumViews, SharedbyotherAuthors, ReviewedCompendiums, PeerReviews, CWNumberOfRevisions, CWNumberOfHyperlinks, CWNumberOfBlogs Number of observations: 164 1) CWNumberOfHyperlinks <= 140; criterion = 1, statistic = 61.934 2) PeerReviews <= 123; criterion = 1, statistic = 22.217 3) CWNumberOfRevisions <= 12558; criterion = 0.987, statistic = 9.934 4)* weights = 41 3) CWNumberOfRevisions > 12558 5)* weights = 24 2) PeerReviews > 123 6)* weights = 44 1) CWNumberOfHyperlinks > 140 7) CWNumberOfRevisions <= 24409; criterion = 0.994, statistic = 11.474 8)* weights = 15 7) CWNumberOfRevisions > 24409 9)* weights = 40 > postscript(file="/var/wessaorg/rcomp/tmp/2qwm71324658945.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/3q9yy1324658945.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 1 [4,] 2 2 [5,] 1 1 [6,] 1 1 [7,] 2 2 [8,] 1 1 [9,] 2 1 [10,] 1 1 [11,] 1 2 [12,] 1 2 [13,] 1 1 [14,] 2 2 [15,] 1 1 [16,] 2 2 [17,] 2 2 [18,] 2 1 [19,] 2 2 [20,] 2 2 [21,] 2 2 [22,] 2 2 [23,] 1 1 [24,] 2 2 [25,] 1 2 [26,] 2 2 [27,] 2 2 [28,] 1 2 [29,] 1 1 [30,] 2 2 [31,] 2 2 [32,] 1 2 [33,] 2 2 [34,] 1 2 [35,] 2 2 [36,] 1 2 [37,] 2 2 [38,] 1 1 [39,] 1 1 [40,] 2 2 [41,] 1 2 [42,] 1 1 [43,] 1 1 [44,] 1 2 [45,] 1 1 [46,] 2 2 [47,] 1 1 [48,] 1 2 [49,] 2 2 [50,] 1 2 [51,] 1 2 [52,] 1 1 [53,] 2 2 [54,] 1 1 [55,] 1 1 [56,] 1 1 [57,] 2 2 [58,] 2 2 [59,] 2 2 [60,] 1 2 [61,] 2 2 [62,] 2 2 [63,] 1 1 [64,] 2 2 [65,] 2 2 [66,] 1 1 [67,] 2 2 [68,] 1 2 [69,] 2 2 [70,] 2 1 [71,] 1 2 [72,] 1 1 [73,] 1 2 [74,] 1 1 [75,] 1 2 [76,] 2 2 [77,] 2 2 [78,] 2 2 [79,] 1 2 [80,] 1 1 [81,] 1 1 [82,] 2 2 [83,] 1 1 [84,] 2 2 [85,] 1 1 [86,] 1 1 [87,] 2 2 [88,] 2 2 [89,] 1 1 [90,] 2 2 [91,] 1 1 [92,] 2 2 [93,] 1 1 [94,] 1 2 [95,] 2 2 [96,] 2 2 [97,] 2 2 [98,] 2 2 [99,] 2 2 [100,] 2 2 [101,] 2 2 [102,] 2 2 [103,] 1 1 [104,] 1 1 [105,] 1 1 [106,] 2 2 [107,] 1 2 [108,] 2 2 [109,] 2 1 [110,] 2 2 [111,] 2 2 [112,] 2 2 [113,] 1 1 [114,] 1 1 [115,] 1 1 [116,] 1 1 [117,] 2 2 [118,] 1 1 [119,] 2 1 [120,] 1 1 [121,] 1 2 [122,] 2 2 [123,] 2 2 [124,] 2 1 [125,] 1 1 [126,] 2 2 [127,] 2 2 [128,] 2 2 [129,] 2 2 [130,] 2 2 [131,] 2 2 [132,] 1 2 [133,] 1 1 [134,] 2 2 [135,] 2 2 [136,] 2 2 [137,] 2 2 [138,] 1 1 [139,] 1 2 [140,] 1 2 [141,] 2 2 [142,] 2 2 [143,] 2 2 [144,] 1 1 [145,] 2 2 [146,] 2 2 [147,] 2 2 [148,] 2 2 [149,] 1 1 [150,] 1 1 [151,] 1 1 [152,] 1 1 [153,] 1 1 [154,] 1 1 [155,] 1 1 [156,] 1 2 [157,] 1 1 [158,] 1 1 [159,] 1 1 [160,] 1 1 [161,] 1 1 [162,] 1 1 [163,] 1 1 [164,] 2 1 [0e+00,100350) [1e+05,279488] [0e+00,100350) 57 25 [1e+05,279488] 8 74 > postscript(file="/var/wessaorg/rcomp/tmp/4lrpk1324658945.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/5q9ww1324658945.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/6hlia1324658945.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/756j41324658945.tab") + } > > try(system("convert tmp/2qwm71324658945.ps tmp/2qwm71324658945.png",intern=TRUE)) character(0) > try(system("convert tmp/3q9yy1324658945.ps tmp/3q9yy1324658945.png",intern=TRUE)) character(0) > try(system("convert tmp/4lrpk1324658945.ps tmp/4lrpk1324658945.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.936 0.283 4.217