R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(1721 + ,0 + ,0.44 + ,1476 + ,0 + ,0.09 + ,1842 + ,0 + ,0.2 + ,2171 + ,0 + ,0.82 + ,1670 + ,0 + ,0.5 + ,1540 + ,0 + ,0.2 + ,1266 + ,0 + ,1 + ,897 + ,0 + ,0.47 + ,1266 + ,0 + ,0.49 + ,1519 + ,0 + ,0.82 + ,1074 + ,0 + ,0.39 + ,1435 + ,0 + ,0.6 + ,1385 + ,0 + ,0.59 + ,1440 + ,0 + ,0.72 + ,1883 + ,0 + ,0.97 + ,1822 + ,0 + ,0.58 + ,1661 + ,0 + ,0.27 + ,1774 + ,0 + ,0.84 + ,1133 + ,0 + ,0.51 + ,1361 + ,0 + ,0.13 + ,1688 + ,0 + ,0.65 + ,2216 + ,0 + ,0.51 + ,2896 + ,0 + ,1.06 + ,1382 + ,0 + ,0.81 + ,1330 + ,0 + ,0.54 + ,1419 + ,0 + ,0.85 + ,1662 + ,0 + ,0.93 + ,2040 + ,0 + ,0.29 + ,2126 + ,0 + ,1.01 + ,1649 + ,0 + ,0.65 + ,1610 + ,0 + ,0.88 + ,1952 + ,0 + ,0.45 + ,2102 + ,0 + ,0.74 + ,1749 + ,0 + ,1.08 + ,2091 + ,0 + ,0.27 + ,3036 + ,0 + ,0.24 + ,2414 + ,0 + ,0.27 + ,2097 + ,0 + ,0.25 + ,2705 + ,0 + ,0.69 + ,2431 + ,0 + ,0.73 + ,4192 + ,1 + ,1.04 + ,3990 + ,0 + ,1.04 + ,2854 + ,0 + ,0.3 + ,1966 + ,0 + ,0.59 + ,2431 + ,0 + ,0.72 + ,2763 + ,0 + ,0.22 + ,2831 + ,0 + ,1.12 + ,2023 + ,0 + ,0.93 + ,2934 + ,0 + ,0.99 + ,2489 + ,0 + ,0.56 + ,3252 + ,0 + ,1 + ,3018 + ,0 + ,0.57 + ,3193 + ,0 + ,1 + ,3976 + ,0 + ,0.97 + ,2584 + ,0 + ,0.3 + ,2512 + ,0 + ,0.45 + ,2169 + ,0 + ,0.73 + ,2504 + ,0 + ,1.13 + ,1843 + ,0 + ,0.65 + ,1408 + ,-1 + ,0.64 + ,2179 + ,0 + ,0.68 + ,3690 + ,0 + ,0.41 + ,2372 + ,0 + ,0.98 + ,2494 + ,0 + ,0.3 + ,3872 + ,0 + ,0.37 + ,2786 + ,0 + ,1.12 + ,2312 + ,0 + ,0.4 + ,1599 + ,0 + ,0.5 + ,3167 + ,0 + ,1.23 + ,3433 + ,0 + ,0.94 + ,2648 + ,0 + ,1.08 + ,1978 + ,0 + ,1.12 + ,1947 + ,0 + ,0.83 + ,3113 + ,0 + ,1.22 + ,2856 + ,0 + ,0.55 + ,3174 + ,0 + ,0.38 + ,3507 + ,0 + ,1.26 + ,4174 + ,0 + ,0.49 + ,2978 + ,0 + ,1.13 + ,4428 + ,0 + ,1.07 + ,2832 + ,0 + ,0.86 + ,2930 + ,0 + ,0.94 + ,3681 + ,0 + ,0.45 + ,3253 + ,0 + ,0.66 + ,1660 + ,-1 + ,0.71 + ,2208 + ,0 + ,0.54 + ,3139 + ,0 + ,0.9 + ,3409 + ,0 + ,1.23 + ,3445 + ,0 + ,0.46 + ,2410 + ,0 + ,1.33 + ,3262 + ,0 + ,0.64 + ,2897 + ,0 + ,0.9 + ,2526 + ,0 + ,0.5 + ,3982 + ,0 + ,1.37 + ,4097 + ,0 + ,0.96 + ,3403 + ,0 + ,0.62 + ,3362 + ,0 + ,1.24 + ,2708 + ,0 + ,1.1 + ,3129 + ,0 + ,0.86 + ,3550 + ,0 + ,1.2 + ,2696 + ,0 + ,0.77 + ,2885 + ,0 + ,0.67 + ,2945 + ,0 + ,1.05 + ,3600 + ,0 + ,1.32 + ,3808 + ,0 + ,0.6 + ,3671 + ,0 + ,1.31 + ,4005 + ,0 + ,1.41) + ,dim=c(3 + ,107) + ,dimnames=list(c('Y' + ,'D' + ,'X') + ,1:107)) > y <- array(NA,dim=c(3,107),dimnames=list(c('Y','D','X'),1:107)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > main = 'Kendall tau Correlation Plot' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), 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: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > 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='kendall') + 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/www/html/freestat/rcomp/tmp/1mspj1229549366.ps",horizontal=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/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Kendall tau rank correlations for all pairs of data series',3,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'pair',1,TRUE) > a<-table.element(a,'tau',1,TRUE) > a<-table.element(a,'p-value',1,TRUE) > a<-table.row.end(a) > n <- length(y[,1]) > n [1] 3 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 2.4341, p-value = 0.01493 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.1933756 > for (i in 1:(n-1)) + { + for (j in (i+1):n) + { + a<-table.row.start(a) + dum <- paste('tau(',dimnames(t(x))[[2]][i]) + dum <- paste(dum,',') + dum <- paste(dum,dimnames(t(x))[[2]][j]) + dum <- paste(dum,')') + a<-table.element(a,dum,header=TRUE) + r <- cor.test(y[i,],y[j,],method='kendall') + a<-table.element(a,r$estimate) + a<-table.element(a,r$p.value) + a<-table.row.end(a) + } + } > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/21p5y1229549366.tab") > > system("convert tmp/1mspj1229549366.ps tmp/1mspj1229549366.png") > > > proc.time() user system elapsed 0.667 0.268 0.723