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(140824 + ,186099 + ,38 + ,165 + ,110459 + ,113854 + ,34 + ,135 + ,105079 + ,99776 + ,42 + ,121 + ,112098 + ,106194 + ,38 + ,148 + ,43929 + ,100792 + ,27 + ,73 + ,76173 + ,47552 + ,35 + ,49 + ,187326 + ,250931 + ,33 + ,185 + ,22807 + ,6853 + ,18 + ,5 + ,144408 + ,115466 + ,34 + ,125 + ,66485 + ,110896 + ,33 + ,93 + ,79089 + ,169351 + ,46 + ,154 + ,81625 + ,94853 + ,55 + ,98 + ,68788 + ,72591 + ,37 + ,70 + ,103297 + ,101345 + ,55 + ,148 + ,69446 + ,113713 + ,44 + ,100 + ,114948 + ,165354 + ,59 + ,150 + ,167949 + ,164263 + ,36 + ,197 + ,125081 + ,135213 + ,39 + ,114 + ,125818 + ,111669 + ,29 + ,169 + ,136588 + ,134163 + ,51 + ,200 + ,112431 + ,140303 + ,49 + ,148 + ,103037 + ,150773 + ,39 + ,140 + ,82317 + ,111848 + ,25 + ,74 + ,118906 + ,102509 + ,52 + ,128 + ,83515 + ,96785 + ,45 + ,140 + ,104581 + ,116136 + ,38 + ,116 + ,103129 + ,158376 + ,41 + ,147 + ,83243 + ,153990 + ,43 + ,132 + ,37110 + ,64057 + ,32 + ,70 + ,113344 + ,230054 + ,41 + ,144 + ,139165 + ,184531 + ,47 + ,155 + ,86652 + ,114198 + ,50 + ,165 + ,112302 + ,198299 + ,48 + ,161 + ,69652 + ,33750 + ,37 + ,31 + ,119442 + ,189723 + ,43 + ,199 + ,69867 + ,100826 + ,42 + ,78 + ,101629 + ,188355 + ,44 + ,121 + ,70168 + ,104470 + ,36 + ,112 + ,31081 + ,58391 + ,17 + ,41 + ,103925 + ,164808 + ,42 + ,158 + ,92622 + ,134097 + ,39 + ,123 + ,79011 + ,80238 + ,41 + ,104 + ,93487 + ,133252 + ,36 + ,94 + ,64520 + ,54518 + ,47 + ,73 + ,93473 + ,121850 + ,45 + ,52 + ,114360 + ,79367 + ,41 + ,71 + ,33032 + ,56968 + ,26 + ,21 + ,96125 + ,106314 + ,52 + ,155 + ,151911 + ,191889 + ,47 + ,174 + ,89256 + ,104864 + ,45 + ,136 + ,95671 + ,160791 + ,40 + ,128 + ,5950 + ,15049 + ,4 + ,7 + ,149695 + ,191179 + ,44 + ,165 + ,32551 + ,25109 + ,18 + ,21 + ,31701 + ,45824 + ,14 + ,35 + ,100087 + ,129711 + ,37 + ,137 + ,169707 + ,210012 + ,61 + ,174 + ,150491 + ,194679 + ,39 + ,257 + ,120192 + ,197680 + ,42 + ,207 + ,95893 + ,81180 + ,36 + ,103 + ,151715 + ,197765 + ,49 + ,171 + ,176225 + ,214738 + ,28 + ,279 + ,59900 + ,96252 + ,43 + ,83 + ,104767 + ,124527 + ,42 + ,130 + ,114799 + ,153242 + ,37 + ,131 + ,72128 + ,145707 + ,30 + ,126 + ,143592 + ,113963 + ,35 + ,158 + ,89626 + ,134904 + ,44 + ,138 + ,131072 + ,114268 + ,36 + ,200 + ,126817 + ,94333 + ,28 + ,104 + ,81351 + ,102204 + ,45 + ,111 + ,22618 + ,23824 + ,23 + ,26 + ,88977 + ,111563 + ,45 + ,115 + ,92059 + ,91313 + ,38 + ,127 + ,81897 + ,89770 + ,38 + ,140 + ,108146 + ,100125 + ,46 + ,121 + ,126372 + ,165278 + ,36 + ,183 + ,249771 + ,181712 + ,41 + ,68 + ,71154 + ,80906 + ,38 + ,112 + ,71571 + ,75881 + ,37 + ,103 + ,55918 + ,83963 + ,28 + ,63 + ,160141 + ,175721 + ,45 + ,166 + ,38692 + ,68580 + ,26 + ,38 + ,102812 + ,136323 + ,44 + ,163 + ,56622 + ,55792 + ,8 + ,59 + ,15986 + ,25157 + ,27 + ,27 + ,123534 + ,100922 + ,38 + ,108 + ,108535 + ,118845 + ,37 + ,88 + ,93879 + ,170492 + ,57 + ,92 + ,144551 + ,81716 + ,45 + ,170 + ,56750 + ,115750 + ,37 + ,98 + ,127654 + ,105590 + ,40 + ,205 + ,65594 + ,92795 + ,31 + ,96 + ,59938 + ,82390 + ,36 + ,107 + ,146975 + ,135599 + ,40 + ,150 + ,143372 + ,111542 + ,36 + ,123 + ,168553 + ,162519 + ,35 + ,176 + ,183500 + ,211381 + ,39 + ,213 + ,165986 + ,189944 + ,65 + ,208 + ,184923 + ,226168 + ,30 + ,307 + ,140358 + ,117495 + ,51 + ,125 + ,149959 + ,195894 + ,41 + ,208 + ,57224 + ,80684 + ,36 + ,73 + ,43750 + ,19630 + ,19 + ,49 + ,48029 + ,88634 + ,23 + ,82 + ,104978 + ,139292 + ,44 + ,206 + ,100046 + ,128602 + ,40 + ,112 + ,101047 + ,135848 + ,40 + ,139 + ,197426 + ,178377 + ,30 + ,60 + ,160902 + ,106330 + ,41 + ,70 + ,147172 + ,178303 + ,40 + ,112 + ,109432 + ,116938 + ,45 + ,142 + ,1168 + ,5841 + ,1 + ,11 + ,83248 + ,106020 + ,40 + ,130 + ,25162 + ,24610 + ,11 + ,31 + ,45724 + ,74151 + ,45 + ,132 + ,110529 + ,232241 + ,38 + ,219 + ,855 + ,6622 + ,0 + ,4 + ,101382 + ,127097 + ,30 + ,102 + ,14116 + ,13155 + ,8 + ,39 + ,89506 + ,160501 + ,39 + ,125 + ,135356 + ,91502 + ,48 + ,121 + ,116066 + ,24469 + ,48 + ,42 + ,144244 + ,88229 + ,29 + ,111 + ,8773 + ,13983 + ,8 + ,16 + ,102153 + ,80716 + ,43 + ,70 + ,117440 + ,157384 + ,52 + ,162 + ,104128 + ,122975 + ,53 + ,173 + ,134238 + ,191469 + ,48 + ,171 + ,134047 + ,231257 + ,48 + ,172 + ,279488 + ,258287 + ,50 + ,254 + ,79756 + ,122531 + ,40 + ,90 + ,66089 + ,61394 + ,36 + ,50 + ,102070 + ,86480 + ,40 + ,113 + ,146760 + ,195791 + ,46 + ,187 + ,154771 + ,18284 + ,42 + ,16 + ,165933 + ,147581 + ,46 + ,175 + ,64593 + ,72558 + ,39 + ,90 + ,92280 + ,147341 + ,41 + ,140 + ,67150 + ,114651 + ,46 + ,145 + ,128692 + ,100187 + ,32 + ,141 + ,124089 + ,130332 + ,39 + ,125 + ,125386 + ,134218 + ,39 + ,241 + ,37238 + ,10901 + ,21 + ,16 + ,140015 + ,145758 + ,45 + ,175 + ,150047 + ,75767 + ,50 + ,132 + ,154451 + ,134969 + ,36 + ,154 + ,156349 + ,169216 + ,44 + ,198 + ,0 + ,0 + ,0 + ,0 + ,6023 + ,7953 + ,0 + ,5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,84601 + ,105406 + ,37 + ,125 + ,68946 + ,174586 + ,52 + ,174 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1644 + ,4245 + ,0 + ,6 + ,6179 + ,21509 + ,5 + ,13 + ,3926 + ,7670 + ,1 + ,3 + ,52789 + ,15673 + ,43 + ,35 + ,0 + ,0 + ,0 + ,0 + ,100350 + ,75882 + ,34 + ,80) + ,dim=c(4 + ,164) + ,dimnames=list(c('Aantal_tekens' + ,'tijd' + ,'reviews' + ,'Hyperlinks') + ,1:164)) > y <- array(NA,dim=c(4,164),dimnames=list(c('Aantal_tekens','tijd','reviews','Hyperlinks'),1:164)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par1 = 'pearson' > main = 'Correlation Matrix' > panel.tau <- function(x, y, digits=2, prefix='', cex.cor) + { + usr <- par('usr'); on.exit(par(usr)) + par(usr = c(0, 1, 0, 1)) + rr <- cor.test(x, y, method=par1) + r <- round(rr$p.value,2) + txt <- format(c(r, 0.123456789), digits=digits)[1] + txt <- paste(prefix, txt, sep='') + if(missing(cex.cor)) cex <- 0.5/strwidth(txt) + text(0.5, 0.5, txt, cex = cex) + } > panel.hist <- function(x, ...) + { + usr <- par('usr'); on.exit(par(usr)) + par(usr = c(usr[1:2], 0, 1.5) ) + h <- hist(x, plot = FALSE) + breaks <- h$breaks; nB <- length(breaks) + y <- h$counts; y <- y/max(y) + rect(breaks[-nB], 0, breaks[-1], y, col='grey', ...) + } > postscript(file="/var/wessaorg/rcomp/tmp/1ehtv1324656457.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pairs(t(y),diag.panel=panel.hist, upper.panel=panel.smooth, lower.panel=panel.tau, main=main) > dev.off() null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > n <- length(y[,1]) > n [1] 4 > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,paste('Correlations for all pairs of data series (method=',par1,')',sep=''),n+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,' ',header=TRUE) > for (i in 1:n) { + a<-table.element(a,dimnames(t(x))[[2]][i],header=TRUE) + } > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,dimnames(t(x))[[2]][i],header=TRUE) + for (j in 1:n) { + r <- cor.test(y[i,],y[j,],method=par1) + a<-table.element(a,round(r$estimate,3)) + } + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/299dk1324656457.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Correlations for all pairs of data series with p-values',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'pair',1,TRUE) > a<-table.element(a,'Pearson r',1,TRUE) > a<-table.element(a,'Spearman rho',1,TRUE) > a<-table.element(a,'Kendall tau',1,TRUE) > a<-table.row.end(a) > cor.test(y[1,],y[2,],method=par1) Pearson's product-moment correlation data: y[1, ] and y[2, ] t = 16.6032, df = 162, p-value < 2.2e-16 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.7290548 0.8442076 sample estimates: cor 0.7936339 > for (i in 1:(n-1)) + { + for (j in (i+1):n) + { + a<-table.row.start(a) + dum <- paste(dimnames(t(x))[[2]][i],';',dimnames(t(x))[[2]][j],sep='') + a<-table.element(a,dum,header=TRUE) + rp <- cor.test(y[i,],y[j,],method='pearson') + a<-table.element(a,round(rp$estimate,4)) + rs <- cor.test(y[i,],y[j,],method='spearman') + a<-table.element(a,round(rs$estimate,4)) + rk <- cor.test(y[i,],y[j,],method='kendall') + a<-table.element(a,round(rk$estimate,4)) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-value',header=T) + a<-table.element(a,paste('(',round(rp$p.value,4),')',sep='')) + a<-table.element(a,paste('(',round(rs$p.value,4),')',sep='')) + a<-table.element(a,paste('(',round(rk$p.value,4),')',sep='')) + a<-table.row.end(a) + } + } Warning messages: 1: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 2: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 3: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 4: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 5: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 6: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/3rmv51324656457.tab") > > try(system("convert tmp/1ehtv1324656457.ps tmp/1ehtv1324656457.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.804 0.098 0.893