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(101.5,99.4,99.2,102.7,107.8,109.3,92.3,93.9,99.2,95.3,101.6,101.8,87,85.6,71.4,81.1,104.7,109.5,115.1,104.0,102.5,94.5,75.3,79.0,96.7,92.8,94.6,95.6,98.6,101.7,99.5,90.8,92,89.5,93.6,91.8,89.3,83.8,66.9,77.4,108.8,112.7,113.2,98.8,105.5,85.7,77.8,72.8,102.1,96.9,97,95.0,95.5,94.2,99.3,87.3,86.4,80.6,92.4,87.9,85.7,79.6,61.9,71.9,104.9,94.6,107.9,91.4,95.6,86.6,79.8,68.5,94.8,90.1,93.7,91.6,108.1,95.4,96.9,85.4,88.8,81.6,106.7,88.9,86.8,84.1,69.8,74.7,110.9,97.1,105.4,95.3,99.2,85.1,84.4,67.3,87.2,80.6,91.9,87.9,97.9,89.2,94.5,81.3,85,79.7,100.3,83.7,78.7,82.1,65.8,69.3,104.8,91.2,96,85.7,103.3,85.2,82.9,70.0,91.4,85.8,94.5,91.4,109.3,97.5,92.1,87.1,99.3,85.1,109.6,94.1,87.5,85.8,73.1,74.7,110.7,99.9,111.6,90.7,110.7,86.8,84,74.8,101.6,91.8,102.1,97.6,113.9,100.8,99,85.4,100.4,84.0,109.5,90.6,93,80.5,76.8,73.9,105.3,93.6),dim=c(2,81),dimnames=list(c('textiel','vervaardiging'),1:81)) > y <- array(NA,dim=c(2,81),dimnames=list(c('textiel','vervaardiging'),1:81)) > 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/1vqeg1260970550.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 = 7.5789, p-value = 3.486e-14 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.5750542 > 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/2srcz1260970550.tab") > > try(system("convert tmp/1vqeg1260970550.ps tmp/1vqeg1260970550.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.402 0.206 0.509