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(16283.6,2220.6,16726.5,2161.5,14968.9,1863.6,14861,1955.1,14583.3,1907.4,15305.8,1889.4,17903.9,2246.3,16379.4,2213,15420.3,1965,17870.5,2285.6,15912.8,1983.8,13866.5,1872.4,17823.2,2371.4,17872,2287,17420.4,2198.2,16704.4,2330.4,15991.2,2014.4,16583.6,2066.1,19123.5,2355.8,17838.7,2232.5,17209.4,2091.7,18586.5,2376.5,16258.1,1931.9,15141.6,2025.7,19202.1,2404.9,17746.5,2316.1,19090.1,2368.1,18040.3,2282.5,17515.5,2158.6,17751.8,2174.8,21072.4,2594.1,17170,2281.4,19439.5,2547.9,19795.4,2606.3,17574.9,2190.8,16165.4,2262.3,19464.6,2423.8,19932.1,2520.4,19961.2,2482.9,17343.4,2215.9,18924.2,2441.9,18574.1,2333.8,21350.6,2670.2,18594.6,2431,19823.1,2559.3,20844.4,2661.4,19640.2,2404.6,17735.4,2378.3,19813.6,2489.2,22160,2941,20664.3,2700.9,17877.4,2335.6,21211.2,2770,21423.1,2764.2,21688.7,2784.9,23243.2,2898.8,21490.2,2853.4,22925.8,3022.6,23184.8,2851.4,18562.2,2630.8),dim=c(2,60),dimnames=list(c('Totale_uitvoer','Uitvoer_Nederland'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Totale_uitvoer','Uitvoer_Nederland'),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/1iy8j1229938523.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.1587, p-value < 2.2e-16 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.8112994 > 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/20fru1229938523.tab") > > system("convert tmp/1iy8j1229938523.ps tmp/1iy8j1229938523.png") > > > proc.time() user system elapsed 0.416 0.201 0.526