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(108.01 + ,102.9 + ,128 + ,79.1 + ,101.21 + ,97.4 + ,123.5 + ,71.7 + ,119.93 + ,111.4 + ,124 + ,100 + ,94.76 + ,87.4 + ,127.4 + ,82.1 + ,95.26 + ,96.8 + ,127.6 + ,74.8 + ,117.96 + ,114.1 + ,128.4 + ,92.3 + ,115.86 + ,110.3 + ,131.4 + ,83.3 + ,111.44 + ,103.9 + ,135.1 + ,83.7 + ,108.16 + ,101.6 + ,134 + ,148 + ,108.77 + ,94.6 + ,144.5 + ,71.4 + ,109.45 + ,95.9 + ,147.3 + ,71.2 + ,124.83 + ,104.7 + ,150.9 + ,84.6 + ,115.31 + ,102.8 + ,148.7 + ,80.9 + ,109.49 + ,98.1 + ,141.4 + ,80.6 + ,124.24 + ,113.9 + ,138.9 + ,105.5 + ,92.85 + ,80.9 + ,139.8 + ,79.2 + ,98.42 + ,95.7 + ,145.6 + ,78.4 + ,120.88 + ,113.2 + ,147.9 + ,92.6 + ,111.72 + ,105.9 + ,148.5 + ,88.3 + ,116.1 + ,108.8 + ,151.1 + ,98.2 + ,109.37 + ,102.3 + ,157.5 + ,157.4 + ,111.65 + ,99 + ,167.5 + ,73.9 + ,114.29 + ,100.7 + ,172.3 + ,80.9 + ,133.68 + ,115.5 + ,173.5 + ,93 + ,114.27 + ,100.7 + ,187.5 + ,84.9 + ,126.49 + ,109.9 + ,205.5 + ,96.2 + ,131 + ,114.6 + ,195.1 + ,106.5 + ,104 + ,85.4 + ,204.5 + ,81.7 + ,108.88 + ,100.5 + ,204.5 + ,82.9 + ,128.48 + ,114.8 + ,201.7 + ,96 + ,132.44 + ,116.5 + ,207 + ,92.6 + ,128.04 + ,112.9 + ,206.6 + ,116.5 + ,116.35 + ,102 + ,210.6 + ,155 + ,120.93 + ,106 + ,211.1 + ,95.1 + ,118.59 + ,105.3 + ,215 + ,86.2 + ,133.1 + ,118.8 + ,223.9 + ,105 + ,121.05 + ,106.1 + ,238.2 + ,89.7 + ,127.62 + ,109.3 + ,238.9 + ,97.1 + ,135.44 + ,117.2 + ,229.6 + ,120.8 + ,114.88 + ,92.5 + ,232.2 + ,92.2 + ,114.34 + ,104.2 + ,222.1 + ,98.8 + ,128.85 + ,112.5 + ,221.6 + ,104.1 + ,138.9 + ,122.4 + ,227.3 + ,106.5 + ,129.44 + ,113.3 + ,221 + ,113.4 + ,114.96 + ,100 + ,213.6 + ,192.4 + ,127.98 + ,110.7 + ,243.4 + ,103.6 + ,127.03 + ,112.8 + ,253.8 + ,97.6 + ,128.75 + ,109.8 + ,265.3 + ,99.9 + ,137.91 + ,117.3 + ,268.2 + ,106.4 + ,128.37 + ,109.1 + ,268.5 + ,104.8 + ,135.9 + ,115.9 + ,266.9 + ,114.1 + ,122.19 + ,96 + ,268.4 + ,93 + ,113.08 + ,99.8 + ,250.8 + ,90.2 + ,136.2 + ,116.8 + ,231.2 + ,108.8 + ,138 + ,115.7 + ,192 + ,108.7 + ,115.24 + ,99.4 + ,171.4 + ,125.2 + ,110.95 + ,94.3 + ,160 + ,180.4 + ,99.23 + ,91 + ,148.1 + ,91.6 + ,102.39 + ,93.2 + ,144.8 + ,87.1 + ,112.67 + ,103.1 + ,147.2 + ,98.3) + ,dim=c(4 + ,60) + ,dimnames=list(c('iotot' + ,'iptot' + ,'gp' + ,'invi') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('iotot','iptot','gp','invi'),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/1x06p1257757697.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/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 = 8.132, p-value = 4.441e-16 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.7205426 > 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/2hyiq1257757697.tab") > > system("convert tmp/1x06p1257757697.ps tmp/1x06p1257757697.png") > > > proc.time() user system elapsed 0.490 0.400 0.798