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(1818 + ,279055 + ,73 + ,1433 + ,212408 + ,75 + ,2059 + ,233939 + ,83 + ,2733 + ,222117 + ,106 + ,1399 + ,189911 + ,56 + ,631 + ,70849 + ,28 + ,5460 + ,605767 + ,135 + ,381 + ,33186 + ,19 + ,2150 + ,227332 + ,62 + ,2042 + ,267925 + ,49 + ,2536 + ,371987 + ,122 + ,2429 + ,276291 + ,132 + ,2100 + ,212638 + ,87 + ,3020 + ,368577 + ,85 + ,2265 + ,269455 + ,88 + ,5139 + ,398124 + ,191 + ,2363 + ,335567 + ,77 + ,3564 + ,432711 + ,173 + ,1516 + ,185822 + ,59 + ,2398 + ,267365 + ,89 + ,2546 + ,279428 + ,73 + ,3253 + ,527853 + ,112 + ,1705 + ,220142 + ,49 + ,1787 + ,200004 + ,58 + ,3792 + ,257139 + ,133 + ,3108 + ,270941 + ,138 + ,3230 + ,324969 + ,134 + ,2348 + ,329962 + ,92 + ,1780 + ,190867 + ,60 + ,3218 + ,393860 + ,79 + ,2692 + ,327660 + ,89 + ,2187 + ,269239 + ,83 + ,2577 + ,396136 + ,106 + ,1293 + ,130446 + ,49 + ,3567 + ,430118 + ,104 + ,2764 + ,273950 + ,56 + ,3755 + ,428077 + ,128 + ,2075 + ,254312 + ,93 + ,995 + ,120351 + ,35 + ,3750 + ,395658 + ,212 + ,3413 + ,345875 + ,86 + ,2053 + ,216827 + ,82 + ,1984 + ,224524 + ,83 + ,1825 + ,182485 + ,69 + ,2783 + ,168492 + ,86 + ,5572 + ,459455 + ,157 + ,918 + ,78800 + ,42 + ,2685 + ,255072 + ,85 + ,4145 + ,368086 + ,123 + ,2841 + ,230299 + ,70 + ,2175 + ,244782 + ,81 + ,496 + ,24188 + ,24 + ,2699 + ,400109 + ,334 + ,744 + ,65029 + ,17 + ,1161 + ,101097 + ,64 + ,3333 + ,309810 + ,67 + ,2970 + ,375638 + ,91 + ,3969 + ,367127 + ,205 + ,2919 + ,387748 + ,156 + ,2399 + ,280106 + ,90 + ,4121 + ,400971 + ,153 + ,3323 + ,322755 + ,123 + ,3132 + ,291391 + ,124 + ,2868 + ,295075 + ,93 + ,1778 + ,280018 + ,81 + ,2109 + ,267432 + ,71 + ,2148 + ,217181 + ,141 + ,3009 + ,258166 + ,159 + ,2562 + ,264771 + ,88 + ,1737 + ,182961 + ,73 + ,2680 + ,256967 + ,74 + ,893 + ,73566 + ,32 + ,2389 + ,272362 + ,93 + ,2197 + ,229056 + ,62 + ,2227 + ,229851 + ,70 + ,2370 + ,371391 + ,91 + ,3226 + ,398210 + ,104 + ,1978 + ,220419 + ,111 + ,2516 + ,231884 + ,72 + ,2147 + ,219381 + ,73 + ,2150 + ,206169 + ,54 + ,4229 + ,483074 + ,132 + ,1380 + ,146100 + ,72 + ,2449 + ,295224 + ,109 + ,870 + ,80953 + ,25 + ,2700 + ,217384 + ,63 + ,1574 + ,179344 + ,62 + ,4046 + ,415550 + ,222 + ,3259 + ,389059 + ,129 + ,3098 + ,180679 + ,106 + ,2615 + ,299505 + ,104 + ,2404 + ,292260 + ,84 + ,1932 + ,199481 + ,68 + ,3147 + ,282361 + ,78 + ,2598 + ,329281 + ,89 + ,2108 + ,234577 + ,48 + ,2193 + ,297995 + ,67 + ,2478 + ,342490 + ,90 + ,4198 + ,416463 + ,163 + ,4165 + ,429565 + ,120 + ,2842 + ,297080 + ,142 + ,2562 + ,331792 + ,71 + ,2449 + ,229772 + ,202 + ,602 + ,43287 + ,14 + ,2579 + ,238089 + ,87 + ,2591 + ,263322 + ,160 + ,2957 + ,302082 + ,61 + ,2786 + ,321797 + ,95 + ,1477 + ,193926 + ,96 + ,3350 + ,175138 + ,105 + ,2107 + ,354041 + ,78 + ,2332 + ,303273 + ,91 + ,400 + ,23668 + ,13 + ,2233 + ,196743 + ,79 + ,530 + ,61857 + ,25 + ,2033 + ,217543 + ,54 + ,3246 + ,440711 + ,128 + ,387 + ,21054 + ,16 + ,2137 + ,252805 + ,52 + ,492 + ,31961 + ,22 + ,3838 + ,360436 + ,125 + ,2193 + ,251948 + ,77 + ,1796 + ,187320 + ,97 + ,1907 + ,180842 + ,58 + ,568 + ,38214 + ,34 + ,2602 + ,280392 + ,56 + ,2819 + ,358276 + ,84 + ,1464 + ,211775 + ,67 + ,3946 + ,447335 + ,90 + ,2554 + ,348017 + ,99 + ,3506 + ,441946 + ,133 + ,1552 + ,215177 + ,43 + ,1389 + ,130177 + ,47 + ,3101 + ,318037 + ,365 + ,4541 + ,466139 + ,198 + ,1872 + ,162279 + ,62 + ,4403 + ,416643 + ,140 + ,2113 + ,178322 + ,86 + ,2046 + ,292443 + ,54 + ,2564 + ,283913 + ,100 + ,2145 + ,251070 + ,128 + ,4112 + ,387072 + ,125 + ,2340 + ,246963 + ,93 + ,2035 + ,173260 + ,63 + ,3241 + ,346748 + ,108 + ,1991 + ,178402 + ,60 + ,2864 + ,277892 + ,97 + ,2748 + ,314070 + ,112 + ,2 + ,1 + ,0 + ,207 + ,14688 + ,10 + ,5 + ,98 + ,1 + ,8 + ,455 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,2449 + ,291847 + ,95 + ,3490 + ,415421 + ,168 + ,0 + ,0 + ,0 + ,4 + ,203 + ,4 + ,151 + ,7199 + ,5 + ,475 + ,46660 + ,21 + ,141 + ,17547 + ,5 + ,1145 + ,121550 + ,46 + ,29 + ,969 + ,2 + ,2080 + ,242774 + ,75) + ,dim=c(3 + ,164) + ,dimnames=list(c('A' + ,'B' + ,'C') + ,1:164)) > y <- array(NA,dim=c(3,164),dimnames=list(c('A','B','C'),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 = 'kendall' > main = 'Correlation Matrix' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > 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/1bu7p1324655069.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/2wg291324655069.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) Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 13.6784, p-value < 2.2e-16 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.719985 > 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/3bs241324655069.tab") > > try(system("convert tmp/1bu7p1324655069.ps tmp/1bu7p1324655069.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.704 0.109 0.807