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(1 + ,210907 + ,146283 + ,1 + ,120982 + ,98364 + ,0 + ,176508 + ,86146 + ,1 + ,385534 + ,195663 + ,1 + ,149061 + ,95757 + ,0 + ,165446 + ,85584 + ,0 + ,237213 + ,143983 + ,0 + ,133131 + ,59238 + ,0 + ,324799 + ,151511 + ,1 + ,230964 + ,136368 + ,0 + ,236785 + ,112642 + ,1 + ,135473 + ,94728 + ,1 + ,215147 + ,121527 + ,0 + ,344297 + ,127766 + ,1 + ,153935 + ,98958 + ,0 + ,174724 + ,85646 + ,0 + ,174415 + ,98579 + ,1 + ,225548 + ,130767 + ,0 + ,223632 + ,131741 + ,0 + ,124817 + ,53907 + ,1 + ,210767 + ,146761 + ,1 + ,170266 + ,82036 + ,1 + ,294424 + ,171975 + ,0 + ,325107 + ,159676 + ,0 + ,7176 + ,1929 + ,1 + ,106408 + ,58391 + ,1 + ,96560 + ,31580 + ,0 + ,265769 + ,136815 + ,1 + ,149112 + ,69107 + ,0 + ,175824 + ,50495 + ,1 + ,152871 + ,108016 + ,0 + ,111665 + ,46341 + ,0 + ,362301 + ,79336 + ,1 + ,183167 + ,93176 + ,0 + ,168809 + ,127969 + ,0 + ,24188 + ,15049 + ,0 + ,329267 + ,155135 + ,0 + ,218946 + ,102996 + ,0 + ,244052 + ,160604 + ,0 + ,341570 + ,158051 + ,1 + ,103597 + ,44547 + ,0 + ,256462 + ,174141 + ,1 + ,235800 + ,184301 + ,0 + ,196553 + ,129847 + ,0 + ,174184 + ,117286 + ,1 + ,143246 + ,71180 + ,0 + ,187559 + ,109377 + ,1 + ,187681 + ,85298 + ,0 + ,73566 + ,23824 + ,1 + ,167488 + ,82981 + ,1 + ,143756 + ,73815 + ,1 + ,243199 + ,132190 + ,0 + ,182999 + ,128754 + ,0 + ,152299 + ,67808 + ,0 + ,346485 + ,131722 + ,0 + ,193339 + ,106175 + ,0 + ,122774 + ,25157 + ,1 + ,130585 + ,76669 + ,0 + ,112611 + ,57283 + ,0 + ,286468 + ,105805 + ,0 + ,148446 + ,72413 + ,1 + ,182079 + ,96971 + ,0 + ,140344 + ,71299 + ,0 + ,220516 + ,77494 + ,0 + ,243060 + ,120336 + ,0 + ,162765 + ,93913 + ,0 + ,232138 + ,181248 + ,1 + ,265318 + ,146123 + ,0 + ,85574 + ,32036 + ,1 + ,310839 + ,186646 + ,1 + ,225060 + ,102255 + ,0 + ,232317 + ,168237 + ,1 + ,144966 + ,64219 + ,0 + ,164709 + ,115338 + ,0 + ,220801 + ,84845 + ,1 + ,99466 + ,153197 + ,0 + ,92661 + ,29877 + ,0 + ,133328 + ,63506 + ,0 + ,61361 + ,22445 + ,0 + ,100750 + ,68370 + ,1 + ,102010 + ,42071 + ,0 + ,101523 + ,50517 + ,0 + ,243511 + ,103950 + ,0 + ,22938 + ,5841 + ,0 + ,152474 + ,84396 + ,1 + ,99923 + ,35753 + ,0 + ,132487 + ,55515 + ,1 + ,317394 + ,209056 + ,0 + ,21054 + ,6622 + ,0 + ,209641 + ,115814 + ,1 + ,22648 + ,11609 + ,1 + ,31414 + ,13155 + ,0 + ,46698 + ,18274 + ,0 + ,131698 + ,72875 + ,0 + ,244749 + ,142775 + ,1 + ,128423 + ,20112 + ,1 + ,97839 + ,61023 + ,0 + ,272458 + ,132432 + ,0 + ,108043 + ,45109 + ,1 + ,328107 + ,170875 + ,0 + ,351067 + ,214921 + ,1 + ,158015 + ,100226 + ,0 + ,229242 + ,78876 + ,0 + ,84207 + ,6940 + ,1 + ,120445 + ,49025 + ,1 + ,324598 + ,122037 + ,1 + ,131069 + ,53782 + ,1 + ,204271 + ,127748 + ,1 + ,116048 + ,77395 + ,0 + ,250047 + ,89324 + ,0 + ,299775 + ,103300 + ,1 + ,195838 + ,112283 + ,0 + ,173260 + ,10901 + ,1 + ,254488 + ,120691 + ,0 + ,92499 + ,25899 + ,1 + ,224330 + ,139296 + ,1 + ,135781 + ,52678 + ,0 + ,74408 + ,23853 + ,1 + ,81240 + ,17306 + ,0 + ,181633 + ,89455 + ,0 + ,271856 + ,147866 + ,0 + ,95227 + ,14336 + ,1 + ,98146 + ,30059 + ,1 + ,59194 + ,22097 + ,0 + ,139942 + ,96841 + ,1 + ,118612 + ,41907 + ,0 + ,72880 + ,27080 + ,0 + ,65475 + ,35885 + ,0 + ,71965 + ,28313 + ,1 + ,135131 + ,36134 + ,1 + ,108446 + ,55764 + ,0 + ,181528 + ,66956 + ,0 + ,134019 + ,47487 + ,1 + ,121848 + ,35619 + ,1 + ,81872 + ,45608 + ,1 + ,58981 + ,7721 + ,1 + ,53515 + ,20634 + ,0 + ,56375 + ,31931 + ,0 + ,65490 + ,37754 + ,0 + ,76302 + ,40557 + ,0 + ,104011 + ,94238 + ,1 + ,98104 + ,44197 + ,0 + ,30989 + ,4103 + ,1 + ,135458 + ,44144 + ,0 + ,63123 + ,27640 + ,0 + ,74914 + ,28990 + ,1 + ,31774 + ,4694 + ,0 + ,81437 + ,42648 + ,0 + ,65745 + ,25836 + ,0 + ,56653 + ,22779 + ,0 + ,158399 + ,40820 + ,0 + ,73624 + ,32378 + ,0 + ,91899 + ,39613 + ,0 + ,139526 + ,60865 + ,1 + ,51567 + ,20107 + ,1 + ,102538 + ,48231 + ,0 + ,86678 + ,39725 + ,0 + ,150580 + ,62991 + ,0 + ,99611 + ,49363 + ,1 + ,99373 + ,24552 + ,1 + ,86230 + ,31493 + ,1 + ,30837 + ,3439 + ,0 + ,31706 + ,19555 + ,0 + ,89806 + ,21228 + ,1 + ,64175 + ,28893 + ,1 + ,59382 + ,21425 + ,1 + ,119308 + ,50276 + ,1 + ,76702 + ,37643 + ,0 + ,19764 + ,9927 + ,1 + ,84105 + ,27184 + ,0 + ,64187 + ,18475 + ,0 + ,72535 + ,35873) + ,dim=c(3 + ,172) + ,dimnames=list(c('Gender' + ,'Total_Time_spent_in_RFC_in_seconds' + ,'Compendium_Writing:total_number_of_seconds') + ,1:172)) > y <- array(NA,dim=c(3,172),dimnames=list(c('Gender','Total_Time_spent_in_RFC_in_seconds','Compendium_Writing:total_number_of_seconds'),1:172)) > 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/1zesl1324130931.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] 3 > 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/244ig1324130931.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 = -0.5554, df = 170, p-value = 0.5793 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: -0.1909789 0.1077599 sample estimates: cor -0.04256077 > 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 > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/3ytxq1324130931.tab") > > try(system("convert tmp/1zesl1324130931.ps tmp/1zesl1324130931.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.669 0.111 0.780