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(104.3 + ,97.5 + ,0.2 + ,513 + ,103.9 + ,97.1 + ,0.8 + ,503 + ,103.9 + ,97.5 + ,1.2 + ,471 + ,103.9 + ,98.5 + ,4.5 + ,471 + ,108.0 + ,100.5 + ,0.4 + ,476 + ,108.0 + ,102.8 + ,5.9 + ,475 + ,108.0 + ,105.2 + ,6.5 + ,470 + ,108.0 + ,107.4 + ,12.8 + ,461 + ,108.0 + ,108.0 + ,4.2 + ,455 + ,108.0 + ,107.6 + ,-3.3 + ,456 + ,108.0 + ,107.0 + ,-12.5 + ,517 + ,108.0 + ,105.8 + ,-16.3 + ,525 + ,108.0 + ,104.3 + ,-10.5 + ,523 + ,108.0 + ,103.8 + ,-11.8 + ,519 + ,108.0 + ,104.4 + ,-11.4 + ,509 + ,108.0 + ,106.2 + ,-17.7 + ,512 + ,108.0 + ,108.5 + ,-17.3 + ,519 + ,108.0 + ,109.8 + ,-18.6 + ,517 + ,108.0 + ,110.3 + ,-17.9 + ,510 + ,108.0 + ,109.7 + ,-21.4 + ,509 + ,108.0 + ,108.7 + ,-19.4 + ,501 + ,108.0 + ,108.9 + ,-15.5 + ,507 + ,108.0 + ,109.7 + ,-7.7 + ,569 + ,108.0 + ,110.4 + ,-0.7 + ,580 + ,108.0 + ,111.4 + ,-1.6 + ,578 + ,108.0 + ,112.6 + ,1.4 + ,565 + ,108.0 + ,113.6 + ,0.7 + ,547 + ,108.2 + ,113.8 + ,9.5 + ,555 + ,112.3 + ,113.2 + ,1.4 + ,562 + ,111.3 + ,113.6 + ,4.1 + ,561 + ,111.3 + ,113.9 + ,6.6 + ,555 + ,115.3 + ,113.4 + ,18.4 + ,544 + ,117.2 + ,113.8 + ,16.9 + ,537 + ,118.3 + ,116.0 + ,9.2 + ,543 + ,118.3 + ,118.3 + ,-4.3 + ,594 + ,118.3 + ,120.5 + ,-5.9 + ,611 + ,119.0 + ,121.9 + ,-7.7 + ,613 + ,120.6 + ,121.2 + ,-5.4 + ,611 + ,122.6 + ,120.2 + ,-2.3 + ,594 + ,122.6 + ,120.6 + ,-4.8 + ,595 + ,127.4 + ,110.2 + ,2.3 + ,591 + ,125.9 + ,109.2 + ,-5.2 + ,589 + ,121.5 + ,108.7 + ,-10 + ,584 + ,118.8 + ,109.9 + ,-17.1 + ,573 + ,121.6 + ,112.2 + ,-14.4 + ,567 + ,122.3 + ,114.5 + ,-3.9 + ,569 + ,122.7 + ,114.7 + ,3.7 + ,621 + ,120.8 + ,113.2 + ,6.5 + ,629 + ,120.1 + ,112.1 + ,0.9 + ,628 + ,120.1 + ,112.6 + ,-4.1 + ,612 + ,120.1 + ,113.6 + ,-7 + ,595 + ,120.1 + ,114.0 + ,-12.2 + ,597 + ,128.4 + ,114.5 + ,-2.5 + ,593 + ,129.8 + ,115.0 + ,4.4 + ,590 + ,129.8 + ,114.9 + ,13.7 + ,580 + ,128.6 + ,114.8 + ,12.3 + ,574 + ,128.6 + ,114.3 + ,13.4 + ,573 + ,133.7 + ,113.7 + ,2.2 + ,573 + ,130.0 + ,114.5 + ,1.7 + ,620 + ,125.9 + ,116.0 + ,-7.2 + ,626 + ,129.4 + ,116.6 + ,-4.8 + ,620 + ,129.4 + ,116.2 + ,-2.9 + ,588 + ,130.6 + ,115.7 + ,-2.4 + ,566 + ,130.6 + ,115.6 + ,-2.5 + ,557 + ,130.6 + ,115.2 + ,-5.3 + ,561 + ,130.8 + ,115.0 + ,-7.1 + ,549 + ,129.7 + ,115.7 + ,-8 + ,532 + ,125.8 + ,115.9 + ,-8.9 + ,526 + ,126.0 + ,115.6 + ,-7.7 + ,511 + ,125.6 + ,115.9 + ,-1.1 + ,499 + ,125.4 + ,117.0 + ,4 + ,555 + ,124.7 + ,117.9 + ,9.6 + ,565 + ,126.9 + ,118.8 + ,10.9 + ,542 + ,129.1 + ,119.9 + ,13 + ,527) + ,dim=c(4 + ,74) + ,dimnames=list(c('energieprijzen' + ,'industriële_productie' + ,'nieuwe_personenwagens' + ,'werkloosheid') + ,1:74)) > y <- array(NA,dim=c(4,74),dimnames=list(c('energieprijzen','industriële_productie','nieuwe_personenwagens','werkloosheid'),1:74)) > 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/1lw2z1230053902.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 = 6.6268, p-value = 3.430e-11 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.5473565 > 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/2tiiv1230053902.tab") > > system("convert tmp/1lw2z1230053902.ps tmp/1lw2z1230053902.png") > > > proc.time() user system elapsed 0.527 0.215 0.604