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(2.3 + ,130.7 + ,125.9 + ,1.58 + ,2.4 + ,117.2 + ,133.1 + ,1.59 + ,2.3 + ,110.8 + ,147 + ,1.6 + ,2.1 + ,111.4 + ,145.8 + ,1.6 + ,3 + ,108.2 + ,164.4 + ,1.61 + ,2.6 + ,108.8 + ,149.8 + ,1.61 + ,2.2 + ,110.2 + ,137.7 + ,1.61 + ,2.3 + ,109.5 + ,151.7 + ,1.62 + ,2.6 + ,109.5 + ,156.8 + ,1.63 + ,3.1 + ,116 + ,180 + ,1.63 + ,2.7 + ,111.2 + ,180.4 + ,1.64 + ,2.6 + ,112.1 + ,170.4 + ,1.64 + ,3 + ,114 + ,191.6 + ,1.64 + ,3 + ,119.1 + ,199.5 + ,1.64 + ,3.2 + ,114.1 + ,218.2 + ,1.64 + ,3.3 + ,115.1 + ,217.5 + ,1.65 + ,2.5 + ,115.4 + ,205 + ,1.65 + ,2.6 + ,110.8 + ,194 + ,1.65 + ,3.1 + ,116 + ,199.3 + ,1.65 + ,3.1 + ,119.2 + ,219.3 + ,1.65 + ,3.1 + ,126.5 + ,211.1 + ,1.66 + ,2.5 + ,127.8 + ,215.2 + ,1.66 + ,2.9 + ,131.3 + ,240.2 + ,1.67 + ,3.1 + ,140.3 + ,242.2 + ,1.68 + ,2.8 + ,137.3 + ,240.7 + ,1.68 + ,2.7 + ,143 + ,255.4 + ,1.68 + ,2.6 + ,134.5 + ,253 + ,1.68 + ,2.2 + ,139.9 + ,218.2 + ,1.69 + ,2 + ,159.3 + ,203.7 + ,1.7 + ,2.3 + ,170.4 + ,205.6 + ,1.7 + ,2.4 + ,175 + ,215.6 + ,1.71 + ,2 + ,175.8 + ,188.5 + ,1.72 + ,2.1 + ,180.9 + ,202.9 + ,1.73 + ,2.1 + ,180.3 + ,214 + ,1.74 + ,2.1 + ,169.6 + ,230.3 + ,1.74 + ,1.6 + ,172.3 + ,230 + ,1.75 + ,1.6 + ,184.8 + ,241 + ,1.75 + ,1.6 + ,177.7 + ,259.6 + ,1.75 + ,1.5 + ,184.6 + ,247.8 + ,1.76 + ,1.7 + ,211.4 + ,270.3 + ,1.79 + ,2.5 + ,215.3 + ,289.7 + ,1.83 + ,3.2 + ,215.9 + ,322.7 + ,1.84 + ,3.4 + ,244.7 + ,315 + ,1.85 + ,3.8 + ,259.3 + ,320.2 + ,1.87 + ,3.9 + ,289 + ,329.5 + ,1.87 + ,4.7 + ,310.9 + ,360.6 + ,1.87 + ,4.4 + ,321 + ,382.2 + ,1.88 + ,5.4 + ,315.1 + ,435.4 + ,1.88 + ,6.1 + ,333.2 + ,464 + ,1.88 + ,6.2 + ,314.1 + ,468.8 + ,1.88 + ,5.7 + ,284.7 + ,403 + ,1.89 + ,5.8 + ,273.9 + ,351.6 + ,1.89 + ,5.1 + ,216 + ,252 + ,1.89 + ,3.5 + ,196.4 + ,188 + ,1.9 + ,3 + ,190.9 + ,146.5 + ,1.89 + ,2.4 + ,206.4 + ,152.9 + ,1.89 + ,2.2 + ,196.3 + ,148.1 + ,1.89 + ,0.9 + ,199.5 + ,165.1 + ,1.89 + ,1 + ,198.9 + ,177 + ,1.89 + ,0.1 + ,214.4 + ,206.1 + ,1.89) + ,dim=c(4 + ,60) + ,dimnames=list(c('Prijsindex' + ,'Graan' + ,'Olie' + ,'Brood') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('Prijsindex','Graan','Olie','Brood'),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/1zf8m1257421053.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/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.399, p-value = 0.1618 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.1257305 > 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/24e351257421053.tab") > > system("convert tmp/1zf8m1257421053.ps tmp/1zf8m1257421053.png") > > > proc.time() user system elapsed 0.56 0.39 0.78