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(6539 + ,2605 + ,11078 + ,7752 + ,6699 + ,2682 + ,11157 + ,8089 + ,6962 + ,2755 + ,11203 + ,8279 + ,6981 + ,2760 + ,11425 + ,8284 + ,7024 + ,2735 + ,11368 + ,8298 + ,6940 + ,2659 + ,11118 + ,8235 + ,6774 + ,2654 + ,11041 + ,8043 + ,6671 + ,2670 + ,10837 + ,7908 + ,6965 + ,2785 + ,11018 + ,8282 + ,6969 + ,2845 + ,11035 + ,8416 + ,6822 + ,2723 + ,11220 + ,8069 + ,6878 + ,2746 + ,11486 + ,7888 + ,6691 + ,2767 + ,11553 + ,7729 + ,6837 + ,2940 + ,11626 + ,8013 + ,7018 + ,2977 + ,11861 + ,8099 + ,7167 + ,2993 + ,11951 + ,8185 + ,7076 + ,2892 + ,11935 + ,8023 + ,7171 + ,2824 + ,11717 + ,8120 + ,7093 + ,2771 + ,11841 + ,8115 + ,6971 + ,2686 + ,11701 + ,8024 + ,7142 + ,2738 + ,11842 + ,8312 + ,7047 + ,2723 + ,11818 + ,8204 + ,6999 + ,2731 + ,12088 + ,7976 + ,6650 + ,2632 + ,11876 + ,7355 + ,6475 + ,2606 + ,11839 + ,7075 + ,6437 + ,2605 + ,11582 + ,6985 + ,6639 + ,2646 + ,11848 + ,7209 + ,6422 + ,2627 + ,11741 + ,6954 + ,6272 + ,2535 + ,11455 + ,6766 + ,6232 + ,2456 + ,11154 + ,6742 + ,6003 + ,2404 + ,10922 + ,6551 + ,5673 + ,2319 + ,10556 + ,6298 + ,6050 + ,2519 + ,10923 + ,6866 + ,5977 + ,2504 + ,11001 + ,6780 + ,5796 + ,2382 + ,10702 + ,6128 + ,5752 + ,2394 + ,10805 + ,5941 + ,5609 + ,2381 + ,10831 + ,5773 + ,5839 + ,2501 + ,10925 + ,5982 + ,6069 + ,2532 + ,11220 + ,6352 + ,6006 + ,2515 + ,11188 + ,6366 + ,5809 + ,2429 + ,10752 + ,6377 + ,5797 + ,2389 + ,10771 + ,6295 + ,5502 + ,2261 + ,10274 + ,6037 + ,5568 + ,2272 + ,10261 + ,5999 + ,5864 + ,2439 + ,10600 + ,6452 + ,5764 + ,2373 + ,10596 + ,6388 + ,5615 + ,2327 + ,10556 + ,5994 + ,5615 + ,2364 + ,10716 + ,5847 + ,5681 + ,2388 + ,10958 + ,5838 + ,5915 + ,2553 + ,11273 + ,6097 + ,6334 + ,2663 + ,11806 + ,6397 + ,6494 + ,2694 + ,11922 + ,6431 + ,6620 + ,2679 + ,12127 + ,6528 + ,6578 + ,2611 + ,11985 + ,6443 + ,6495 + ,2580 + ,11805 + ,6350 + ,6538 + ,2627 + ,11901 + ,6443 + ,6737 + ,2732 + ,12217 + ,6855 + ,6651 + ,2707 + ,12344 + ,6795 + ,6530 + ,2633 + ,12314 + ,6398 + ,6563 + ,2683 + ,12447 + ,6220) + ,dim=c(4 + ,60) + ,dimnames=list(c('Voeding-Mannen' + ,'Landbouw' + ,'Hotels&Restaurants' + ,'Voeding-Vrouwen') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('Voeding-Mannen','Landbouw','Hotels&Restaurants','Voeding-Vrouwen'),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/freestat/rcomp/tmp/1euty1257950368.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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 = 9.1084, p-value < 2.2e-16 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.8076924 > 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/freestat/rcomp/tmp/2o14x1257950368.tab") > > system("convert tmp/1euty1257950368.ps tmp/1euty1257950368.png") > > > proc.time() user system elapsed 0.720 0.287 0.815