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(264530 + ,34 + ,124252 + ,135248 + ,30 + ,98956 + ,207253 + ,42 + ,98073 + ,202898 + ,35 + ,106816 + ,145249 + ,26 + ,41449 + ,65295 + ,31 + ,76173 + ,439387 + ,29 + ,177551 + ,33186 + ,18 + ,22807 + ,183696 + ,30 + ,126938 + ,190673 + ,29 + ,61680 + ,287239 + ,42 + ,72117 + ,205260 + ,50 + ,79738 + ,141987 + ,33 + ,57793 + ,322679 + ,49 + ,91677 + ,199717 + ,40 + ,64631 + ,349227 + ,52 + ,106385 + ,276709 + ,33 + ,161961 + ,273576 + ,35 + ,112669 + ,157448 + ,25 + ,114029 + ,242782 + ,43 + ,124550 + ,256814 + ,40 + ,105416 + ,405942 + ,37 + ,72875 + ,161189 + ,25 + ,81964 + ,156389 + ,46 + ,104880 + ,200181 + ,41 + ,76302 + ,192645 + ,35 + ,96740 + ,249893 + ,38 + ,93071 + ,241171 + ,36 + ,78912 + ,143182 + ,28 + ,35224 + ,285266 + ,37 + ,90694 + ,243048 + ,40 + ,125369 + ,176062 + ,42 + ,80849 + ,305210 + ,48 + ,104434 + ,87995 + ,33 + ,65702 + ,343613 + ,39 + ,108179 + ,264159 + ,37 + ,63583 + ,394976 + ,41 + ,95066 + ,192718 + ,32 + ,62486 + ,114673 + ,17 + ,31081 + ,310108 + ,39 + ,94584 + ,292891 + ,36 + ,87408 + ,157518 + ,38 + ,68966 + ,180362 + ,36 + ,88766 + ,146175 + ,35 + ,57139 + ,140319 + ,45 + ,90586 + ,405267 + ,38 + ,109249 + ,78800 + ,26 + ,33032 + ,201970 + ,45 + ,96056 + ,309762 + ,46 + ,146648 + ,166270 + ,41 + ,80613 + ,199186 + ,34 + ,87026 + ,24188 + ,4 + ,5950 + ,346142 + ,41 + ,131106 + ,65029 + ,18 + ,32551 + ,101097 + ,14 + ,31701 + ,255082 + ,37 + ,91072 + ,287314 + ,53 + ,159803 + ,308944 + ,36 + ,143950 + ,280943 + ,37 + ,112368 + ,225816 + ,36 + ,82124 + ,348955 + ,46 + ,144068 + ,283283 + ,28 + ,162627 + ,199642 + ,42 + ,55062 + ,232791 + ,38 + ,95329 + ,212262 + ,33 + ,105612 + ,201345 + ,28 + ,62853 + ,180424 + ,31 + ,125976 + ,204450 + ,40 + ,79146 + ,197813 + ,32 + ,108461 + ,138731 + ,25 + ,99971 + ,219074 + ,43 + ,77826 + ,73566 + ,23 + ,22618 + ,219392 + ,42 + ,84892 + ,181728 + ,38 + ,92059 + ,150006 + ,34 + ,77993 + ,325723 + ,40 + ,104155 + ,265348 + ,36 + ,109840 + ,202410 + ,37 + ,238712 + ,173420 + ,34 + ,67486 + ,162366 + ,37 + ,68007 + ,136341 + ,25 + ,48194 + ,390163 + ,45 + ,134796 + ,145905 + ,26 + ,38692 + ,248834 + ,40 + ,93587 + ,80953 + ,8 + ,56622 + ,133301 + ,27 + ,15986 + ,138630 + ,32 + ,113402 + ,334082 + ,37 + ,97967 + ,277542 + ,57 + ,74844 + ,170849 + ,41 + ,136051 + ,236398 + ,37 + ,50548 + ,207178 + ,38 + ,112215 + ,157125 + ,28 + ,59591 + ,242395 + ,36 + ,59938 + ,273632 + ,33 + ,137639 + ,178489 + ,32 + ,143372 + ,210247 + ,34 + ,138599 + ,268066 + ,35 + ,174110 + ,351056 + ,58 + ,135062 + ,368833 + ,30 + ,175681 + ,247842 + ,45 + ,130307 + ,268118 + ,37 + ,139141 + ,174311 + ,36 + ,44244 + ,43287 + ,19 + ,43750 + ,182915 + ,23 + ,48029 + ,189021 + ,35 + ,95216 + ,237531 + ,36 + ,92288 + ,279589 + ,36 + ,94588 + ,106655 + ,23 + ,197426 + ,135798 + ,41 + ,151244 + ,292930 + ,40 + ,139206 + ,266805 + ,42 + ,106271 + ,23623 + ,1 + ,1168 + ,174970 + ,36 + ,71764 + ,61857 + ,11 + ,25162 + ,147760 + ,42 + ,45635 + ,358662 + ,34 + ,101817 + ,21054 + ,0 + ,855 + ,230091 + ,27 + ,100174 + ,31414 + ,8 + ,14116 + ,284519 + ,38 + ,85008 + ,209481 + ,44 + ,124254 + ,161691 + ,40 + ,105793 + ,137093 + ,28 + ,117129 + ,38214 + ,8 + ,8773 + ,166059 + ,36 + ,94747 + ,319346 + ,47 + ,107549 + ,186273 + ,48 + ,97392 + ,374269 + ,45 + ,126893 + ,275578 + ,48 + ,118850 + ,371645 + ,50 + ,234853 + ,179928 + ,40 + ,74783 + ,94381 + ,32 + ,66089 + ,269169 + ,37 + ,95684 + ,382564 + ,42 + ,139537 + ,118033 + ,35 + ,144253 + ,370878 + ,42 + ,153824 + ,147989 + ,34 + ,63995 + ,236370 + ,41 + ,84891 + ,193456 + ,36 + ,61263 + ,189020 + ,32 + ,106221 + ,344751 + ,35 + ,113587 + ,224936 + ,35 + ,113864 + ,173260 + ,21 + ,37238 + ,291777 + ,45 + ,119906 + ,130908 + ,49 + ,135096 + ,209639 + ,36 + ,151611 + ,262412 + ,39 + ,144645 + ,1 + ,0 + ,0 + ,14688 + ,0 + ,6023 + ,98 + ,0 + ,0 + ,455 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,195822 + ,33 + ,77457 + ,347930 + ,47 + ,62464 + ,0 + ,0 + ,0 + ,203 + ,0 + ,0 + ,7199 + ,0 + ,1644 + ,46660 + ,5 + ,6179 + ,17547 + ,1 + ,3926 + ,107465 + ,38 + ,42087 + ,969 + ,0 + ,0 + ,179994 + ,28 + ,87656) + ,dim=c(3 + ,164) + ,dimnames=list(c('Time' + ,'PR' + ,'characters') + ,1:164)) > y <- array(NA,dim=c(3,164),dimnames=list(c('Time','PR','characters'),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/1xlzd1323700781.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/2f45j1323700781.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 = 14.7526, df = 162, p-value < 2.2e-16 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.6831741 0.8157485 sample estimates: cor 0.7571529 > 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 > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/30euz1323700781.tab") > > try(system("convert tmp/1xlzd1323700781.ps tmp/1xlzd1323700781.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.684 0.079 0.777