R version 2.7.0 (2008-04-22) 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(17409,117.09,87,11514,116.77,96.3,31514,119.39,107.1,27071,122.49,115.2,29462,124.08,106.1,26105,118.29,89.5,22397,112.94,91.3,23843,113.79,97.6,21705,114.43,100.7,18089,118.7,104.6,20764,120.36,94.7,25316,118.27,101.8,17704,118.34,102.5,15548,117.82,105.3,28029,117.65,110.3,29383,118.18,109.8,36438,121.02,117.3,32034,124.78,118.8,22679,131.16,131.3,24319,130.14,125.9,18004,131.75,133.1,17537,134.73,147,20366,135.35,145.8,22782,140.32,164.4,19169,136.35,149.8,13807,131.6,137.7,29743,128.9,151.7,25591,133.89,156.8,29096,138.25,180,26482,146.23,180.4,22405,144.76,170.4,27044,149.3,191.6,17970,156.8,199.5,18730,159.08,218.2,19684,165.12,217.5,19785,163.14,205,18479,153.43,194,10698,151.01,199.3,31956,154.72,219.3,29506,154.58,211.1,34506,155.63,215.2,27165,161.67,240.2,26736,163.51,242.2,23691,162.91,240.7,18157,164.8,255.4,17328,164.98,253,18205,154.54,218.2,20995,148.6,203.7,17382,149.19,205.6,9367,150.61,215.6),dim=c(3,50),dimnames=list(c('Wagens','Index','Olie'),1:50)) > y <- array(NA,dim=c(3,50),dimnames=list(c('Wagens','Index','Olie'),1:50)) > 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/1ff3q1229547788.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] 3 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = -0.527, p-value = 0.5982 alternative hypothesis: true tau is not equal to 0 sample estimates: tau -0.05142857 > 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/2lgdn1229547788.tab") > > system("convert tmp/1ff3q1229547788.ps tmp/1ff3q1229547788.png") > > > proc.time() user system elapsed 1.271 0.333 1.331