R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(8.9 + ,45 + ,95.1 + ,95.05 + ,8.8 + ,43 + ,97 + ,96.84 + ,8.3 + ,43 + ,112.7 + ,96.92 + ,7.5 + ,49 + ,102.9 + ,97.44 + ,7.2 + ,42 + ,97.4 + ,97.78 + ,7.4 + ,33 + ,111.4 + ,97.69 + ,8.8 + ,35 + ,87.4 + ,96.67 + ,9.3 + ,35 + ,96.8 + ,98.29 + ,9.3 + ,36 + ,114.1 + ,98.2 + ,8.7 + ,41 + ,110.3 + ,98.71 + ,8.2 + ,44 + ,103.9 + ,98.54 + ,8.3 + ,42 + ,101.6 + ,98.2 + ,8.5 + ,48 + ,94.6 + ,96.92 + ,8.6 + ,47 + ,95.9 + ,99.06 + ,8.5 + ,40 + ,104.7 + ,99.65 + ,8.2 + ,42 + ,102.8 + ,99.82 + ,8.1 + ,50 + ,98.1 + ,99.99 + ,7.9 + ,54 + ,113.9 + ,100.33 + ,8.6 + ,45 + ,80.9 + ,99.31 + ,8.7 + ,47 + ,95.7 + ,101.1 + ,8.7 + ,49 + ,113.2 + ,101.1 + ,8.5 + ,37 + ,105.9 + ,100.93 + ,8.4 + ,41 + ,108.8 + ,100.85 + ,8.5 + ,34 + ,102.3 + ,100.93 + ,8.7 + ,30 + ,99 + ,99.6 + ,8.7 + ,33 + ,100.7 + ,101.88 + ,8.6 + ,37 + ,115.5 + ,101.81 + ,8.5 + ,33 + ,100.7 + ,102.38 + ,8.3 + ,31 + ,109.9 + ,102.74 + ,8 + ,28 + ,114.6 + ,102.82 + ,8.2 + ,26 + ,85.4 + ,101.72 + ,8.1 + ,21 + ,100.5 + ,103.47 + ,8.1 + ,24 + ,114.8 + ,102.98 + ,8 + ,7 + ,116.5 + ,102.68 + ,7.9 + ,12 + ,112.9 + ,102.9 + ,7.9 + ,36 + ,102 + ,103.03 + ,8 + ,21 + ,106 + ,101.29 + ,8 + ,21 + ,105.3 + ,103.69 + ,7.9 + ,21 + ,118.8 + ,103.68 + ,8 + ,13 + ,106.1 + ,104.2 + ,7.7 + ,18 + ,109.3 + ,104.08 + ,7.2 + ,18 + ,117.2 + ,104.16 + ,7.5 + ,17 + ,92.5 + ,103.05 + ,7.3 + ,13 + ,104.2 + ,104.66 + ,7 + ,14 + ,112.5 + ,104.46 + ,7 + ,3 + ,122.4 + ,104.95 + ,7 + ,10 + ,113.3 + ,105.85 + ,7.2 + ,5 + ,100 + ,106.23 + ,7.3 + ,15 + ,110.7 + ,104.86 + ,7.1 + ,9 + ,112.8 + ,107.44 + ,6.8 + ,6 + ,109.8 + ,108.23 + ,6.4 + ,14 + ,117.3 + ,108.45 + ,6.1 + ,17 + ,109.1 + ,109.39 + ,6.5 + ,16 + ,115.9 + ,110.15 + ,7.7 + ,23 + ,96 + ,109.13 + ,7.9 + ,30 + ,99.8 + ,110.28 + ,7.5 + ,31 + ,116.8 + ,110.17 + ,6.9 + ,47 + ,115.7 + ,109.99 + ,6.6 + ,62 + ,99.4 + ,109.26 + ,6.9 + ,69 + ,94.3 + ,109.11) + ,dim=c(4 + ,60) + ,dimnames=list(c('Werkloosheidsgraad' + ,'Vertrouwensindicator' + ,'Industrie' + ,'Consumptie') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('Werkloosheidsgraad','Vertrouwensindicator','Industrie','Consumptie'),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/rcomp/tmp/1q7yy1257958087.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] 4 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 3.8432, p-value = 0.0001214 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.3488314 > 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/2g7171257958087.tab") > > system("convert tmp/1q7yy1257958087.ps tmp/1q7yy1257958087.png") > > > proc.time() user system elapsed 0.510 0.212 1.021