R version 2.8.0 (2008-10-20) 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(0.9554 + ,24.67 + ,935.9 + ,0.9922 + ,25.59 + ,937.1 + ,0.9778 + ,26.09 + ,885.1 + ,0.9808 + ,28.37 + ,892.4 + ,0.9811 + ,27.34 + ,987.3 + ,1.0014 + ,24.46 + ,946.3 + ,1.0183 + ,27.46 + ,799.6 + ,1.0622 + ,30.23 + ,875.4 + ,1.0773 + ,32.33 + ,846.2 + ,1.0807 + ,29.87 + ,880.6 + ,1.0848 + ,24.87 + ,885.7 + ,1.1582 + ,25.48 + ,868.9 + ,1.1663 + ,27.28 + ,882.5 + ,1.1372 + ,28.24 + ,789.6 + ,1.1139 + ,29.58 + ,773.3 + ,1.1222 + ,26.95 + ,804.3 + ,1.1692 + ,29.08 + ,817.8 + ,1.1702 + ,28.76 + ,836.7 + ,1.2286 + ,29.59 + ,721.8 + ,1.2613 + ,30.7 + ,760.8 + ,1.2646 + ,30.52 + ,841.4 + ,1.2262 + ,32.67 + ,1045.6 + ,1.1985 + ,33.19 + ,949.2 + ,1.2007 + ,37.13 + ,850.1 + ,1.2138 + ,35.54 + ,957.4 + ,1.2266 + ,37.75 + ,851.8 + ,1.2176 + ,41.84 + ,913.9 + ,1.2218 + ,42.94 + ,888 + ,1.249 + ,49.14 + ,973.8 + ,1.2991 + ,44.61 + ,927.6 + ,1.3408 + ,40.22 + ,833 + ,1.3119 + ,44.23 + ,879.5 + ,1.3014 + ,45.85 + ,797.3 + ,1.3201 + ,53.38 + ,834.5 + ,1.2938 + ,53.26 + ,735.1 + ,1.2694 + ,51.8 + ,835 + ,1.2165 + ,55.3 + ,892.8 + ,1.2037 + ,57.81 + ,697.2 + ,1.2292 + ,63.96 + ,821.1 + ,1.2256 + ,63.77 + ,732.7 + ,1.2015 + ,59.15 + ,797.6 + ,1.1786 + ,56.12 + ,866.3 + ,1.1856 + ,57.42 + ,826.3 + ,1.2103 + ,63.52 + ,778.6 + ,1.1938 + ,61.71 + ,779.2 + ,1.202 + ,63.01 + ,951 + ,1.2271 + ,68.18 + ,692.3 + ,1.277 + ,72.03 + ,841.4 + ,1.265 + ,69.75 + ,857.3 + ,1.2684 + ,74.41 + ,760.7 + ,1.2811 + ,74.33 + ,841.2 + ,1.2727 + ,64.24 + ,810.3 + ,1.2611 + ,60.03 + ,1007.4 + ,1.2881 + ,59.44 + ,931.3 + ,1.3213 + ,62.5 + ,931.2 + ,1.2999 + ,55.04 + ,855.8 + ,1.3074 + ,58.34 + ,858.4 + ,1.3242 + ,61.92 + ,925.9 + ,1.3516 + ,67.65 + ,930.7 + ,1.3511 + ,67.68 + ,1035.6) + ,dim=c(3 + ,60) + ,dimnames=list(c('RefWK' + ,'Brent' + ,'BelgInvoerUSA') + ,1:60)) > y <- array(NA,dim=c(3,60),dimnames=list(c('RefWK','Brent','BelgInvoerUSA'),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/html/rcomp/tmp/1fiao1228587668.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] 3 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 5.6508, p-value = 1.597e-08 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.500565 > 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/21q4p1228587668.tab") > > system("convert tmp/1fiao1228587668.ps tmp/1fiao1228587668.png") > > > proc.time() user system elapsed 0.465 0.192 0.583