R version 2.6.0 (2007-10-03) Copyright (C) 2007 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(86.5,98.5,109.2,104.1,99.3,126.3,110.9,98,104,114.5,98.1,96,112.2,98,262,96.4,96.5,89.8,92,96.1,86,102,96.3,92.7,99.7,96.1,126.8,102,95.4,92.8,98.9,95.3,87.8,87.4,93.9,100,94.4,94,72.4,109.3,93.6,104.9,116.4,93.5,52.3,101,93.5,65.3,105.5,93.5,110.2,97.8,93,54.4,95.5,93.1,47.5,113.7,93.3,65.2,103.7,93.2,69.8,100.8,93.1,53.6,113.8,93.1,116.1,84.6,93.2,56.6,95.3,93,47.2,110,93.1,90.6,107.5,93.2,60.4,107.6,93.1,59.3,116,93.1,131.6,96.9,93.1,59.4,97,92.3,65.5,108.1,92.3,70.5,101.9,92.3,81,107.2,92.3,73.3,110.2,92.1,107.5,78.7,92.1,88.9,96.5,92.1,55.8,115.2,92,80.5,104.7,92,86.3,109.1,92.3,112.6,108.4,93.3,148.6,95.5,92.4,47.1,97.8,92.6,57.8,115.1,92.7,81,96.2,92.4,60.1,112,92.2,76.1,111.8,92.7,82.5,82.5,92.7,66.8,100.8,92.8,58.7,116,92.8,54.2,116.3,92.8,103.3,116.6,92.7,77.8,112.9,92.8,118.4,100.9,93.6,64.9,104.1,93.4,40.8,117.4,93.8,77.7,103.3,93.8,66.8,111.6,93.9,69.2,115,94,82.4,92.6,93.9,62.7,105.2,93.9,58.2),dim=c(3,61),dimnames=list(c('Indpr','Afzpr','Inv'),1:61)) > y <- array(NA,dim=c(3,61),dimnames=list(c('Indpr','Afzpr','Inv'),1:61)) > 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: 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/rcomp/tmp/1twlp1198234766.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 > load(file='/var/www/html/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] 3 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = -0.5176, p-value = 0.6047 alternative hypothesis: true tau is not equal to 0 sample estimates: tau -0.04628492 > 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/rcomp/tmp/2mld51198234766.tab") > > system("convert tmp/1twlp1198234766.ps tmp/1twlp1198234766.png") > > > proc.time() user system elapsed 0.659 0.206 0.721