R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(2.02,2.64,2.03,2.75,2.01,2.7,2.08,2.87,2.02,3.03,2.03,3.14,2.07,3.02,2.04,2.86,2.05,3.07,2.11,2.93,2.09,2.83,2.05,2.72,2.08,2.73,2.06,2.72,2.06,2.77,2.08,2.61,2.07,2.47,2.06,2.3,2.07,2.38,2.06,2.43,2.09,2.39,2.07,2.6,2.09,2.84,2.28,2.87,2.33,2.92,2.35,3.08,2.52,3.33,2.63,3.48,2.58,3.57,2.70,3.66,2.81,3.77,2.97,3.75,3.04,3.75,3.28,3.81,3.33,3.82,3.50,3.89,3.56,4.05,3.57,4.1,3.69,4.07,3.82,4.26,3.79,4.4,3.96,4.61,4.06,4.63,4.05,4.48,4.03,4.46,3.94,4.45,4.02,4.32,3.88,4.52,4.02,4.21,4.03,3.97,4.09,4.12,3.99,4.5,4.01,4.73,4.01,5.26,4.19,5.2,4.30,4.94,4.27,4.95,3.82,4.52,3.15,3.85,2.49,3.41,1.81,2.95,1.26,2.68,1.06,2.53,0.84,2.44,0.78,2.16,0.70,2.2,0.36,2.1,0.35,2.29,0.36,2.03,0.36,2.05,0.36,1.94),dim=c(2,71),dimnames=list(c('Intb','Eobm'),1:71)) > y <- array(NA,dim=c(2,71),dimnames=list(c('Intb','Eobm'),1:71)) > 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/rcomp/tmp/1nzzr1260622899.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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] 2 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 9.6148, p-value < 2.2e-16 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.7846115 > 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/rcomp/tmp/2zgm81260622899.tab") > > system("convert tmp/1nzzr1260622899.ps tmp/1nzzr1260622899.png") > > > proc.time() user system elapsed 0.403 0.177 0.482