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(10.51 + ,7.63 + ,-15.57 + ,16.07 + ,-1.02 + ,-1.52 + ,-7 + ,-8.58 + ,-2.68 + ,5.71 + ,-2.08 + ,5.08 + ,-9.75 + ,13.19 + ,6.06 + ,0.09 + ,3.64 + ,-5.5 + ,3.1 + ,3.83 + ,9.5 + ,1.77 + ,-7.28 + ,5.82 + ,-0.33 + ,1.97 + ,11.93 + ,37.12 + ,-0.99 + ,-5.61 + ,-15.18 + ,-0.46 + ,3.16 + ,-7.32 + ,-4.97 + ,-3.63 + ,4.27 + ,-1.09 + ,-3.06 + ,-3.88 + ,-2.97 + ,-0.1 + ,5.18 + ,4.62 + ,-7.49 + ,-9.4 + ,-2.3 + ,-12.97 + ,0.33 + ,-6.39 + ,-1.86 + ,3.2 + ,-2.57 + ,-2.03 + ,-8.75 + ,-5.75 + ,4.07 + ,0.9 + ,-8.02 + ,-0.57 + ,5.31 + ,7.57 + ,4.8 + ,-7.16 + ,-8.09 + ,-2.19 + ,3.9 + ,-18.05 + ,5.29 + ,3.59 + ,-11.31 + ,15.63 + ,7.38 + ,-1.69 + ,4.26 + ,-18.68 + ,-6.12 + ,-1.54 + ,-6.89 + ,-0.7 + ,-3.38 + ,13.36 + ,4.13 + ,2.59 + ,-8.61 + ,-3.66 + ,4.25 + ,2.57 + ,2.58 + ,0.61 + ,-5.92 + ,0.36 + ,10.02 + ,9.25 + ,-2.62 + ,32.56 + ,7.08 + ,11.03 + ,-5.12 + ,8.53 + ,-2.75 + ,-3.5 + ,-6.19 + ,1.42 + ,3.42 + ,-6.56 + ,1.58 + ,3.53 + ,-1.6 + ,5.55 + ,6.93 + ,0.9 + ,0.65 + ,16.5 + ,1.3 + ,-1.1 + ,2.86 + ,-0.09 + ,0.7 + ,13.32 + ,-3.52 + ,-10.19 + ,18.15 + ,-33.59 + ,5.65 + ,-1.56 + ,-13.63 + ,-0.85 + ,4.31 + ,3.62 + ,-8.97 + ,42.09 + ,-4.39 + ,-3.46 + ,-3.48 + ,-6.25 + ,-5.85 + ,-0.84 + ,0.13 + ,-11.08 + ,-5.47 + ,-1.75 + ,0.16 + ,-29.29 + ,-2.3 + ,-5.59 + ,-1.28 + ,-11.17 + ,-0.14 + ,-4.31 + ,-8.46 + ,13.92 + ,8.08 + ,8.29 + ,-2.92 + ,13.54 + ,-7.43 + ,-14.07 + ,0.15 + ,-16.49 + ,0.02 + ,-4.08 + ,3.87 + ,-9.38 + ,-2.47 + ,3.96 + ,7.71 + ,-2.84 + ,-2.11 + ,-2.54 + ,-4.12 + ,-2.88 + ,7.87 + ,24.36 + ,-2.74 + ,6.18 + ,4.66 + ,11.73 + ,3.19 + ,3.71 + ,3.6 + ,3.82 + ,-6.22 + ,3.18 + ,-3.64 + ,-2.98 + ,1.25 + ,-4.18 + ,7.26 + ,7.46 + ,4.24 + ,13.6 + ,-7.62 + ,-6.39 + ,0.15 + ,4.82 + ,13.83 + ,11.7 + ,-2.06 + ,10.05 + ,1.28 + ,2.36 + ,2.14 + ,9.69 + ,-0.32 + ,-7.48 + ,-1.68 + ,-13.63 + ,-2.9 + ,-2.54 + ,5.03 + ,2.81 + ,4.92 + ,-2.31 + ,2.25 + ,2.39 + ,11.99 + ,10.86 + ,-6.58 + ,9.12 + ,10.06 + ,-2.11 + ,-2.85 + ,14.21 + ,-2.22 + ,3.41 + ,5.04 + ,3.49 + ,3.97 + ,11.2 + ,4.44 + ,5.51 + ,0.56 + ,-1.21 + ,-0.68 + ,-6.15 + ,3.34 + ,5.82 + ,-2.51 + ,2.72 + ,-2.86 + ,-2.61 + ,2.36 + ,-11.12 + ,4.38 + ,-1.54 + ,-6.32 + ,-4.7 + ,1.43 + ,-5.42 + ,-3.82 + ,1.82 + ,-0.49 + ,11.6 + ,2.17 + ,-10.44 + ,-1.23 + ,-9.07 + ,4.14 + ,6.04) + ,dim=c(4 + ,65) + ,dimnames=list(c('Producten' + ,'Machines' + ,'Electronica' + ,'Medisch') + ,1:65)) > y <- array(NA,dim=c(4,65),dimnames=list(c('Producten','Machines','Electronica','Medisch'),1:65)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > main = 'Paper - Kendall tau correlation matrix -' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2007), Multivariate Correlation Matrix (v1.0.3) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_pairs.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description > 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/1df121230472996.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.4932, p-value = 0.0004772 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.2968488 > 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/2pm0n1230472996.tab") > > system("convert tmp/1df121230472996.ps tmp/1df121230472996.png") > > > proc.time() user system elapsed 0.510 0.219 0.608