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(1.2111 + ,10.574 + ,100.03 + ,2 + ,1.2409 + ,10.653 + ,100.25 + ,1.8 + ,1.2737 + ,10.805 + ,99.6 + ,2.7 + ,1.3295 + ,10.872 + ,100.16 + ,2.3 + ,1.3621 + ,10.625 + ,100.49 + ,1.9 + ,1.3035 + ,10.407 + ,99.72 + ,2 + ,1.3257 + ,10.463 + ,100.14 + ,2.3 + ,1.2964 + ,10.556 + ,98.48 + ,2.8 + ,1.2957 + ,10.646 + ,100.38 + ,2.4 + ,1.2331 + ,10.702 + ,101.45 + ,2.3 + ,1.2092 + ,11.353 + ,98.42 + ,2.7 + ,1.2093 + ,11.346 + ,98.6 + ,2.7 + ,1.2198 + ,11.451 + ,100.06 + ,2.9 + ,1.2042 + ,11.964 + ,98.62 + ,3 + ,1.2023 + ,12.574 + ,100.84 + ,2.2 + ,1.1769 + ,13.031 + ,100.02 + ,2.3 + ,1.1797 + ,13.812 + ,97.95 + ,2.8 + ,1.2118 + ,14.544 + ,98.32 + ,2.8 + ,1.1875 + ,14.931 + ,98.27 + ,2.8 + ,1.2104 + ,14.886 + ,97.22 + ,2.2 + ,1.2537 + ,16.005 + ,99.28 + ,2.6 + ,1.2868 + ,17.064 + ,100.38 + ,2.8 + ,1.2713 + ,15.168 + ,99.02 + ,2.5 + ,1.2767 + ,16.050 + ,100.32 + ,2.4 + ,1.2851 + ,15.839 + ,99.81 + ,2.3 + ,1.266 + ,15.137 + ,100.6 + ,1.9 + ,1.2696 + ,14.954 + ,101.19 + ,1.7 + ,1.32 + ,15.648 + ,100.47 + ,2 + ,1.317 + ,15.305 + ,101.77 + ,2.1 + ,1.2954 + ,15.579 + ,102.32 + ,1.7 + ,1.3211 + ,16.348 + ,102.39 + ,1.8 + ,1.3318 + ,15.928 + ,101.16 + ,1.8 + ,1.3605 + ,16.171 + ,100.63 + ,1.8 + ,1.3453 + ,15.937 + ,101.48 + ,1.3 + ,1.3505 + ,15.713 + ,101.44 + ,1.3 + ,1.3707 + ,15.594 + ,100.09 + ,1.3 + ,1.3705 + ,15.683 + ,100.7 + ,1.2 + ,1.4179 + ,16.438 + ,100.78 + ,1.4 + ,1.4447 + ,17.032 + ,99.81 + ,2.2 + ,1.4761 + ,17.696 + ,98.45 + ,2.9 + ,1.4721 + ,17.745 + ,98.49 + ,3.1 + ,1.487 + ,19.394 + ,97.48 + ,3.5 + ,1.5167 + ,20.148 + ,97.91 + ,3.6 + ,1.5812 + ,20.108 + ,96.94 + ,4.4 + ,1.554 + ,18.584 + ,98.53 + ,4.1 + ,1.5508 + ,18.441 + ,96.82 + ,5.1 + ,1.5764 + ,18.391 + ,95.76 + ,5.8 + ,1.5611 + ,19.178 + ,95.27 + ,5.9 + ,1.4735 + ,18.079 + ,97.32 + ,5.4 + ,1.4303 + ,18.483 + ,96.68 + ,5.5 + ,1.2757 + ,19.644 + ,97.87 + ,4.8 + ,1.2727 + ,19.195 + ,97.42 + ,3.2 + ,1.3917 + ,19.650 + ,97.94 + ,2.7 + ,1.2816 + ,20.830 + ,99.52 + ,2.1 + ,1.2644 + ,23.595 + ,100.99 + ,1.9 + ,1.3308 + ,22.937 + ,99.92 + ,0.6 + ,1.3275 + ,21.814 + ,101.97 + ,0.7 + ,1.4098 + ,21.928 + ,101.58 + ,-0.2 + ,1.4134 + ,21.777 + ,99.54 + ,-1 + ,1.4138 + ,21.383 + ,100.83 + ,-1.7 + ,1.4272 + ,21.467 + ,-0.7) + ,dim=c(4 + ,61) + ,dimnames=list(c('Wisselkoers' + ,'Goudkoers' + ,'Ruilvoet' + ,'Inflatie') + ,1:61)) > y <- array(NA,dim=c(4,61),dimnames=list(c('Wisselkoers','Goudkoers','Ruilvoet','Inflatie'),1:61)) > 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/1sov11257952799.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 = 4.5303, p-value = 5.89e-06 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.3978142 > 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/2firs1257952799.tab") > > system("convert tmp/1sov11257952799.ps tmp/1sov11257952799.png") > > > proc.time() user system elapsed 0.600 0.390 0.957