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(0,49,34,39,9,46,39,33,1,45,40,32,4,49,45,34,6,47,43,37,21,45,42,38,24,48,49,28,23,51,43,31,22,48,50,28,21,49,44,30,20,51,40,39,16,54,41,38,18,52,45,39,18,52,45,38,24,53,48,37,16,51,54,32,15,55,47,32,24,53,35,44,18,51,28,43,15,52,28,42,4,54,34,38,3,58,23,37,6,57,33,35,5,52,38,37,12,50,41,33,12,53,47,24,12,50,46,24,14,50,45,31,12,51,47,25,17,53,49,28,12,49,50,24,20,54,56,25,21,57,50,16,15,58,56,17,22,56,58,11,19,60,59,12,19,55,51,39,26,54,59,19,25,52,60,14,19,55,60,15,20,56,68,7,30,54,62,12,31,53,62,12,35,59,58,14,33,62,56,9,26,63,50,8,25,64,52,4,17,75,36,7,14,77,33,3,8,79,26,5,12,77,28,0,7,82,27,-2,4,83,20,6,10,81,16,11,8,78,11,9,16,79,0,17,14,79,3,21,20,73,10,21,9,72,0,41,10,67,3,57),dim=c(4,60),dimnames=list(c('Spaargedrag','Consumptieprijzen','Econsituatie','Werkloosheidsvooruitzichten'),1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('Spaargedrag','Consumptieprijzen','Econsituatie','Werkloosheidsvooruitzichten'),1:60)) > 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/1koa01228485508.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 = -0.2048, p-value = 0.8377 alternative hypothesis: true tau is not equal to 0 sample estimates: tau -0.01868073 > 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/2698g1228485508.tab") > > system("convert tmp/1koa01228485508.ps tmp/1koa01228485508.png") > > > proc.time() user system elapsed 0.485 0.224 0.569