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(101 + ,100.64 + ,4.54 + ,9 + ,100.88 + ,100.63 + ,4.23 + ,8.6 + ,100.55 + ,100.43 + ,3.96 + ,8.8 + ,100.83 + ,100.8 + ,3.94 + ,8.5 + ,101.51 + ,101.33 + ,4.25 + ,8.3 + ,102.16 + ,101.88 + ,4.76 + ,8.2 + ,102.39 + ,101.85 + ,4.44 + ,8 + ,102.54 + ,102.04 + ,4.19 + ,7.9 + ,102.85 + ,102.22 + ,4.55 + ,8 + ,103.47 + ,102.63 + ,4.82 + ,9.3 + ,103.57 + ,102.65 + ,4.80 + ,9.6 + ,103.69 + ,102.54 + ,4.84 + ,9 + ,103.5 + ,102.37 + ,4.16 + ,8.7 + ,103.47 + ,102.68 + ,4.25 + ,8.3 + ,103.45 + ,102.76 + ,4.56 + ,8.4 + ,103.48 + ,102.82 + ,4.31 + ,7.8 + ,103.93 + ,103.31 + ,4.06 + ,7.8 + ,103.89 + ,103.23 + ,3.37 + ,7.6 + ,104.4 + ,103.6 + ,3.64 + ,7.7 + ,104.79 + ,103.95 + ,3.87 + ,7.6 + ,104.77 + ,103.93 + ,3.55 + ,7.6 + ,105.13 + ,104.25 + ,3.28 + ,8.6 + ,105.26 + ,104.38 + ,3.31 + ,8.6 + ,104.96 + ,104.36 + ,2.90 + ,8.2 + ,104.75 + ,104.32 + ,2.89 + ,7.5 + ,105.01 + ,104.58 + ,3.17 + ,7.1 + ,105.15 + ,104.68 + ,3.32 + ,7 + ,105.2 + ,104.92 + ,3.34 + ,6.9 + ,105.77 + ,105.46 + ,3.45 + ,6.6 + ,105.78 + ,105.23 + ,3.50 + ,6.3 + ,106.26 + ,105.58 + ,3.46 + ,6.1 + ,106.13 + ,105.34 + ,2.96 + ,5.9 + ,106.12 + ,105.28 + ,2.97 + ,6 + ,106.57 + ,105.7 + ,3.05 + ,7.2 + ,106.44 + ,105.67 + ,2.80 + ,7.2 + ,106.54 + ,105.71 + ,3.19 + ,6.4 + ,107.1 + ,106.19 + ,3.92 + ,6.1 + ,108.1 + ,106.93 + ,4.62 + ,5.9 + ,108.4 + ,107.44 + ,4.77 + ,6.1 + ,108.84 + ,107.85 + ,5.14 + ,5.9 + ,109.62 + ,108.71 + ,5.32 + ,5.8 + ,110.42 + ,109.32 + ,6.07 + ,5.7 + ,110.67 + ,109.49 + ,5.83 + ,5.6 + ,111.66 + ,110.2 + ,6.89 + ,5.3 + ,112.28 + ,110.62 + ,7.48 + ,5.5 + ,112.87 + ,111.22 + ,7.59 + ,6.5 + ,112.18 + ,110.88 + ,7.07 + ,6.5 + ,112.36 + ,111.15 + ,7.14 + ,6.1 + ,112.16 + ,111.29 + ,6.40 + ,5.9 + ,111.49 + ,111.09 + ,4.82 + ,5.8 + ,111.25 + ,111.24 + ,4.31 + ,6.2 + ,111.36 + ,111.45 + ,4.00 + ,6.5 + ,111.74 + ,111.75 + ,3.61 + ,6.6 + ,111.1 + ,111.07 + ,2.30 + ,6.7 + ,111.33 + ,111.17 + ,2.28 + ,6.6 + ,111.25 + ,110.96 + ,1.31 + ,6.5 + ,111.04 + ,110.5 + ,0.58 + ,6.8 + ,110.97 + ,110.48 + ,0.00 + ,7.8 + ,111.31 + ,110.66 + ,0.90 + ,7.9 + ,111.02 + ,110.46 + ,0.49 + ,7.4) + ,dim=c(4 + ,60) + ,dimnames=list(c('Cons' + ,'Gezond' + ,'Inflatie' + ,'Werk') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('Cons','Gezond','Inflatie','Werk'),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/1xcnp1257953500.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 = 10.2944, p-value < 2.2e-16 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.91238 > 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/2y9rw1257953500.tab") > > system("convert tmp/1xcnp1257953500.ps tmp/1xcnp1257953500.png") > > > proc.time() user system elapsed 0.499 0.199 0.606