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(97.3 + ,93.5 + ,105.5 + ,96.5 + ,101 + ,94.7 + ,106.4 + ,97.3 + ,113.2 + ,112.9 + ,117.9 + ,122.0 + ,101 + ,99.2 + ,89.7 + ,91.0 + ,105.7 + ,105.6 + ,88.5 + ,107.9 + ,113.9 + ,113.0 + ,106.4 + ,114.6 + ,86.4 + ,83.1 + ,61.4 + ,98.0 + ,96.5 + ,81.1 + ,92.3 + ,95.5 + ,103.3 + ,96.9 + ,95.5 + ,98.7 + ,114.9 + ,104.3 + ,92.5 + ,115.9 + ,105.8 + ,97.7 + ,89.6 + ,110.4 + ,94.2 + ,102.6 + ,84.3 + ,109.5 + ,98.4 + ,89.9 + ,76.3 + ,92.3 + ,99.4 + ,96.0 + ,80.7 + ,102.1 + ,108.8 + ,112.7 + ,96.3 + ,112.8 + ,112.6 + ,107.1 + ,81 + ,110.2 + ,104.4 + ,106.2 + ,82.9 + ,98.9 + ,112.2 + ,121.0 + ,90.3 + ,119.0 + ,81.1 + ,101.2 + ,74.8 + ,104.3 + ,97.1 + ,83.2 + ,70.1 + ,98.8 + ,112.6 + ,105.1 + ,86.7 + ,109.4 + ,113.8 + ,113.3 + ,86.4 + ,170.3 + ,107.8 + ,99.1 + ,89.9 + ,118.0 + ,103.2 + ,100.3 + ,88.1 + ,116.9 + ,103.3 + ,93.5 + ,78.8 + ,111.7 + ,101.2 + ,98.8 + ,81.1 + ,116.8 + ,107.7 + ,106.2 + ,85.4 + ,116.1 + ,110.4 + ,98.3 + ,82.6 + ,114.8 + ,101.9 + ,102.1 + ,80.3 + ,110.8 + ,115.9 + ,117.1 + ,81.2 + ,122.8 + ,89.9 + ,101.5 + ,68 + ,104.7 + ,88.6 + ,80.5 + ,67.4 + ,86.0 + ,117.2 + ,105.9 + ,91.3 + ,127.2 + ,123.9 + ,109.5 + ,94.9 + ,126.1 + ,100 + ,97.2 + ,82.8 + ,114.6 + ,103.6 + ,114.5 + ,88.6 + ,127.8 + ,94.1 + ,93.5 + ,73.1 + ,105.2 + ,98.7 + ,100.9 + ,76.7 + ,113.1 + ,119.5 + ,121.1 + ,93.2 + ,161.0 + ,112.7 + ,116.5 + ,84.9 + ,126.9 + ,104.4 + ,109.3 + ,83.8 + ,117.7 + ,124.7 + ,118.1 + ,93.5 + ,144.9 + ,89.1 + ,108.3 + ,91.9 + ,119.4 + ,97 + ,105.4 + ,69.6 + ,107.1 + ,121.6 + ,116.2 + ,87 + ,142.8 + ,118.8 + ,111.2 + ,90.2 + ,126.2 + ,114 + ,105.8 + ,82.7 + ,126.9 + ,111.5 + ,122.7 + ,91.4 + ,179.2 + ,97.2 + ,99.5 + ,74.6 + ,105.3 + ,102.5 + ,107.9 + ,76.1 + ,114.8 + ,113.4 + ,124.6 + ,87.1 + ,125.4 + ,109.8 + ,115.0 + ,78.4 + ,113.2 + ,104.9 + ,110.3 + ,81.3 + ,134.4 + ,126.1 + ,132.7 + ,99.3 + ,150.0 + ,80 + ,99.7 + ,71 + ,100.9 + ,96.8 + ,96.5 + ,73.2 + ,101.8 + ,117.2 + ,118.7 + ,95.6 + ,137.7 + ,112.3 + ,112.9 + ,84 + ,138.7 + ,117.3 + ,130.5 + ,90.8 + ,135.4 + ,111.1 + ,137.9 + ,93.6 + ,153.8 + ,102.2 + ,115.0 + ,80.9 + ,119.5 + ,104.3 + ,116.8 + ,84.4 + ,123.3 + ,122.9 + ,140.9 + ,97.3 + ,166.4 + ,107.6 + ,120.7 + ,83.5 + ,137.5 + ,121.3 + ,134.2 + ,88.8 + ,142.2 + ,131.5 + ,147.3 + ,100.7 + ,167.0 + ,89 + ,112.4 + ,69.4 + ,112.3 + ,104.4 + ,107.1 + ,74.6 + ,120.6 + ,128.9 + ,128.4 + ,96.6 + ,154.9 + ,135.9 + ,137.7 + ,96.6 + ,153.4 + ,133.3 + ,135.0 + ,93.1 + ,156.2 + ,121.3 + ,151.0 + ,91.8 + ,175.8 + ,120.5 + ,137.4 + ,85.7 + ,131.7 + ,120.4 + ,132.4 + ,79.1 + ,130.1 + ,137.9 + ,161.3 + ,91.3 + ,161.1 + ,126.1 + ,139.8 + ,84.2 + ,128.2 + ,133.2 + ,146.0 + ,85.8 + ,140.3 + ,146.6 + ,154.6 + ,90 + ,168.2 + ,103.4 + ,142.1 + ,76.6 + ,110.2 + ,117.2 + ,120.5 + ,81.3 + ,126.2) + ,dim=c(4 + ,80) + ,dimnames=list(c('Metal' + ,'Machines' + ,'Electronics' + ,'Medical') + ,1:80)) > y <- array(NA,dim=c(4,80),dimnames=list(c('Metal','Machines','Electronics','Medical'),1:80)) > 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 matrix Plot' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2007), Multivariate Correlation Matrix (v1.0.3) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_pairs.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description > 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/18vjp1230314406.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 = 7.7706, p-value = 7.772e-15 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.5934625 > 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/2vpwa1230314406.tab") > > system("convert tmp/18vjp1230314406.ps tmp/18vjp1230314406.png") > > > proc.time() user system elapsed 0.730 0.301 0.848