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(467,101.0,460,98.7,448,105.1,443,98.4,436,101.7,431,102.9,484,92.2,510,94.9,513,92.8,503,98.5,471,94.3,471,87.4,476,103.4,475,101.2,470,109.6,461,111.9,455,108.9,456,105.6,517,107.8,525,97.5,523,102.4,519,105.6,509,99.8,512,96.2,519,113.1,517,107.4,510,116.8,509,112.9,501,105.3,507,109.3,569,107.9,580,101.1,578,114.7,565,116.2,547,108.4,555,113.4,562,108.7,561,112.6,555,124.2,544,114.9,537,110.5,543,121.5,594,118.1,611,111.7,613,132.7,611,119.0,594,116.7,595,120.1,591,113.4,589,106.6,584,116.3,573,112.6,567,111.6,569,125.1,621,110.7,629,109.6,628,114.2,612,113.4,595,116.0,597,109.6,593,117.8,590,115.8,580,125.3,574,113.0,573,120.5,573,116.6,620,111.8,626,115.2,620,118.6,588,122.4,566,116.4,557,114.5,561,119.8,549,115.8,532,127.8,526,118.8,511,119.7,499,118.6,555,120.8,565,115.9,542,109.7,527,114.8,510,116.2,514,112.2),dim=c(2,84),dimnames=list(c('U','productie'),1:84)) > y <- array(NA,dim=c(2,84),dimnames=list(c('U','productie'),1:84)) > 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/html/rcomp/tmp/1tocj1228817627.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > 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] 2 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 4.8379, p-value = 1.312e-06 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.3608073 > 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/20dw91228817628.tab") > > system("convert tmp/1tocj1228817627.ps tmp/1tocj1228817627.png") > > > proc.time() user system elapsed 0.443 0.197 0.583