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(96560 + ,76 + ,129 + ,17 + ,22996 + ,0 + ,0 + ,78 + ,62 + ,72 + ,112611 + ,41 + ,36 + ,20 + ,26706 + ,3 + ,7 + ,44 + ,56 + ,64 + ,98146 + ,40 + ,37 + ,17 + ,27114 + ,0 + ,1 + ,80 + ,49 + ,66 + ,121848 + ,39 + ,45 + ,17 + ,30594 + ,2 + ,0 + ,73 + ,63 + ,78 + ,31774 + ,23 + ,48 + ,17 + ,4143 + ,1 + ,2 + ,107 + ,67 + ,71 + ,65475 + ,18 + ,24 + ,13 + ,69008 + ,1 + ,0 + ,42 + ,59 + ,71 + ,108446 + ,60 + ,90 + ,17 + ,46300 + ,0 + ,2 + ,76 + ,40 + ,59 + ,76302 + ,31 + ,26 + ,20 + ,30976 + ,2 + ,2 + ,69 + ,34 + ,65 + ,30989 + ,14 + ,35 + ,17 + ,4154 + ,-2 + ,0 + ,62 + ,37 + ,48 + ,150580 + ,77 + ,124 + ,22 + ,45588 + ,-4 + ,0 + ,46 + ,61 + ,72 + ,59382 + ,49 + ,49 + ,12 + ,26263 + ,1 + ,0 + ,133 + ,60 + ,66 + ,341570 + ,168 + ,190 + ,21 + ,117105 + ,0 + ,0 + ,71 + ,57 + ,68 + ,133328 + ,55 + ,79 + ,20 + ,40909 + ,-3 + ,0 + ,46 + ,56 + ,75 + ,101523 + ,42 + ,76 + ,22 + ,61056 + ,0 + ,1 + ,131 + ,67 + ,73 + ,92499 + ,32 + ,57 + ,18 + ,21399 + ,-2 + ,2 + ,47 + ,38 + ,59 + ,118612 + ,46 + ,72 + ,12 + ,30080 + ,-2 + ,0 + ,15 + ,49 + ,72 + ,98104 + ,54 + ,132 + ,17 + ,25568 + ,-3 + ,0 + ,37 + ,32 + ,65 + ,84105 + ,20 + ,45 + ,17 + ,20055 + ,0 + ,1 + ,0 + ,63 + ,69 + ,237213 + ,84 + ,74 + ,38 + ,66198 + ,0 + ,3 + ,79 + ,67 + ,71 + ,133131 + ,55 + ,52 + ,30 + ,57793 + ,4 + ,3 + ,77 + ,43 + ,54 + ,344297 + ,75 + ,86 + ,30 + ,67654 + ,1 + ,5 + ,101 + ,84 + ,84 + ,174415 + ,100 + ,63 + ,31 + ,82753 + ,3 + ,0 + ,105 + ,49 + ,66 + ,294424 + ,77 + ,59 + ,33 + ,101494 + ,4 + ,2 + ,124 + ,58 + ,73 + ,362301 + ,119 + ,715 + ,34 + ,100708 + ,2 + ,0 + ,83 + ,63 + ,69 + ,167488 + ,45 + ,77 + ,28 + ,83737 + ,0 + ,0 + ,106 + ,29 + ,70 + ,152299 + ,53 + ,63 + ,33 + ,61370 + ,2 + ,2 + ,25 + ,58 + ,72 + ,243511 + ,71 + ,65 + ,42 + ,101338 + ,0 + ,2 + ,16 + ,62 + ,63 + ,132487 + ,41 + ,97 + ,36 + ,40735 + ,3 + ,1 + ,22 + ,54 + ,66 + ,172494 + ,52 + ,52 + ,43 + ,86687 + ,3 + ,0 + ,29 + ,53 + ,60 + ,224330 + ,83 + ,52 + ,39 + ,130115 + ,0 + ,0 + ,5 + ,66 + ,66 + ,181633 + ,70 + ,48 + ,30 + ,64466 + ,6 + ,0 + ,27 + ,53 + ,71 + ,210907 + ,56 + ,81 + ,30 + ,112285 + ,2 + ,0 + ,29 + ,26 + ,50 + ,236785 + ,119 + ,75 + ,31 + ,101481 + ,0 + ,5 + ,43 + ,43 + ,52 + ,244052 + ,68 + ,66 + ,44 + ,143558 + ,2 + ,0 + ,158 + ,53 + ,70 + ,143756 + ,46 + ,57 + ,34 + ,69094 + ,4 + ,4 + ,102 + ,54 + ,60 + ,182079 + ,63 + ,63 + ,33 + ,102860 + ,2 + ,0 + ,123 + ,47 + ,76 + ,100750 + ,72 + ,67 + ,30 + ,140867 + ,3 + ,0 + ,105 + ,43 + ,60 + ,152474 + ,65 + ,45 + ,32 + ,65567 + ,0 + ,1 + ,33 + ,57 + ,70 + ,97839 + ,38 + ,42 + ,24 + ,94785 + ,-1 + ,2 + ,96 + ,41 + ,75 + ,149061 + ,44 + ,66 + ,26 + ,116174 + ,0 + ,6 + ,56 + ,37 + ,54 + ,324799 + ,154 + ,108 + ,47 + ,97668 + ,0 + ,5 + ,59 + ,52 + ,65 + ,230964 + ,53 + ,43 + ,30 + ,133824 + ,-1 + ,0 + ,91 + ,52 + ,73 + ,174724 + ,92 + ,135 + ,34 + ,69112 + ,0 + ,1 + ,76 + ,67 + ,42 + ,223632 + ,73 + ,52 + ,33 + ,72654 + ,-1 + ,1 + ,94 + ,70 + ,65 + ,106408 + ,30 + ,32 + ,14 + ,31081 + ,1 + ,2 + ,41 + ,68 + ,75 + ,265769 + ,146 + ,37 + ,32 + ,83122 + ,-2 + ,5 + ,67 + ,43 + ,66 + ,149112 + ,56 + ,65 + ,35 + ,60578 + ,-4 + ,2 + ,100 + ,56 + ,70 + ,152871 + ,58 + ,74 + ,28 + ,79892 + ,2 + ,5 + ,67 + ,74 + ,81 + ,183167 + ,66 + ,66 + ,39 + ,82875 + ,-4 + ,1 + ,135 + ,58 + ,71 + ,218946 + ,41 + ,112 + ,29 + ,80670 + ,2 + ,4 + ,58 + ,63 + ,68 + ,196553 + ,57 + ,50 + ,29 + ,95260 + ,-3 + ,0 + ,56 + ,64 + ,67 + ,143246 + ,103 + ,42 + ,27 + ,106671 + ,2 + ,0 + ,59 + ,53 + ,76 + ,193339 + ,78 + ,47 + ,35 + ,84651 + ,2 + ,1 + ,116 + ,51 + ,71 + ,130585 + ,46 + ,57 + ,29 + ,95364 + ,-4 + ,2 + ,98 + ,54 + ,70 + ,148446 + ,91 + ,63 + ,37 + ,126846 + ,3 + ,8 + ,32 + ,48 + ,65 + ,243060 + ,63 + ,110 + ,29 + ,111813 + ,-1 + ,4 + ,63 + ,50 + ,68 + ,317394 + ,86 + ,53 + ,31 + ,91413 + ,-3 + ,0 + ,113 + ,45 + ,70 + ,244749 + ,95 + ,144 + ,33 + ,76643 + ,0 + ,1 + ,111 + ,61 + ,64 + ,128423 + ,64 + ,89 + ,38 + ,92696 + ,2 + ,10 + ,120 + ,56 + ,70 + ,229242 + ,247 + ,128 + ,31 + ,91721 + ,2 + ,0 + ,25 + ,46 + ,66 + ,324598 + ,110 + ,128 + ,37 + ,135777 + ,2 + ,1 + ,109 + ,51 + ,59 + ,195838 + ,67 + ,50 + ,31 + ,102372 + ,-2 + ,0 + ,37 + ,37 + ,78 + ,254488 + ,83 + ,50 + ,39 + ,103772 + ,0 + ,2 + ,54 + ,42 + ,67 + ,271856 + ,103 + ,91 + ,37 + ,54990 + ,-3 + ,2 + ,55 + ,69 + ,67 + ,95227 + ,34 + ,70 + ,32 + ,34777 + ,3 + ,0 + ,17 + ,56 + ,61) + ,dim=c(10 + ,65) + ,dimnames=list(c('tijd' + ,'login' + ,'vieuws' + ,'revieuws' + ,'size' + ,'test' + ,'shared' + ,'blogged' + ,'intrisieke' + ,'extrisieke') + ,1:65)) > y <- array(NA,dim=c(10,65),dimnames=list(c('tijd','login','vieuws','revieuws','size','test','shared','blogged','intrisieke','extrisieke'),1:65)) > 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/1trhq1323707616.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] 10 > 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/20qpu1323707616.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 = 7.0247, df = 63, p-value = 1.81e-09 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.4996064 0.7804860 sample estimates: cor 0.6627474 > 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) + } + } There were 44 warnings (use warnings() to see them) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/3l3431323707616.tab") > > try(system("convert tmp/1trhq1323707616.ps tmp/1trhq1323707616.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.478 0.092 1.561