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(13807.9,2236,14101.7,2084.9,16010.3,2409.5,14633.1,2199.3,14478.5,2203.5,15327.3,2254.1,14179.5,1975.8,11398.2,1742.2,16111.5,2520.6,15887.4,2438.1,14529.3,2126.3,13923.1,2267.5,13960.2,2201.1,14807.8,2128.5,17511.5,2596,15845.9,2458.2,14594.2,2210.5,17252.2,2621.2,14832.8,2231.4,13132.1,2103.6,17665.9,2685.8,16913,2539.3,17318.8,2462.4,16224.2,2693.3,15469.6,2307.7,16557.5,2385.9,19414.8,2737.6,17335,2653.9,16525.2,2545.4,18160.4,2848.8,15553.8,2359.5,15262.2,2488.3,18581,2861.1,17564.1,2717.9,18948.6,2844,17187.8,2749,17564.8,2652.9,17668.4,2660.2,20811.7,3187.1,17257.8,2774.1,18984.2,3158.2,20532.6,3244.6,17082.3,2665.5,16894.9,2820.8,20274.9,2983.4,20078.6,3077.4,19900.9,3024.8,17012.2,2731.8,19642.9,3046.2,19024,2834.8,21691,3292.8,18835.9,2946.1,19873.4,3196.9,21468.2,3284.2,19406.8,3003,18385.3,2979,20739.3,3137.4,22268.3,3630.2,21569,3270.7,17514.8,2942.3),dim=c(2,60),dimnames=list(c('Total_export_EU','Total_export_Netherlands'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Total_export_EU','Total_export_Netherlands'),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/1ind71229082930.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] 2 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 9.1715, p-value < 2.2e-16 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.8124294 > 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/2fxzq1229082930.tab") > > system("convert tmp/1ind71229082930.ps tmp/1ind71229082930.png") > > > proc.time() user system elapsed 0.434 0.182 0.758