R version 2.9.0 (2009-04-17) Copyright (C) 2009 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.5557 + ,162.31 + ,0.79209 + ,36.9042 + ,1.5750 + ,161.56 + ,0.79487 + ,37.0494 + ,1.5527 + ,156.59 + ,0.77494 + ,36.8259 + ,1.4748 + ,157.97 + ,0.75094 + ,36.1357 + ,1.4718 + ,158.68 + ,0.74725 + ,36.0300 + ,1.4570 + ,163.55 + ,0.72064 + ,35.7927 + ,1.4684 + ,162.89 + ,0.70896 + ,35.9174 + ,1.4227 + ,164.95 + ,0.69614 + ,35.4008 + ,1.3896 + ,159.82 + ,0.68887 + ,35.1723 + ,1.3622 + ,159.05 + ,0.67766 + ,34.9211 + ,1.3716 + ,166.76 + ,0.67440 + ,35.0292 + ,1.3419 + ,164.55 + ,0.67562 + ,34.7739 + ,1.3511 + ,163.22 + ,0.68136 + ,34.8999 + ,1.3516 + ,160.68 + ,0.67934 + ,34.9054 + ,1.3242 + ,155.24 + ,0.68021 + ,34.5680 + ,1.3074 + ,157.60 + ,0.66800 + ,34.4060 + ,1.2999 + ,156.56 + ,0.66341 + ,34.4578 + ,1.3213 + ,154.82 + ,0.67286 + ,34.7316 + ,1.2881 + ,151.11 + ,0.67397 + ,34.2602 + ,1.2611 + ,149.65 + ,0.67254 + ,33.8849 + ,1.2727 + ,148.99 + ,0.67511 + ,34.0549 + ,1.2811 + ,148.53 + ,0.67669 + ,34.2755 + ,1.2684 + ,146.70 + ,0.68782 + ,34.1393 + ,1.2650 + ,145.11 + ,0.68666 + ,34.1587 + ,1.2770 + ,142.70 + ,0.68330 + ,34.5386 + ,1.2271 + ,143.59 + ,0.69463 + ,33.7987 + ,1.2020 + ,140.96 + ,0.68935 + ,33.4973 + ,1.1938 + ,140.77 + ,0.68297 + ,33.6802 + ,1.2103 + ,139.81 + ,0.68598 + ,34.3284 + ,1.1856 + ,140.58 + ,0.67922 + ,34.1538 + ,1.1786 + ,139.59 + ,0.67933 + ,33.9184 + ,1.2015 + ,138.05 + ,0.68137 + ,34.3262 + ,1.2256 + ,136.06 + ,0.67760 + ,34.7750 + ,1.2292 + ,135.98 + ,0.68527 + ,35.0119 + ,1.2037 + ,134.75 + ,0.68756 + ,34.5513 + ,1.2165 + ,132.22 + ,0.66895 + ,34.6951 + ,1.2694 + ,135.37 + ,0.68399 + ,35.4730 + ,1.2938 + ,138.84 + ,0.68293 + ,35.9794 + ,1.3201 + ,138.83 + ,0.69233 + ,36.4789 + ,1.3014 + ,136.55 + ,0.68968 + ,36.3910 + ,1.3119 + ,135.63 + ,0.69867 + ,36.6704 + ,1.3408 + ,139.14 + ,0.69500 + ,37.4162 + ,1.2991 + ,136.09 + ,0.69862 + ,37.1185) + ,dim=c(4 + ,43) + ,dimnames=list(c('dollar/euro' + ,'japanseyen/euro' + ,'pondVK/euro' + ,'roebel/euro') + ,1:43)) > y <- array(NA,dim=c(4,43),dimnames=list(c('dollar/euro','japanseyen/euro','pondVK/euro','roebel/euro'),1:43)) > 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/12jra1258117902.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, ] T = 684, p-value = 3.324e-07 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.5149502 > 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/2opqa1258117902.tab") > > system("convert tmp/12jra1258117902.ps tmp/12jra1258117902.png") > > > proc.time() user system elapsed 0.521 0.219 1.114