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(293403 + ,111 + ,74 + ,91256 + ,123 + ,119 + ,277108 + ,70 + ,69 + ,86997 + ,64 + ,64 + ,264020 + ,76 + ,76 + ,55709 + ,101 + ,100 + ,260646 + ,109 + ,60 + ,75741 + ,104 + ,104 + ,246100 + ,81 + ,89 + ,92046 + ,135 + ,135 + ,244051 + ,67 + ,111 + ,84607 + ,130 + ,124 + ,241329 + ,54 + ,57 + ,73586 + ,93 + ,93 + ,234730 + ,106 + ,116 + ,162365 + ,159 + ,155 + ,234509 + ,125 + ,122 + ,70817 + ,125 + ,120 + ,233482 + ,68 + ,90 + ,59635 + ,81 + ,78 + ,233406 + ,96 + ,85 + ,109104 + ,117 + ,117 + ,228548 + ,106 + ,65 + ,120087 + ,205 + ,198 + ,223914 + ,104 + ,89 + ,72631 + ,115 + ,110 + ,223696 + ,88 + ,82 + ,104911 + ,115 + ,114 + ,223004 + ,87 + ,84 + ,85224 + ,147 + ,137 + ,213765 + ,84 + ,56 + ,58233 + ,150 + ,150 + ,210554 + ,81 + ,73 + ,117986 + ,126 + ,124 + ,202204 + ,44 + ,79 + ,67271 + ,61 + ,56 + ,199512 + ,75 + ,59 + ,55071 + ,82 + ,82 + ,195304 + ,93 + ,47 + ,114425 + ,152 + ,145 + ,191467 + ,76 + ,75 + ,79194 + ,109 + ,104 + ,191381 + ,87 + ,71 + ,101653 + ,210 + ,212 + ,191276 + ,112 + ,90 + ,81493 + ,151 + ,141 + ,190410 + ,84 + ,107 + ,64664 + ,96 + ,94 + ,188967 + ,86 + ,75 + ,63717 + ,98 + ,94 + ,188780 + ,98 + ,85 + ,72369 + ,98 + ,98 + ,185139 + ,121 + ,83 + ,86281 + ,128 + ,126 + ,185039 + ,94 + ,73 + ,63958 + ,100 + ,98 + ,184217 + ,69 + ,45 + ,73795 + ,74 + ,74 + ,181853 + ,87 + ,93 + ,96750 + ,92 + ,91 + ,181379 + ,92 + ,123 + ,83038 + ,101 + ,96 + ,181344 + ,75 + ,114 + ,65196 + ,109 + ,108 + ,179562 + ,76 + ,89 + ,62932 + ,116 + ,116 + ,178863 + ,86 + ,78 + ,57637 + ,88 + ,87 + ,178140 + ,56 + ,91 + ,70111 + ,83 + ,78 + ,176789 + ,115 + ,66 + ,123328 + ,149 + ,149 + ,176460 + ,97 + ,55 + ,38885 + ,122 + ,122 + ,175877 + ,95 + ,81 + ,54628 + ,96 + ,95 + ,175568 + ,106 + ,80 + ,74482 + ,105 + ,102 + ,174107 + ,49 + ,71 + ,76168 + ,95 + ,91 + ,173587 + ,70 + ,70 + ,71170 + ,97 + ,95 + ,173260 + ,41 + ,78 + ,37238 + ,16 + ,15 + ,172684 + ,87 + ,112 + ,101773 + ,103 + ,102 + ,167845 + ,105 + ,77 + ,103646 + ,145 + ,145 + ,167131 + ,71 + ,69 + ,37048 + ,56 + ,56 + ,167105 + ,56 + ,32 + ,85903 + ,75 + ,71 + ,166790 + ,49 + ,59 + ,43460 + ,46 + ,46 + ,164767 + ,51 + ,87 + ,90257 + ,81 + ,80 + ,162810 + ,49 + ,76 + ,70027 + ,83 + ,80 + ,162336 + ,111 + ,84 + ,111436 + ,153 + ,151 + ,161678 + ,75 + ,59 + ,65911 + ,87 + ,83 + ,158980 + ,84 + ,75 + ,105965 + ,123 + ,122 + ,157250 + ,84 + ,106 + ,61704 + ,104 + ,104 + ,156833 + ,79 + ,73 + ,48204 + ,85 + ,85 + ,155383 + ,83 + ,75 + ,60029 + ,99 + ,99 + ,154991 + ,63 + ,87 + ,52295 + ,99 + ,98 + ,154730 + ,78 + ,82 + ,82204 + ,98 + ,98 + ,151503 + ,93 + ,83 + ,56316 + ,99 + ,98 + ,146455 + ,65 + ,68 + ,95556 + ,127 + ,128 + ,143937 + ,98 + ,66 + ,78792 + ,140 + ,139 + ,142339 + ,75 + ,67 + ,125410 + ,144 + ,142 + ,142146 + ,108 + ,88 + ,76013 + ,152 + ,139 + ,142141 + ,73 + ,87 + ,91939 + ,61 + ,61 + ,142069 + ,66 + ,88 + ,57231 + ,83 + ,82 + ,141933 + ,90 + ,75 + ,51370 + ,100 + ,99 + ,139350 + ,70 + ,79 + ,99518 + ,89 + ,88 + ,139144 + ,57 + ,76 + ,56530 + ,75 + ,75 + ,137793 + ,70 + ,78 + ,56699 + ,77 + ,77 + ,136911 + ,95 + ,86 + ,74349 + ,117 + ,103 + ,136548 + ,89 + ,62 + ,83042 + ,158 + ,157 + ,135171 + ,80 + ,61 + ,71181 + ,82 + ,82 + ,134043 + ,54 + ,69 + ,55901 + ,57 + ,54 + ,131876 + ,27 + ,83 + ,38417 + ,36 + ,36 + ,131122 + ,56 + ,50 + ,65724 + ,89 + ,89 + ,130539 + ,60 + ,47 + ,48821 + ,66 + ,66 + ,130533 + ,64 + ,76 + ,85168 + ,78 + ,79 + ,130232 + ,102 + ,83 + ,55027 + ,107 + ,105 + ,129100 + ,38 + ,60 + ,73713 + ,87 + ,87 + ,128655 + ,75 + ,70 + ,79774 + ,111 + ,108 + ,128066 + ,42 + ,48 + ,42564 + ,80 + ,80 + ,127619 + ,49 + ,50 + ,36311 + ,52 + ,50 + ,127324 + ,79 + ,87 + ,56733 + ,104 + ,101 + ,126683 + ,71 + ,123 + ,63262 + ,72 + ,71 + ,126681 + ,39 + ,90 + ,94137 + ,67 + ,66 + ,125971 + ,61 + ,45 + ,38439 + ,71 + ,71 + ,125366 + ,69 + ,22 + ,34497 + ,68 + ,68 + ,122433 + ,51 + ,91 + ,58425 + ,66 + ,66 + ,121135 + ,50 + ,51 + ,42051 + ,69 + ,68 + ,119291 + ,83 + ,38 + ,64102 + ,123 + ,120 + ,118958 + ,52 + ,68 + ,54506 + ,61 + ,58 + ,118807 + ,56 + ,81 + ,55827 + ,70 + ,70 + ,118372 + ,72 + ,35 + ,66477 + ,142 + ,145 + ,116900 + ,42 + ,36 + ,28340 + ,58 + ,57 + ,116775 + ,30 + ,83 + ,73087 + ,124 + ,112 + ,115199 + ,84 + ,54 + ,51360 + ,87 + ,87 + ,114928 + ,44 + ,72 + ,53009 + ,96 + ,91 + ,114397 + ,70 + ,65 + ,55064 + ,87 + ,85 + ,113337 + ,58 + ,37 + ,63016 + ,68 + ,68 + ,111664 + ,55 + ,59 + ,38650 + ,98 + ,98 + ,108715 + ,64 + ,35 + ,40671 + ,80 + ,78 + ,107342 + ,77 + ,53 + ,82043 + ,116 + ,111 + ,107335 + ,48 + ,61 + ,49319 + ,65 + ,64 + ,106539 + ,36 + ,68 + ,77411 + ,63 + ,63 + ,105615 + ,57 + ,70 + ,202316 + ,51 + ,48 + ,105410 + ,62 + ,72 + ,89041 + ,88 + ,86 + ,105324 + ,42 + ,71 + ,26982 + ,46 + ,46 + ,103012 + ,30 + ,37 + ,29467 + ,28 + ,26 + ,102531 + ,46 + ,63 + ,40001 + ,64 + ,63 + ,101324 + ,81 + ,104 + ,70780 + ,103 + ,100 + ,100885 + ,39 + ,29 + ,49288 + ,49 + ,48 + ,100672 + ,38 + ,69 + ,50466 + ,55 + ,55 + ,99946 + ,106 + ,80 + ,99501 + ,125 + ,119 + ,99768 + ,24 + ,62 + ,15430 + ,27 + ,27 + ,99246 + ,27 + ,63 + ,37361 + ,52 + ,51 + ,98599 + ,48 + ,55 + ,36252 + ,46 + ,44 + ,98030 + ,30 + ,41 + ,31701 + ,35 + ,35 + ,94763 + ,94 + ,75 + ,56979 + ,100 + ,99 + ,93340 + ,41 + ,63 + ,43448 + ,60 + ,60 + ,93125 + ,30 + ,29 + ,50838 + ,37 + ,36 + ,91185 + ,57 + ,66 + ,21067 + ,67 + ,67 + ,90961 + ,42 + ,78 + ,63785 + ,49 + ,49 + ,90938 + ,40 + ,51 + ,37137 + ,43 + ,42 + ,89318 + ,75 + ,78 + ,44970 + ,82 + ,81 + ,88817 + ,70 + ,60 + ,46765 + ,56 + ,56 + ,84944 + ,54 + ,72 + ,54565 + ,90 + ,89 + ,84572 + ,43 + ,82 + ,72571 + ,84 + ,84 + ,84256 + ,97 + ,58 + ,59155 + ,76 + ,75 + ,80953 + ,49 + ,27 + ,56622 + ,59 + ,58 + ,78800 + ,20 + ,66 + ,33032 + ,21 + ,21 + ,78776 + ,30 + ,18 + ,26998 + ,34 + ,34 + ,75812 + ,28 + ,57 + ,35606 + ,30 + ,30 + ,75426 + ,3 + ,19 + ,47261 + ,36 + ,33 + ,74398 + ,41 + ,30 + ,31258 + ,51 + ,51 + ,74112 + ,28 + ,54 + ,174949 + ,52 + ,52 + ,73567 + ,37 + ,31 + ,23238 + ,18 + ,18 + ,69471 + ,22 + ,63 + ,22618 + ,26 + ,25 + ,68948 + ,31 + ,47 + ,35838 + ,45 + ,43 + ,67746 + ,18 + ,35 + ,62832 + ,58 + ,56 + ,67507 + ,101 + ,112 + ,78956 + ,49 + ,49 + ,65029 + ,21 + ,61 + ,32551 + ,21 + ,21 + ,64320 + ,16 + ,56 + ,62147 + ,24 + ,23 + ,61857 + ,23 + ,30 + ,25162 + ,31 + ,28 + ,61499 + ,28 + ,75 + ,36990 + ,15 + ,15 + ,50999 + ,2 + ,66 + ,63989 + ,8 + ,8 + ,46660 + ,12 + ,13 + ,6179 + ,13 + ,13 + ,43287 + ,13 + ,64 + ,43750 + ,49 + ,49 + ,38214 + ,16 + ,21 + ,8773 + ,16 + ,16 + ,35523 + ,0 + ,53 + ,52491 + ,33 + ,33 + ,32750 + ,1 + ,22 + ,22807 + ,5 + ,5 + ,31414 + ,18 + ,9 + ,14116 + ,39 + ,39 + ,24188 + ,8 + ,7 + ,5950 + ,7 + ,7 + ,22938 + ,12 + ,0 + ,1168 + ,11 + ,11 + ,21054 + ,4 + ,0 + ,855 + ,4 + ,4 + ,17547 + ,0 + ,4 + ,3926 + ,3 + ,3 + ,14688 + ,4 + ,0 + ,6023 + ,5 + ,5 + ,7199 + ,7 + ,0 + ,1644 + ,6 + ,6 + ,969 + ,0 + ,0 + ,0 + ,0 + ,0 + ,455 + ,0 + ,0 + ,0 + ,0 + ,0 + ,203 + ,0 + ,0 + ,0 + ,0 + ,0 + ,98 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0) + ,dim=c(6 + ,164) + ,dimnames=list(c('Y' + ,'X1' + ,'X2' + ,'X3' + ,'X4' + ,'X5') + ,1:164)) > y <- array(NA,dim=c(6,164),dimnames=list(c('Y','X1','X2','X3','X4','X5'),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/10qb01355234227.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] 6 > 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/2dztz1355234227.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 = 15.6308, df = 162, p-value < 2.2e-16 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.7060948 0.8300465 sample estimates: cor 0.7754356 > 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 15 warnings (use warnings() to see them) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/3xlta1355234227.tab") > > try(system("convert tmp/10qb01355234227.ps tmp/10qb01355234227.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.650 0.184 1.832