R version 2.8.1 (2008-12-22) 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(149 + ,2.3 + ,0.69144 + ,110.8 + ,139 + ,1.9 + ,0.69862 + ,119.3 + ,135 + ,1.7 + ,0.69500 + ,128.1 + ,130 + ,2.5 + ,0.69867 + ,127.6 + ,127 + ,2.1 + ,0.68968 + ,137.9 + ,122 + ,2.4 + ,0.69233 + ,151.4 + ,117 + ,1.5 + ,0.68293 + ,143.6 + ,112 + ,1.9 + ,0.68399 + ,143.4 + ,113 + ,2.1 + ,0.66895 + ,141.9 + ,149 + ,2.2 + ,0.68756 + ,135.2 + ,157 + ,2.0 + ,0.68527 + ,133.1 + ,157 + ,2.0 + ,0.67760 + ,129.6 + ,147 + ,2.2 + ,0.68137 + ,134.1 + ,137 + ,2.3 + ,0.67933 + ,136.8 + ,132 + ,2.3 + ,0.67922 + ,143.5 + ,125 + ,2.0 + ,0.68598 + ,162.5 + ,123 + ,2.2 + ,0.68297 + ,163.1 + ,117 + ,1.9 + ,0.68935 + ,157.2 + ,114 + ,2.3 + ,0.69463 + ,158.8 + ,111 + ,2.2 + ,0.68330 + ,155.4 + ,112 + ,2.3 + ,0.68666 + ,148.5 + ,144 + ,2.1 + ,0.68782 + ,154.2 + ,150 + ,2.4 + ,0.67669 + ,153.3 + ,149 + ,2.3 + ,0.67511 + ,149.4 + ,134 + ,1.9 + ,0.67254 + ,147.9 + ,123 + ,1.6 + ,0.67397 + ,156.0 + ,116 + ,1.8 + ,0.67286 + ,163.0 + ,117 + ,1.8 + ,0.66341 + ,159.1 + ,111 + ,2.0 + ,0.66800 + ,159.5 + ,105 + ,2.3 + ,0.68021 + ,157.3 + ,102 + ,2.2 + ,0.67934 + ,156.4 + ,95 + ,2.2 + ,0.68136 + ,156.6 + ,93 + ,2.0 + ,0.67562 + ,162.4 + ,124 + ,2.0 + ,0.67440 + ,166.8 + ,130 + ,1.9 + ,0.67766 + ,162.6 + ,124 + ,1.5 + ,0.68887 + ,168.1 + ,115 + ,1.6 + ,0.69614 + ,171.3 + ,106 + ,1.5 + ,0.70896 + ,171.0 + ,105 + ,2.0 + ,0.72064 + ,178.7 + ,105 + ,1.5 + ,0.74725 + ,187.5 + ,101 + ,1.5 + ,0.75094 + ,211.4 + ,95 + ,1.9 + ,0.77494 + ,211.6 + ,93 + ,1.1 + ,0.79487 + ,199.4 + ,84 + ,1.5 + ,0.79209 + ,198.7 + ,87 + ,2.1 + ,0.79152 + ,209.3 + ,116 + ,2.3 + ,0.79308 + ,215.5 + ,120 + ,2.6 + ,0.79279 + ,212.8 + ,117 + ,2.9 + ,0.79924 + ,203.2 + ,109 + ,3.2 + ,0.78668 + ,175.7 + ,105 + ,3.2 + ,0.83063 + ,171.0 + ,107 + ,3.1 + ,0.90448 + ,172.5 + ,109 + ,3.0 + ,0.91819 + ,183.5 + ,109 + ,3.3 + ,0.88691 + ,185.4 + ,108 + ,2.7 + ,0.91966 + ,180.9 + ,107 + ,3.6 + ,0.89756 + ,187.3 + ,99 + ,3.1 + ,0.88444 + ,202.0 + ,103 + ,2.7 + ,0.85670 + ,203.3 + ,131 + ,2.6 + ,0.86092 + ,205.8 + ,137 + ,2.2 + ,0.86265 + ,221.5 + ,135 + ,2.7 + ,0.89135 + ,226.6) + ,dim=c(4 + ,60) + ,dimnames=list(c('WLH' + ,'HICP' + ,'PS/EU' + ,'PI') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('WLH','HICP','PS/EU','PI'),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/rcomp/tmp/1a5rx1258036714.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=4.1666666666667) > 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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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 = 0.1603, p-value = 0.8726 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.01473216 > 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/rcomp/tmp/24kxi1258036714.tab") > system("convert tmp/1a5rx1258036714.ps tmp/1a5rx1258036714.png") > > > proc.time() user system elapsed 0.480 0.390 0.777