R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(176508 + ,54 + ,559 + ,50 + ,12 + ,60 + ,38 + ,179321 + ,89 + ,967 + ,125 + ,2 + ,108 + ,30 + ,123185 + ,40 + ,270 + ,40 + ,1 + ,49 + ,22 + ,52746 + ,25 + ,143 + ,37 + ,3 + ,0 + ,26 + ,385534 + ,92 + ,1562 + ,63 + ,0 + ,121 + ,25 + ,33170 + ,18 + ,109 + ,44 + ,0 + ,1 + ,18 + ,101645 + ,63 + ,371 + ,88 + ,0 + ,20 + ,11 + ,149061 + ,44 + ,656 + ,66 + ,5 + ,43 + ,26 + ,165446 + ,33 + ,511 + ,57 + ,0 + ,69 + ,25 + ,237213 + ,84 + ,655 + ,74 + ,0 + ,78 + ,38 + ,173326 + ,88 + ,465 + ,49 + ,7 + ,86 + ,44 + ,133131 + ,55 + ,525 + ,52 + ,7 + ,44 + ,30 + ,258873 + ,60 + ,885 + ,88 + ,3 + ,104 + ,40 + ,180083 + ,66 + ,497 + ,36 + ,9 + ,63 + ,34 + ,324799 + ,154 + ,1436 + ,108 + ,0 + ,158 + ,47 + ,230964 + ,53 + ,612 + ,43 + ,4 + ,102 + ,30 + ,236785 + ,119 + ,865 + ,75 + ,3 + ,77 + ,31 + ,135473 + ,41 + ,385 + ,32 + ,0 + ,82 + ,23 + ,202925 + ,61 + ,567 + ,44 + ,7 + ,115 + ,36 + ,215147 + ,58 + ,639 + ,85 + ,0 + ,101 + ,36 + ,344297 + ,75 + ,963 + ,86 + ,1 + ,80 + ,30 + ,153935 + ,33 + ,398 + ,56 + ,5 + ,50 + ,25 + ,132943 + ,40 + ,410 + ,50 + ,7 + ,83 + ,39 + ,174724 + ,92 + ,966 + ,135 + ,0 + ,123 + ,34 + ,174415 + ,100 + ,801 + ,63 + ,0 + ,73 + ,31 + ,225548 + ,112 + ,892 + ,81 + ,5 + ,81 + ,31 + ,223632 + ,73 + ,513 + ,52 + ,0 + ,105 + ,33 + ,124817 + ,40 + ,469 + ,44 + ,0 + ,47 + ,25 + ,221698 + ,45 + ,683 + ,113 + ,0 + ,105 + ,33 + ,210767 + ,60 + ,643 + ,39 + ,3 + ,94 + ,35 + ,170266 + ,62 + ,535 + ,73 + ,4 + ,44 + ,42 + ,260561 + ,75 + ,625 + ,48 + ,1 + ,114 + ,43 + ,84853 + ,31 + ,264 + ,33 + ,4 + ,38 + ,30 + ,294424 + ,77 + ,992 + ,59 + ,2 + ,107 + ,33 + ,101011 + ,34 + ,238 + ,41 + ,0 + ,30 + ,13 + ,215641 + ,46 + ,818 + ,69 + ,0 + ,71 + ,32 + ,325107 + ,99 + ,937 + ,64 + ,0 + ,84 + ,36 + ,7176 + ,17 + ,70 + ,1 + ,0 + ,0 + ,0 + ,167542 + ,66 + ,507 + ,59 + ,2 + ,59 + ,28 + ,106408 + ,30 + ,260 + ,32 + ,1 + ,33 + ,14 + ,96560 + ,76 + ,503 + ,129 + ,0 + ,42 + ,17 + ,265769 + ,146 + ,927 + ,37 + ,2 + ,96 + ,32 + ,269651 + ,67 + ,1269 + ,31 + ,10 + ,106 + ,30 + ,149112 + ,56 + ,537 + ,65 + ,6 + ,56 + ,35 + ,175824 + ,107 + ,910 + ,107 + ,0 + ,57 + ,20 + ,152871 + ,58 + ,532 + ,74 + ,5 + ,59 + ,28 + ,111665 + ,34 + ,345 + ,54 + ,4 + ,39 + ,28 + ,116408 + ,61 + ,918 + ,76 + ,1 + ,34 + ,39 + ,362301 + ,119 + ,1635 + ,715 + ,2 + ,76 + ,34 + ,78800 + ,42 + ,330 + ,57 + ,2 + ,20 + ,26 + ,183167 + ,66 + ,557 + ,66 + ,0 + ,91 + ,39 + ,277965 + ,89 + ,1178 + ,106 + ,8 + ,115 + ,39 + ,150629 + ,44 + ,740 + ,54 + ,3 + ,85 + ,33 + ,168809 + ,66 + ,452 + ,32 + ,0 + ,76 + ,28 + ,24188 + ,24 + ,218 + ,20 + ,0 + ,8 + ,4) + ,dim=c(7 + ,55) + ,dimnames=list(c('time_in_rfc' + ,'logins' + ,'compendium_views_info' + ,'compendium_views_pr' + ,'shared_compendiums' + ,'blogged_computations' + ,'compendiums_reviewed') + ,1:55)) > y <- array(NA,dim=c(7,55),dimnames=list(c('time_in_rfc','logins','compendium_views_info','compendium_views_pr','shared_compendiums','blogged_computations','compendiums_reviewed'),1:55)) > 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/14q251355154144.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] 7 > 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/218p51355154144.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.263, df = 53, p-value = 1.702e-09 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.5426561 0.8182533 sample estimates: cor 0.7062744 > 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 20 warnings (use warnings() to see them) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/32ru81355154144.tab") > > try(system("convert tmp/14q251355154144.ps tmp/14q251355154144.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.339 0.185 1.503