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(109.8 + ,99.5 + ,110.5 + ,55 + ,111.7 + ,99.8 + ,110.8 + ,48.7 + ,98.6 + ,99.8 + ,104.2 + ,70.3 + ,96.9 + ,101.3 + ,88.9 + ,94.8 + ,95.1 + ,102.7 + ,89.8 + ,58.5 + ,97 + ,103.3 + ,90 + ,62.4 + ,112.7 + ,102.5 + ,93.9 + ,56.7 + ,102.9 + ,101.5 + ,91.3 + ,65.1 + ,97.4 + ,101.4 + ,87.8 + ,114.4 + ,111.4 + ,101.1 + ,99.7 + ,50.7 + ,87.4 + ,100 + ,73.5 + ,44.5 + ,96.8 + ,104.6 + ,79.2 + ,72 + ,114.1 + ,103.7 + ,96.9 + ,61.2 + ,110.3 + ,103.7 + ,95.2 + ,68.4 + ,103.9 + ,103.7 + ,95.6 + ,78.7 + ,101.6 + ,103.1 + ,89.7 + ,64.1 + ,94.6 + ,102.2 + ,92.8 + ,64.6 + ,95.9 + ,102.4 + ,88 + ,71.9 + ,104.7 + ,105.9 + ,101.1 + ,71 + ,102.8 + ,105.4 + ,92.7 + ,76.4 + ,98.1 + ,104.8 + ,95.8 + ,117.3 + ,113.9 + ,105.8 + ,103.8 + ,66.1 + ,80.9 + ,105.9 + ,81.8 + ,57.3 + ,95.7 + ,109.9 + ,87.1 + ,75 + ,113.2 + ,110.3 + ,105.9 + ,63.8 + ,105.9 + ,110.4 + ,108.1 + ,62.2 + ,108.8 + ,110.4 + ,102.6 + ,75.4 + ,102.3 + ,110.6 + ,93.7 + ,58 + ,99 + ,110 + ,103.5 + ,62.1 + ,100.7 + ,111.1 + ,100.6 + ,99.2 + ,115.5 + ,113.6 + ,113.3 + ,70.7 + ,100.7 + ,113.6 + ,102.4 + ,73.3 + ,109.9 + ,112.1 + ,102.1 + ,111.2 + ,114.6 + ,111.4 + ,106.9 + ,68.9 + ,85.4 + ,112.8 + ,87.3 + ,57.6 + ,100.5 + ,111 + ,93.1 + ,72.9 + ,114.8 + ,107.9 + ,109.1 + ,75.9 + ,116.5 + ,107.1 + ,120.3 + ,79.4 + ,112.9 + ,108.5 + ,104.9 + ,96.9 + ,102 + ,106.3 + ,92.6 + ,75.2 + ,106 + ,105.9 + ,109.8 + ,60.3 + ,105.3 + ,107.1 + ,111.4 + ,88.9 + ,118.8 + ,108.7 + ,117.9 + ,90.5 + ,106.1 + ,112.9 + ,121.6 + ,79.9 + ,109.3 + ,117.4 + ,117.8 + ,116.3 + ,117.2 + ,121.1 + ,124.2 + ,95.2 + ,92.5 + ,123.6 + ,106.8 + ,81.5 + ,104.2 + ,119.2 + ,102.7 + ,89.1 + ,112.5 + ,115.5 + ,116.8 + ,76 + ,122.4 + ,110.7 + ,113.6 + ,100.5 + ,113.3 + ,108.3 + ,96.1 + ,83.9 + ,100 + ,108.2 + ,85 + ,75.1 + ,110.7 + ,104.7 + ,83.2 + ,69.5 + ,112.8 + ,103.5 + ,84.9 + ,95.1 + ,109.8 + ,100.7 + ,83 + ,90.1 + ,117.3 + ,100.3 + ,79.6 + ,78.4 + ,109.1 + ,98.6 + ,83.2 + ,113.8 + ,115.9 + ,99.8 + ,83.8 + ,73.6 + ,96 + ,101.6 + ,82.8 + ,56.5 + ,99.8 + ,105.2 + ,71.4 + ,97.7) + ,dim=c(4 + ,60) + ,dimnames=list(c('iprodtot' + ,'pmetal' + ,'metalprod' + ,'investmmetal ') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('iprodtot','pmetal','metalprod','investmmetal '),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/1tdz31257694983.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) Warning messages: 1: In strwidth(labels, "user") : font width unknown for character 0xd 2: In strwidth(labels, "user") : font width unknown for character 0xd 3: In strwidth(labels, "user") : font width unknown for character 0xd 4: In text.default(x, y, txt, cex = cex, font = font) : font width unknown for character 0xd 5: In text.default(x, y, txt, cex = cex, font = font) : font width unknown for character 0xd 6: In text.default(x, y, txt, cex = cex, font = font) : font width unknown for character 0xd 7: In text.default(x, y, txt, cex = cex, font = font) : font metrics unknown for character 0xd 8: In text.default(x, y, txt, cex = cex, font = font) : font metrics unknown for character 0xd 9: In text.default(x, y, txt, cex = cex, font = font) : font metrics unknown for character 0xd > 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 = 1.1101, p-value = 0.2669 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.0986958 > 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/29s2w1257694983.tab") > > system("convert tmp/1tdz31257694983.ps tmp/1tdz31257694983.png") > > > proc.time() user system elapsed 0.480 0.430 0.825