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(105.7 + ,80.9 + ,94.1 + ,-11 + ,105.7 + ,113.8 + ,95.8 + ,-9 + ,111.1 + ,71.2 + ,99.3 + ,-10 + ,82.4 + ,55.8 + ,101.1 + ,-13 + ,60 + ,61 + ,104 + ,-11 + ,107.3 + ,60.8 + ,99 + ,-5 + ,99.3 + ,74.3 + ,105.4 + ,-15 + ,113.5 + ,66.5 + ,107.1 + ,-6 + ,108.9 + ,71 + ,110.7 + ,-6 + ,100.2 + ,61.6 + ,117.1 + ,-3 + ,103.9 + ,66.4 + ,118.7 + ,-1 + ,138.7 + ,74.7 + ,126.5 + ,-3 + ,120.2 + ,72.4 + ,127.5 + ,-4 + ,100.2 + ,76.4 + ,134.6 + ,-6 + ,143.2 + ,86.4 + ,131.8 + ,0 + ,70.9 + ,73.9 + ,135.9 + ,-4 + ,85.2 + ,133.1 + ,142.7 + ,-2 + ,133 + ,83.3 + ,141.7 + ,-2 + ,136.6 + ,85.8 + ,153.4 + ,-6 + ,117.9 + ,76.8 + ,145 + ,-7 + ,106.3 + ,92.7 + ,137.7 + ,-6 + ,122.3 + ,68.8 + ,148.3 + ,-6 + ,125.5 + ,69.4 + ,152.2 + ,-3 + ,148.4 + ,97 + ,169.4 + ,-2 + ,126.3 + ,84.6 + ,168.6 + ,-5 + ,99.6 + ,84.2 + ,161.1 + ,-11 + ,140.4 + ,201.8 + ,174.1 + ,-11 + ,80.3 + ,83.1 + ,179 + ,-11 + ,92.6 + ,69.4 + ,190.6 + ,-10 + ,138.5 + ,78.8 + ,190 + ,-14 + ,110.9 + ,77.1 + ,181.6 + ,-8 + ,119.6 + ,90.7 + ,174.8 + ,-9 + ,105 + ,107.5 + ,180.5 + ,-5 + ,109 + ,81.4 + ,196.8 + ,-1 + ,129.4 + ,83.3 + ,193.8 + ,-2 + ,148.6 + ,105.7 + ,197 + ,-5 + ,101.4 + ,85.8 + ,216.3 + ,-4 + ,134.8 + ,87.2 + ,221.4 + ,-6 + ,143.7 + ,87.5 + ,217.9 + ,-2 + ,81.6 + ,77.5 + ,229.7 + ,-2 + ,90.3 + ,78.5 + ,227.4 + ,-2 + ,141.5 + ,89.7 + ,204.2 + ,-2 + ,140.7 + ,94.3 + ,196.6 + ,2 + ,140.2 + ,104.4 + ,198.8 + ,1 + ,100.2 + ,115.9 + ,207.5 + ,-8 + ,125.7 + ,90 + ,190.7 + ,-1 + ,119.6 + ,91.1 + ,201.6 + ,1 + ,134.7 + ,119.8 + ,210.5 + ,-1 + ,109 + ,101.9 + ,223.5 + ,2 + ,116.3 + ,99.2 + ,223.8 + ,2 + ,146.9 + ,115.7 + ,231.2 + ,1 + ,97.4 + ,94.9 + ,244 + ,-1 + ,89.4 + ,99.8 + ,234.7 + ,-2 + ,132.1 + ,109.6 + ,250.2 + ,-2 + ,139.8 + ,109 + ,265.7 + ,-1 + ,129 + ,119.6 + ,287.6 + ,-8 + ,112.5 + ,119.2 + ,283.3 + ,-4 + ,121.9 + ,94.6 + ,295.4 + ,-6 + ,121.7 + ,102.5 + ,312.3 + ,-3 + ,123.1 + ,105.4 + ,333.8 + ,-3) + ,dim=c(4 + ,60) + ,dimnames=list(c('Auto' + ,'Overige' + ,'Prijsindex' + ,'Consumentenvertrouwen') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('Auto','Overige','Prijsindex','Consumentenvertrouwen'),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/html/freestat/rcomp/tmp/1kc4f1257952008.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 = 2.8132, p-value = 0.004905 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.2497877 > 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/2dwwy1257952008.tab") > > system("convert tmp/1kc4f1257952008.ps tmp/1kc4f1257952008.png") > > > proc.time() user system elapsed 0.700 0.272 0.775