R version 2.6.0 (2007-10-03) Copyright (C) 2007 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(87.0 + ,1.0014 + ,10.244 + ,106.7 + ,96.3 + ,1.0183 + ,10.511 + ,101.1 + ,107.1 + ,1.0622 + ,10.812 + ,97.8 + ,115.2 + ,1.0773 + ,10.738 + ,113.8 + ,106.1 + ,1.0807 + ,10.171 + ,107.1 + ,89.5 + ,1.0848 + ,9.721 + ,117.5 + ,91.3 + ,1.1582 + ,9.897 + ,113.7 + ,97.6 + ,1.1663 + ,9.828 + ,106.6 + ,100.7 + ,1.1372 + ,9.924 + ,109.8 + ,104.6 + ,1.1139 + ,10.371 + ,108.8 + ,94.7 + ,1.1222 + ,10.846 + ,102.0 + ,101.8 + ,1.1692 + ,10.413 + ,114.5 + ,102.5 + ,1.1702 + ,10.709 + ,116.5 + ,105.3 + ,1.2286 + ,10.662 + ,108.6 + ,110.3 + ,1.2613 + ,10.57 + ,113.9 + ,109.8 + ,1.2646 + ,10.297 + ,109.3 + ,117.3 + ,1.2262 + ,10.635 + ,112.5 + ,118.8 + ,1.1985 + ,10.872 + ,123.4 + ,131.3 + ,1.2007 + ,10.296 + ,115.2 + ,125.9 + ,1.2138 + ,10.383 + ,110.8 + ,133.1 + ,1.2266 + ,10.431 + ,120.4 + ,147.0 + ,1.2176 + ,10.574 + ,117.6 + ,145.8 + ,1.2218 + ,10.653 + ,111.2 + ,164.4 + ,1.2490 + ,10.805 + ,131.1 + ,149.8 + ,1.2991 + ,10.872 + ,118.9 + ,137.7 + ,1.3408 + ,10.625 + ,115.7 + ,151.7 + ,1.3119 + ,10.407 + ,119.6 + ,156.8 + ,1.3014 + ,10.463 + ,113.1 + ,180.0 + ,1.3201 + ,10.556 + ,106.4 + ,180.4 + ,1.2938 + ,10.646 + ,115.5 + ,170.4 + ,1.2694 + ,10.702 + ,111.8 + ,191.6 + ,1.2165 + ,11.353 + ,109.6 + ,199.5 + ,1.2037 + ,11.346 + ,121.5 + ,218.2 + ,1.2292 + ,11.451 + ,109.5 + ,217.5 + ,1.2256 + ,11.964 + ,109.0 + ,205.0 + ,1.2015 + ,12.574 + ,113.4 + ,194.0 + ,1.1786 + ,13.031 + ,112.7 + ,199.3 + ,1.1856 + ,13.812 + ,114.4 + ,219.3 + ,1.2103 + ,14.544 + ,109.2 + ,211.1 + ,1.1938 + ,14.931 + ,116.2 + ,215.2 + ,1.2020 + ,14.886 + ,113.8 + ,240.2 + ,1.2271 + ,16.005 + ,123.6 + ,242.2 + ,1.2770 + ,17.064 + ,112.6 + ,240.7 + ,1.2650 + ,15.168 + ,117.7 + ,255.4 + ,1.2684 + ,16.05 + ,113.3 + ,253.0 + ,1.2811 + ,15.839 + ,110.7 + ,218.2 + ,1.2727 + ,15.137 + ,114.7 + ,203.7 + ,1.2611 + ,14.954 + ,116.9 + ,205.6 + ,1.2881 + ,15.648 + ,120.6 + ,215.6 + ,1.3213 + ,15.305 + ,111.6 + ,188.5 + ,1.2999 + ,15.579 + ,111.9 + ,202.9 + ,1.3074 + ,16.348 + ,116.1 + ,214.0 + ,1.3242 + ,15.928 + ,111.9 + ,230.3 + ,1.3516 + ,16.171 + ,125.1 + ,230.0 + ,1.3511 + ,15.937 + ,115.1 + ,241.0 + ,1.3419 + ,15.713 + ,116.7 + ,259.6 + ,1.3716 + ,15.594 + ,115.8 + ,247.8 + ,1.3622 + ,15.683 + ,116.8 + ,270.3 + ,1.3896 + ,16.438 + ,113.0 + ,289.7 + ,1.4227 + ,17.032 + ,106.5) + ,dim=c(4 + ,60) + ,dimnames=list(c('olie' + ,'wisselkoers' + ,'goud' + ,'productie') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('olie','wisselkoers','goud','productie'),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: Wessa P., (2007), Multivariate Correlation Matrix (v1.0.3) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_pairs.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description > 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/12qac1197028303.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 > 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 = 5.8487, p-value = 4.955e-09 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.5182255 > 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/27fmp1197028303.tab") > > system("convert tmp/12qac1197028303.ps tmp/12qac1197028303.png") > > > proc.time() user system elapsed 0.743 0.217 0.815