R version 2.8.1 (2008-12-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(2.86 + ,8.9 + ,100.64 + ,101 + ,2.55 + ,8.6 + ,100.63 + ,100.88 + ,2.27 + ,8.3 + ,100.43 + ,100.55 + ,2.26 + ,8.3 + ,100.80 + ,100.83 + ,2.57 + ,8.3 + ,101.33 + ,101.51 + ,3.07 + ,8.4 + ,101.88 + ,102.16 + ,2.76 + ,8.5 + ,101.85 + ,102.39 + ,2.51 + ,8.4 + ,102.04 + ,102.54 + ,2.87 + ,8.6 + ,102.22 + ,102.85 + ,3.14 + ,8.5 + ,102.63 + ,103.47 + ,3.11 + ,8.5 + ,102.65 + ,103.57 + ,3.16 + ,8.5 + ,102.54 + ,103.69 + ,2.47 + ,8.5 + ,102.37 + ,103.5 + ,2.57 + ,8.5 + ,102.68 + ,103.47 + ,2.89 + ,8.5 + ,102.76 + ,103.45 + ,2.63 + ,8.5 + ,102.82 + ,103.48 + ,2.38 + ,8.5 + ,103.31 + ,103.93 + ,1.69 + ,8.5 + ,103.23 + ,103.89 + ,1.96 + ,8.5 + ,103.60 + ,104.4 + ,2.19 + ,8.5 + ,103.95 + ,104.79 + ,1.87 + ,8.6 + ,103.93 + ,104.77 + ,1.60 + ,8.4 + ,104.25 + ,105.13 + ,1.63 + ,8.1 + ,104.38 + ,105.26 + ,1.22 + ,8 + ,104.36 + ,104.96 + ,1.21 + ,8 + ,104.32 + ,104.75 + ,1.49 + ,8 + ,104.58 + ,105.01 + ,1.64 + ,8 + ,104.68 + ,105.15 + ,1.66 + ,7.9 + ,104.92 + ,105.2 + ,1.77 + ,7.8 + ,105.46 + ,105.77 + ,1.82 + ,7.8 + ,105.23 + ,105.78 + ,1.78 + ,7.9 + ,105.58 + ,106.26 + ,1.28 + ,8.1 + ,105.34 + ,106.13 + ,1.29 + ,8 + ,105.28 + ,106.12 + ,1.37 + ,7.6 + ,105.70 + ,106.57 + ,1.12 + ,7.3 + ,105.67 + ,106.44 + ,1.51 + ,7 + ,105.71 + ,106.54 + ,2.24 + ,6.8 + ,106.19 + ,107.1 + ,2.94 + ,7 + ,106.93 + ,108.1 + ,3.09 + ,7.1 + ,107.44 + ,108.4 + ,3.46 + ,7.2 + ,107.85 + ,108.84 + ,3.64 + ,7.1 + ,108.71 + ,109.62 + ,4.39 + ,6.9 + ,109.32 + ,110.42 + ,4.15 + ,6.7 + ,109.49 + ,110.67 + ,5.21 + ,6.7 + ,110.20 + ,111.66 + ,5.80 + ,6.6 + ,110.62 + ,112.28 + ,5.91 + ,6.9 + ,111.22 + ,112.87 + ,5.39 + ,7.3 + ,110.88 + ,112.18 + ,5.46 + ,7.5 + ,111.15 + ,112.16 + ,4.72 + ,7.3 + ,111.29 + ,112.36 + ,3.14 + ,7.1 + ,111.09 + ,111.49 + ,2.63 + ,6.9 + ,111.24 + ,111.25 + ,2.32 + ,7.1 + ,111.45 + ,111.36 + ,1.93 + ,7.5 + ,111.75 + ,111.74 + ,0.62 + ,7.7 + ,111.07 + ,111.1 + ,0.6 + ,7.8 + ,111.17 + ,111.33 + ,-0.37 + ,7.8 + ,110.96 + ,111.25 + ,-1.1 + ,7.7 + ,110.50 + ,111.4 + ,-1.68 + ,7.7 + ,110.48 + ,110.97 + ,-0.78 + ,7.8 + ,110.66 + ,111.32 + ,-1.19 + ,7.9 + ,110.46 + ,111.02) + ,dim=c(4 + ,60) + ,dimnames=list(c('Inflatiegraad' + ,'Werkloosheidsgraad' + ,'Gezondheidsindex' + ,'Consumptieprijzenindex') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('Inflatiegraad','Werkloosheidsgraad','Gezondheidsindex','Consumptieprijzenindex'),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/rcomp/tmp/1npbq1257940117.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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.5004, p-value = 0.6168 alternative hypothesis: true tau is not equal to 0 sample estimates: tau -0.0456394 > 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/rcomp/tmp/2ag8j1257940117.tab") > > system("convert tmp/1npbq1257940117.ps tmp/1npbq1257940117.png") > > > proc.time() user system elapsed 0.500 0.310 0.832