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(-22,46,-29,60,-20,50,-31,57,-17,49,-27,56,-21,48,-28,56,-16,50,-22,59,-11,47,-22,57,-19,50,-30,62,-31,49,-33,62,-36,51,-41,59,-33,52,-39,57,-26,48,-40,63,-38,55,-49,61,-27,56,-40,59,-21,43,-36,58,-17,44,-34,58,-14,50,-30,58,-16,49,-33,55,-16,47,-36,55,-15,46,-33,56,-7,50,-33,60,-9,49,-27,56,2,53,-22,59,-6,54,-28,59,0,56,-27,63,7,56,-27,60,4,58,-23,58,-5,53,-31,57,2,51,-28,58,0,52,-21,55,3,53,-23,57,10,56,-19,56,4,54,-20,53,5,54,-21,61,7,56,-26,65,1,59,-29,66,-8,62,-31,65,-3,62,-31,68,-16,73,-47,78,-22,76,-48,79,-32,80,-58,80,-30,77,-59,84,-32,81,-57,84,-38,80,-64,86,-41,80,-65,86,-46,81,-71,81,-58,80,-72,80,-55,77,-71,79,-48,71,-66,76,-58,71,-73,78,-58,64,-68,69,-68,64,-67,70,-75,47,-69,59,-77,41,-72,55,-75,35,-68,47,-71,34,-70,48,-63,33,-67,47,-61,23,-63,45,-53,16,-61,36,-41,16,-58,44,-35,8,-57,33,-33,9,-52,34),dim=c(4,61),dimnames=list(c('econVl','prijsVl','econWa','prijsWa'),1:61)) > y <- array(NA,dim=c(4,61),dimnames=list(c('econVl','prijsVl','econWa','prijsWa'),1:61)) > 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/1b7am1257953591.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] 4 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 1.2656, p-value = 0.2057 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.1131589 > 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/2xfpz1257953591.tab") > > system("convert tmp/1b7am1257953591.ps tmp/1b7am1257953591.png") > > > proc.time() user system elapsed 0.506 0.216 0.673