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(116222 + ,344744 + ,31899 + ,492865 + ,110924 + ,338653 + ,31384 + ,480961 + ,103753 + ,327532 + ,30650 + ,461935 + ,99983 + ,326225 + ,30400 + ,456608 + ,93302 + ,318672 + ,30003 + ,441977 + ,91496 + ,317756 + ,29896 + ,439148 + ,119321 + ,337302 + ,31557 + ,488180 + ,139261 + ,349420 + ,31883 + ,520564 + ,133739 + ,336923 + ,30830 + ,501492 + ,123913 + ,330758 + ,30354 + ,485025 + ,113438 + ,321002 + ,29756 + ,464196 + ,109416 + ,320820 + ,29934 + ,460170 + ,109406 + ,327032 + ,30599 + ,467037 + ,105645 + ,324047 + ,30378 + ,460070 + ,101328 + ,316735 + ,29925 + ,447988 + ,97686 + ,315710 + ,29471 + ,442867 + ,93093 + ,313427 + ,29567 + ,436087 + ,91382 + ,310527 + ,29419 + ,431328 + ,122257 + ,330962 + ,30796 + ,484015 + ,139183 + ,339015 + ,31475 + ,509673 + ,139887 + ,341332 + ,31708 + ,512927 + ,131822 + ,339092 + ,31917 + ,502831 + ,116805 + ,323308 + ,30871 + ,470984 + ,113706 + ,325849 + ,31512 + ,471067 + ,113012 + ,330675 + ,32362 + ,476049 + ,110452 + ,332225 + ,31928 + ,474605 + ,107005 + ,331735 + ,31699 + ,470439 + ,102841 + ,328047 + ,30363 + ,461251 + ,98173 + ,326165 + ,30386 + ,454724 + ,98181 + ,327081 + ,30364 + ,455626 + ,137277 + ,346764 + ,32806 + ,516847 + ,147579 + ,344190 + ,33423 + ,525192 + ,146571 + ,343333 + ,33071 + ,522975 + ,138920 + ,345777 + ,33888 + ,518585 + ,130340 + ,344094 + ,34805 + ,509239 + ,128140 + ,348609 + ,35489 + ,512238 + ,127059 + ,354846 + ,37259 + ,519164 + ,122860 + ,356427 + ,37722 + ,517009 + ,117702 + ,353467 + ,38764 + ,509933 + ,113537 + ,355996 + ,39594 + ,509127 + ,108366 + ,352487 + ,40004 + ,500857 + ,111078 + ,355178 + ,40715 + ,506971 + ,150739 + ,374556 + ,44028 + ,569323 + ,159129 + ,375021 + ,45564 + ,579714 + ,157928 + ,375787 + ,44277 + ,577992 + ,147768 + ,372720 + ,44976 + ,565464 + ,137507 + ,364431 + ,45406 + ,547344 + ,136919 + ,370490 + ,47379 + ,554788 + ,136151 + ,376974 + ,49200 + ,562325 + ,133001 + ,377632 + ,50221 + ,560854 + ,125554 + ,378205 + ,51573 + ,555332 + ,119647 + ,370861 + ,53091 + ,543599 + ,114158 + ,369167 + ,53337 + ,536662 + ,116193 + ,371551 + ,54978 + ,542722 + ,152803 + ,382842 + ,57885 + ,593530 + ,161761 + ,381903 + ,67099 + ,610763 + ,160942 + ,384502 + ,67169 + ,612613 + ,149470 + ,392058 + ,69796 + ,611324 + ,139208 + ,384359 + ,70600 + ,594167 + ,134588 + ,388884 + ,71982 + ,595454 + ,130322 + ,386586 + ,73957 + ,590865 + ,126611 + ,387495 + ,75273 + ,589379 + ,122401 + ,385705 + ,76322 + ,584428 + ,117352 + ,378670 + ,77078 + ,573100 + ,112135 + ,377367 + ,77954 + ,567456 + ,112879 + ,376911 + ,79238 + ,569028 + ,148729 + ,389827 + ,82179 + ,620735 + ,157230 + ,387820 + ,83834 + ,628884 + ,157221 + ,387267 + ,83744 + ,628232 + ,146681 + ,380575 + ,84861 + ,612117 + ,136524 + ,372402 + ,86478 + ,595404 + ,132111 + ,376740 + ,88290 + ,597141) + ,dim=c(4 + ,72) + ,dimnames=list(c('-25' + ,'25-50' + ,'50+' + ,'totaal') + ,1:72)) > y <- array(NA,dim=c(4,72),dimnames=list(c('-25','25-50','50+','totaal'),1:72)) > 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' > 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/1cw9i1257871743.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 = 6.4557, p-value = 1.077e-10 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.5195618 > 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/2un081257871743.tab") > > system("convert tmp/1cw9i1257871743.ps tmp/1cw9i1257871743.png") > > > proc.time() user system elapsed 0.505 0.212 5.273