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(3595,2564,3914,3869,4159,4145,3676,4091,3794,4117,3446,3281,3504,2186,3958,3476,3353,4009,3480,3924,3098,3101,2944,2211,3389,2497,3497,3520,4404,4191,3849,8255,3734,3000,3060,2955,3507,1986,3287,3229,3215,3448,3764,3371,2734,3160,2837,2429,2766,2574,3851,2725,3289,3451,3848,3481,3348,3592,3682,3472,4058,2312,3655,3322,3811,4348,3341,3603,3032,2700,3475,2640,3353,2916,3186,3180,3902,4151,4164,4023,3499,3431,4145,3874,3796,2617,3711,3580,3949,5267,3740,3832,3243,3441,4407,3228,4814,3397,3908,3971,5250,4625,3937,4486,4004,4132,5560,4685,3922,3172,3759,4280,4138,4207,4634,4158,3996,3933,4308,3151,4143,3616,4429,4222,5219,4436,4929,4806,5755,4849,5592,5023,4163,3521,4962,4649,5208,5388,4755,5148,4491,4847,5732,3996,5731,4483,5040,4684,6102,5454,4904,4770,5369,5309,5578,5074,4619,3505,4731,4953,5011,5155,5299,5308,4146,5171,4625,4003,4736,4379),dim=c(2,85),dimnames=list(c('bouwver','begonnen_geb'),1:85)) > y <- array(NA,dim=c(2,85),dimnames=list(c('bouwver','begonnen_geb'),1:85)) > 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/1dhew1257958405.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 = 7.2912, p-value = 3.073e-13 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.5381706 > 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/2b0f41257958405.tab") > > system("convert tmp/1dhew1257958405.ps tmp/1dhew1257958405.png") > > > proc.time() user system elapsed 0.426 0.186 0.493