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(0.9383 + ,90.8 + ,15 + ,467037 + ,0.9217 + ,96.4 + ,3 + ,460070 + ,0.9095 + ,90 + ,2 + ,447988 + ,0.892 + ,92.1 + ,-2 + ,442867 + ,0.8742 + ,97.2 + ,1 + ,436087 + ,0.8532 + ,95.1 + ,1 + ,431328 + ,0.8607 + ,88.5 + ,-1 + ,484015 + ,0.9005 + ,91 + ,-6 + ,509673 + ,0.9111 + ,90.5 + ,-13 + ,512927 + ,0.9059 + ,75 + ,-25 + ,502831 + ,0.8883 + ,66.3 + ,-26 + ,470984 + ,0.8924 + ,66 + ,-9 + ,471067 + ,0.8833 + ,68.4 + ,1 + ,476049 + ,0.87 + ,70.6 + ,3 + ,474605 + ,0.8758 + ,83.9 + ,6 + ,470439 + ,0.8858 + ,90.1 + ,2 + ,461251 + ,0.917 + ,90.6 + ,5 + ,454724 + ,0.9554 + ,87.1 + ,5 + ,455626 + ,0.9922 + ,90.8 + ,0 + ,516847 + ,0.9778 + ,94.1 + ,-5 + ,525192 + ,0.9808 + ,99.8 + ,-4 + ,522975 + ,0.9811 + ,96.8 + ,-2 + ,518585 + ,1.0014 + ,87 + ,-1 + ,509239 + ,1.0183 + ,96.3 + ,-8 + ,512238 + ,1.0622 + ,107.1 + ,-16 + ,519164 + ,1.0773 + ,115.2 + ,-19 + ,517009 + ,1.0807 + ,106.1 + ,-28 + ,509933 + ,1.0848 + ,89.5 + ,-11 + ,509127 + ,1.1582 + ,91.3 + ,-4 + ,500857 + ,1.1663 + ,97.6 + ,-9 + ,506971 + ,1.1372 + ,100.7 + ,-12 + ,569323 + ,1.1139 + ,104.6 + ,-10 + ,579714 + ,1.1222 + ,94.7 + ,-2 + ,577992 + ,1.1692 + ,101.8 + ,-13 + ,565464 + ,1.1702 + ,102.5 + ,0 + ,547344 + ,1.2286 + ,105.3 + ,0 + ,554788 + ,1.2613 + ,110.3 + ,4 + ,562325 + ,1.2646 + ,109.8 + ,7 + ,560854 + ,1.2262 + ,117.3 + ,5 + ,555332 + ,1.1985 + ,118.8 + ,2 + ,543599 + ,1.2007 + ,131.3 + ,-2 + ,536662 + ,1.2138 + ,125.9 + ,6 + ,542722 + ,1.2266 + ,133.1 + ,-3 + ,593530 + ,1.2176 + ,147 + ,1 + ,610763 + ,1.2218 + ,145.8 + ,0 + ,612613 + ,1.249 + ,164.4 + ,-7 + ,611324 + ,1.2991 + ,149.8 + ,-6 + ,594167 + ,1.3408 + ,137.7 + ,-4 + ,595454 + ,1.3119 + ,151.7 + ,-4 + ,590865 + ,1.3014 + ,156.8 + ,-2 + ,589379 + ,1.3201 + ,180 + ,2 + ,584428 + ,1.2938 + ,180.4 + ,-5 + ,573100 + ,1.2694 + ,170.4 + ,-15 + ,567456 + ,1.2165 + ,191.6 + ,-16 + ,569028 + ,1.2037 + ,199.5 + ,-18 + ,620735 + ,1.2292 + ,218.2 + ,-13 + ,628884 + ,1.2256 + ,217.5 + ,-23 + ,628232 + ,1.2015 + ,205 + ,-10 + ,612117 + ,1.1786 + ,194 + ,-10 + ,595404 + ,1.1856 + ,199.3 + ,-6 + ,597141 + ,1.2103 + ,219.3 + ,-3 + ,593408 + ,1.1938 + ,211.1 + ,-4 + ,590072 + ,1.202 + ,215.2 + ,-7 + ,579799 + ,1.2271 + ,240.2 + ,-7 + ,574205 + ,1.277 + ,242.2 + ,-7 + ,572775 + ,1.265 + ,240.7 + ,-3 + ,572942 + ,1.2684 + ,255.4 + ,0 + ,619567 + ,1.2811 + ,253 + ,-5 + ,625809 + ,1.2727 + ,218.2 + ,-3 + ,619916 + ,1.2611 + ,203.7 + ,3 + ,587625 + ,1.2881 + ,205.6 + ,2 + ,565742 + ,1.3213 + ,215.6 + ,-7 + ,557274) + ,dim=c(4 + ,72) + ,dimnames=list(c('Dollar' + ,'Aardolieprijs' + ,'Consumentenvertrouwen' + ,'werkloosheid') + ,1:72)) > y <- array(NA,dim=c(4,72),dimnames=list(c('Dollar','Aardolieprijs','Consumentenvertrouwen','werkloosheid'),1:72)) > 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/1ej2t1196261856.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 = 7.6615, p-value = 1.843e-14 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.6168298 > 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/2xrhe1196261856.tab") > > system("convert tmp/1ej2t1196261856.ps tmp/1ej2t1196261856.png") > > > proc.time() user system elapsed 0.780 0.219 1.824