R version 2.6.1 (2007-11-26) Copyright (C) 2007 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(513,6.6,87,503,7.8,75,471,7.4,74,471,7.4,91,476,7.5,101,475,7.4,103,470,7.4,106,461,7,102,455,6.9,105,456,6.9,105,517,7.6,100,525,7.7,95,523,7.6,96,519,8.2,98,509,8,99,512,8.1,92,519,8.3,84,517,8.2,81,510,8.1,72,509,7.7,89,501,7.6,96,507,7.7,91,569,8.2,88,580,8.4,90,578,8.4,98,565,8.6,87,547,8.4,100,555,8.5,100,562,8.7,104,561,8.7,107,555,8.6,105,544,7.4,102,537,7.3,98,543,7.4,106,594,9,97,611,9.2,101,613,9.2,100,611,8.5,93,594,8.3,94,595,8.3,96,591,8.6,96,589,8.6,98,584,8.5,102,573,8.1,95,567,8.1,85,569,8,84,621,8.6,82,629,8.7,87,628,8.7,77,612,8.6,90,595,8.4,90,597,8.4,94,593,8.7,97,590,8.7,96,580,8.5,93,574,8.3,93,573,8.3,93,573,8.3,97,620,8.1,100,626,8.2,95,620,8.1,97,588,8.1,103,566,7.9,102,557,7.7,93,561,8.1,99,549,8,100,532,7.7,97,526,7.8,104,511,7.6,102,499,7.4,103,555,7.7,100,565,7.8,90,542,7.5,90),dim=c(3,73),dimnames=list(c('WLoos','WZoeken','Econ'),1:73)) > y <- array(NA,dim=c(3,73),dimnames=list(c('WLoos','WZoeken','Econ'),1:73)) > 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: Wessa P., (2007), Multivariate Correlation Matrix (v1.0.3) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_pairs.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program 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='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/1w4441198167226.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 > 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] 3 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 7.3538, p-value = 1.925e-13 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.6046687 > 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/2gwe51198167227.tab") > > system("convert tmp/1w4441198167226.ps tmp/1w4441198167226.png") > > > proc.time() user system elapsed 2.115 0.573 2.189