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(412 + ,1985 + ,10341 + ,10341 + ,602 + ,1963 + ,9690 + ,9690 + ,613 + ,2017 + ,10125 + ,10125 + ,482 + ,1975 + ,9349 + ,9349 + ,241 + ,1589 + ,9224 + ,9224 + ,277 + ,1679 + ,9224 + ,9224 + ,252 + ,1392 + ,9454 + ,9454 + ,383 + ,1511 + ,9347 + ,9347 + ,506 + ,1449 + ,9430 + ,9430 + ,366 + ,1767 + ,9933 + ,9933 + ,473 + ,1899 + ,10148 + ,10148 + ,581 + ,2179 + ,10677 + ,10677 + ,688 + ,2217 + ,10735 + ,10735 + ,792 + ,2049 + ,9760 + ,9760 + ,761 + ,2343 + ,10567 + ,10567 + ,592 + ,2175 + ,9333 + ,9333 + ,251 + ,1607 + ,9409.00 + ,9409 + ,162 + ,1702 + ,9502 + ,9502 + ,183 + ,1764 + ,9348 + ,9348 + ,164 + ,1766 + ,9319 + ,9319 + ,223 + ,1615 + ,9594 + ,9594 + ,237 + ,1953 + ,10160 + ,10160 + ,567 + ,2091 + ,10182 + ,10182 + ,778 + ,2411 + ,10810 + ,10810 + ,888 + ,2550 + ,11105 + ,11105 + ,1118 + ,2351 + ,9874 + ,9874 + ,1275 + ,2786 + ,10958 + ,10958 + ,419 + ,2525 + ,9311 + ,9311 + ,324 + ,2474 + ,9610 + ,9610 + ,197 + ,2332 + ,9398 + ,9398 + ,172 + ,1978 + ,9784 + ,9784 + ,220 + ,1789 + ,9425 + ,9425 + ,98 + ,1904 + ,9557 + ,9557 + ,122 + ,1997 + ,10166 + ,10166 + ,303 + ,2207 + ,10337 + ,10337 + ,750 + ,2453 + ,10770 + ,10770 + ,745 + ,1948 + ,11265 + ,11265 + ,293 + ,1384 + ,10183 + ,10183 + ,534 + ,1989 + ,10941 + ,10941 + ,318 + ,2140 + ,9628 + ,9628 + ,72 + ,2100 + ,9709 + ,9709 + ,67 + ,2045 + ,9637 + ,9637 + ,256 + ,2083 + ,9579 + ,9579 + ,82 + ,2022 + ,9741 + ,9741 + ,337 + ,1950 + ,9754 + ,9754 + ,596 + ,1422 + ,10508 + ,10508 + ,1152 + ,1859 + ,10749 + ,10749 + ,1028 + ,2147 + ,11079 + ,11079 + ,1011 + ,2273 + ,11608 + ,11608 + ,823 + ,1881 + ,10668 + ,10668 + ,1545 + ,2454 + ,10933 + ,10933 + ,1211 + ,2081 + ,9703 + ,9703 + ,593 + ,2376 + ,9799 + ,9799 + ,348 + ,2265 + ,9656 + ,9656 + ,341 + ,2131 + ,9648 + ,9648 + ,340 + ,2333 + ,9712 + ,9712 + ,589 + ,1881 + ,9766 + ,9766 + ,1095 + ,1563 + ,10540 + ,10540 + ,788 + ,1738 + ,10564 + ,10564 + ,432 + ,1990 + ,10911 + ,10911) + ,dim=c(4 + ,60) + ,dimnames=list(c('invoer' + ,'uitvoer' + ,'verbruik' + ,'aanbod') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('invoer','uitvoer','verbruik','aanbod'),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/1o9w01258109518.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, ] z = 2.379, p-value = 0.01736 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.210794 > 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/2w0ua1258109518.tab") > > system("convert tmp/1o9w01258109518.ps tmp/1o9w01258109518.png") > > > proc.time() user system elapsed 0.498 0.211 0.687