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(92.4 + ,99.7 + ,91.1 + ,88.3 + ,92 + ,99 + ,90.2 + ,88.6 + ,95.6 + ,98.1 + ,94.3 + ,94.9 + ,95.8 + ,97 + ,96 + ,94.7 + ,96.4 + ,98.5 + ,99 + ,92.6 + ,99 + ,103.8 + ,103.3 + ,91.8 + ,107 + ,114.4 + ,113.1 + ,96.4 + ,109.7 + ,124.5 + ,112.8 + ,96.4 + ,116.2 + ,134.2 + ,112.1 + ,107.1 + ,115.9 + ,131.8 + ,107.4 + ,111.9 + ,113.8 + ,125.6 + ,111 + ,107.8 + ,112.6 + ,119.9 + ,110.5 + ,109.2 + ,113.7 + ,114.9 + ,110.8 + ,115.3 + ,115.9 + ,115.5 + ,112.4 + ,119.2 + ,110.3 + ,112.5 + ,111.5 + ,107.8 + ,111.3 + ,111.4 + ,116.2 + ,106.8 + ,113.4 + ,115.3 + ,122.5 + ,104.2 + ,108.2 + ,110.8 + ,121.3 + ,94.8 + ,104.8 + ,103.7 + ,113.9 + ,97.5 + ,106 + ,111.1 + ,110.7 + ,98.3 + ,110.9 + ,113 + ,120.8 + ,100.6 + ,115 + ,111.2 + ,141.1 + ,94.9 + ,118.4 + ,117.6 + ,147.4 + ,93.6 + ,121.4 + ,121.7 + ,148 + ,98 + ,128.8 + ,127.3 + ,158.1 + ,104.3 + ,131.7 + ,129.8 + ,165 + ,103.9 + ,141.7 + ,137.1 + ,187 + ,105.3 + ,142.9 + ,141.4 + ,190.3 + ,102.6 + ,139.4 + ,137.4 + ,182.4 + ,103.3 + ,134.7 + ,130.7 + ,168.8 + ,107.9 + ,125 + ,117.2 + ,151.2 + ,107.8 + ,113.6 + ,110.8 + ,120.1 + ,109.8 + ,111.5 + ,111.4 + ,112.5 + ,110.6 + ,108.5 + ,108.2 + ,106.2 + ,110.8 + ,112.3 + ,108.8 + ,107.1 + ,119.3 + ,116.6 + ,110.2 + ,108.5 + ,128.1 + ,115.5 + ,109.5 + ,106.5 + ,127.6 + ,120.1 + ,109.5 + ,108.3 + ,137.9 + ,132.9 + ,116 + ,125.6 + ,151.4 + ,128.1 + ,111.2 + ,124 + ,143.6 + ,129.3 + ,112.1 + ,127.2 + ,143.4 + ,132.5 + ,114 + ,136.9 + ,141.9 + ,131 + ,119.1 + ,135.8 + ,135.2 + ,124.9 + ,114.1 + ,124.3 + ,133.1 + ,120.8 + ,115.1 + ,115.4 + ,129.6 + ,122 + ,115.4 + ,113.6 + ,134.1 + ,122.1 + ,110.8 + ,114.4 + ,136.8 + ,127.4 + ,116 + ,118.4 + ,143.5 + ,135.2 + ,119.2 + ,117 + ,162.5 + ,137.3 + ,126.5 + ,116.5 + ,163.1 + ,135 + ,127.8 + ,115.4 + ,157.2 + ,136 + ,131.3 + ,113.6 + ,158.8 + ,138.4 + ,140.3 + ,117.4 + ,155.4 + ,134.7 + ,137.3 + ,116.9 + ,148.5 + ,138.4 + ,143 + ,116.4 + ,154.2 + ,133.9 + ,134.5 + ,111.1 + ,153.3 + ,133.6 + ,139.9 + ,110.2 + ,149.4 + ,141.2 + ,159.3 + ,118.9 + ,147.9 + ,151.8 + ,170.4 + ,131.8 + ,156 + ,155.4 + ,175 + ,130.6 + ,163) + ,dim=c(4 + ,60) + ,dimnames=list(c('tot' + ,'graan' + ,'olie' + ,'genot') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('tot','graan','olie','genot'),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: 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/18a0i1195830736.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] 4 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 7.2086, p-value = 5.651e-13 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.640227 > 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/2h0951195830736.tab") > > system("convert tmp/18a0i1195830736.ps tmp/18a0i1195830736.png") > > > proc.time() user system elapsed 0.746 0.216 0.814