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(1.0800 + ,1.0100 + ,1.6100 + ,1.7700 + ,1.3900 + ,1.7700 + ,1.0900 + ,1.0000 + ,1.5800 + ,1.7700 + ,1.3500 + ,1.9800 + ,1.1000 + ,1.0000 + ,1.6900 + ,1.7700 + ,1.3900 + ,1.9400 + ,1.1000 + ,1.0000 + ,1.7800 + ,1.7700 + ,1.3700 + ,1.8500 + ,1.1100 + ,1.0600 + ,1.7600 + ,1.7400 + ,1.3800 + ,1.8400 + ,1.1000 + ,1.2200 + ,1.8300 + ,1.7800 + ,1.5100 + ,1.8200 + ,1.1000 + ,1.2400 + ,1.8000 + ,1.7800 + ,1.5100 + ,1.8300 + ,1.1100 + ,1.3400 + ,1.5700 + ,1.7800 + ,1.4500 + ,1.9100 + ,1.1100 + ,1.3000 + ,1.4500 + ,1.7800 + ,1.3000 + ,1.8500 + ,1.1100 + ,1.0500 + ,1.4000 + ,1.8100 + ,1.2900 + ,1.8100 + ,1.1100 + ,1.0000 + ,1.5500 + ,1.8400 + ,1.4400 + ,1.8300 + ,1.1100 + ,1.0000 + ,1.5800 + ,1.8000 + ,1.4600 + ,1.7900 + ,1.1200 + ,1.0100 + ,1.5800 + ,1.7800 + ,1.5000 + ,1.8000 + ,1.1100 + ,1.0200 + ,1.5900 + ,1.7600 + ,1.3900 + ,1.8200 + ,1.1100 + ,1.0600 + ,1.8000 + ,1.7400 + ,1.4800 + ,1.8800 + ,1.1200 + ,1.0900 + ,1.9900 + ,1.7200 + ,1.5200 + ,2.0100 + ,1.1200 + ,1.0900 + ,2.0600 + ,1.7300 + ,1.6800 + ,1.9700 + ,1.1100 + ,1.1500 + ,2.0600 + ,1.7700 + ,1.7400 + ,1.9200 + ,1.1200 + ,1.2500 + ,2.0800 + ,1.8100 + ,1.7200 + ,1.9800 + ,1.1100 + ,1.3700 + ,2.0000 + ,1.8300 + ,1.7400 + ,2.0200 + ,1.1100 + ,1.5100 + ,1.8500 + ,1.8700 + ,1.8300 + ,1.9000 + ,1.1000 + ,1.3500 + ,1.7700 + ,1.8900 + ,1.9900 + ,1.9400 + ,1.1000 + ,1.3200 + ,1.7000 + ,1.8200 + ,1.8500 + ,1.9600 + ,1.1000 + ,1.3000 + ,1.6600 + ,1.7900 + ,1.6800 + ,1.8400 + ,1.1100 + ,1.3900 + ,1.6700 + ,1.7900 + ,1.6200 + ,1.8700 + ,1.1000 + ,1.4000 + ,1.7300 + ,1.8200 + ,1.6200 + ,1.8400 + ,1.1000 + ,1.3900 + ,1.9100 + ,1.8200 + ,1.6400 + ,2.0700 + ,1.0900 + ,1.4200 + ,2.0200 + ,1.8100 + ,1.5900 + ,2.0800 + ,1.1000 + ,1.4400 + ,2.0700 + ,1.8100 + ,1.6300 + ,2.1400 + ,1.1000 + ,1.4400 + ,2.1500 + ,1.7800 + ,1.6800 + ,2.1500 + ,1.1100 + ,1.4500 + ,2.1000 + ,1.8000 + ,1.5900 + ,2.0500 + ,1.1300 + ,1.3900 + ,1.6800 + ,1.7900 + ,1.5400 + ,2.0500 + ,1.1300 + ,1.4800 + ,1.6800 + ,1.8300 + ,1.5100 + ,1.9500 + ,1.1300 + ,1.3200 + ,1.6500 + ,1.8200 + ,1.5000 + ,2.0200 + ,1.1300 + ,1.2900 + ,1.7200 + ,1.8000 + ,1.7100 + ,2.0200 + ,1.1400 + ,1.3100 + ,1.7300 + ,1.8200 + ,1.6000 + ,1.8800 + ,1.1400 + ,1.2700 + ,1.7600 + ,1.8400 + ,1.5500 + ,1.9600 + ,1.1400 + ,1.3800 + ,1.8400 + ,1.8200 + ,1.6300 + ,1.9300 + ,1.1500 + ,1.3800 + ,1.9900 + ,1.8100 + ,1.6400 + ,2.0300 + ,1.1500 + ,1.4500 + ,2.0500 + ,1.7900 + ,1.6800 + ,2.1000 + ,1.1500 + ,1.5000 + ,2.1200 + ,1.8700 + ,1.7200 + ,1.9500 + ,1.1500 + ,1.6300 + ,2.1300 + ,1.8900 + ,1.7600 + ,2.0700 + ,1.1500 + ,1.7300 + ,2.0800 + ,1.9200 + ,1.8400 + ,2.0900 + ,1.1500 + ,1.8400 + ,1.8800 + ,1.9000 + ,1.8900 + ,2.0100 + ,1.1400 + ,1.7500 + ,1.8100 + ,1.9100 + ,1.8600 + ,1.9200 + ,1.1400 + ,1.3400 + ,1.8100 + ,1.9500 + ,1.8100 + ,1.9900 + ,1.1400 + ,1.3600 + ,1.8800 + ,2.0400 + ,1.8300 + ,2.1100 + ,1.1300 + ,1.3300 + ,1.8700 + ,1.9900 + ,1.7200 + ,2.0000 + ,1.1200 + ,1.3700 + ,1.8700 + ,1.9400 + ,1.5900 + ,2.0900 + ,1.1300 + ,1.3900 + ,1.9000 + ,1.9300 + ,1.6600 + ,2.0400 + ,1.1300 + ,1.4000 + ,2.0100 + ,1.8900 + ,1.5900 + ,2.0900 + ,1.1300 + ,1.4000 + ,2.0500 + ,1.8700 + ,1.6000 + ,2.0900 + ,1.1200 + ,1.4300 + ,2.1600 + ,1.8900 + ,1.5600 + ,2.1300 + ,1.1300 + ,1.5200 + ,2.1800 + ,1.9000 + ,1.6000 + ,2.1300 + ,1.1200 + ,1.5400 + ,2.1500 + ,1.9300 + ,1.6200 + ,2.1700 + ,1.1200 + ,1.8500 + ,2.1200 + ,1.9400 + ,1.6000 + ,2.1300 + ,1.1100 + ,1.8300 + ,2.0400 + ,1.8800 + ,1.6000 + ,2.0000 + ,1.1100 + ,1.2900 + ,2.0400 + ,1.8900 + ,1.6800 + ,2.0500 + ,1.1100 + ,1.2000 + ,2.0600 + ,1.9200 + ,1.7700 + ,2.0800 + ,1.1100 + ,1.2000 + ,1.9300 + ,1.9100 + ,1.7500 + ,2.0700 + ,1.1400 + ,1.2100 + ,1.8600 + ,1.8900 + ,1.7600 + ,2.1200 + ,1.1500 + ,1.2100 + ,1.9400 + ,1.8900 + ,1.8900 + ,2.1300 + ,1.1500 + ,1.1900 + ,2.3500 + ,1.9800 + ,1.8800 + ,2.1600 + ,1.1600 + ,1.1800 + ,2.4600 + ,2.0200 + ,1.9000 + ,2.2500 + ,1.1500 + ,1.1700 + ,2.5900 + ,2.0200 + ,1.9100 + ,2.2600 + ,1.1600 + ,1.2200 + ,2.6600 + ,1.9900 + ,1.9100 + ,2.3900 + ,1.1300 + ,1.2500 + ,2.4100 + ,1.9700 + ,1.8400 + ,2.3600 + ,1.1300 + ,1.3000 + ,2.1800 + ,1.9600 + ,1.6900 + ,2.2600 + ,1.1200 + ,1.3300 + ,2.1300 + ,1.9500 + ,1.6100 + ,2.2600 + ,1.1200 + ,1.1800 + ,2.1100 + ,1.9800 + ,1.6700 + ,2.2700 + ,1.1100 + ,1.1800 + ,2.1200 + ,2.0000 + ,1.8400 + ,2.2900 + ,1.1100 + ,1.1900 + ,2.1600 + ,2.0000 + ,1.8400 + ,2.2100) + ,dim=c(6 + ,72) + ,dimnames=list(c('Vruchtesappen' + ,'Jonagold' + ,'Sinaasappelen' + ,'Citroenen' + ,'Pompelmoezen' + ,'Bananen') + ,1:72)) > y <- array(NA,dim=c(6,72),dimnames=list(c('Vruchtesappen','Jonagold','Sinaasappelen','Citroenen','Pompelmoezen','Bananen'),1:72)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par1 = 'kendall' > main = 'Correlation Matrix' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Patrick Wessa > #To cite this work: Patrick Wessa, (2010), Multivariate Correlation Matrix (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Patrick.Wessa/rwasp_pairs.wasp#output/ > #Source of accompanying publication: > #Technical 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=par1) + 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/15fq91292337908.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") > > n <- length(y[,1]) > n [1] 6 > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,paste('Correlations for all pairs of data series (method=',par1,')',sep=''),n+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,' ',header=TRUE) > for (i in 1:n) { + a<-table.element(a,dimnames(t(x))[[2]][i],header=TRUE) + } > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,dimnames(t(x))[[2]][i],header=TRUE) + for (j in 1:n) { + r <- cor.test(y[i,],y[j,],method=par1) + a<-table.element(a,round(r$estimate,3)) + } + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/2qyox1292337908.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Correlations for all pairs of data series with p-values',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'pair',1,TRUE) > a<-table.element(a,'Pearson r',1,TRUE) > a<-table.element(a,'Spearman rho',1,TRUE) > a<-table.element(a,'Kendall tau',1,TRUE) > a<-table.row.end(a) > cor.test(y[1,],y[2,],method=par1) Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 2.1569, p-value = 0.03101 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.1865897 > for (i in 1:(n-1)) + { + for (j in (i+1):n) + { + a<-table.row.start(a) + dum <- paste(dimnames(t(x))[[2]][i],';',dimnames(t(x))[[2]][j],sep='') + a<-table.element(a,dum,header=TRUE) + rp <- cor.test(y[i,],y[j,],method='pearson') + a<-table.element(a,round(rp$estimate,4)) + rs <- cor.test(y[i,],y[j,],method='spearman') + a<-table.element(a,round(rs$estimate,4)) + rk <- cor.test(y[i,],y[j,],method='kendall') + a<-table.element(a,round(rk$estimate,4)) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-value',header=T) + a<-table.element(a,paste('(',round(rp$p.value,4),')',sep='')) + a<-table.element(a,paste('(',round(rs$p.value,4),')',sep='')) + a<-table.element(a,paste('(',round(rk$p.value,4),')',sep='')) + a<-table.row.end(a) + } + } There were 15 warnings (use warnings() to see them) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/348m51292337908.tab") > > try(system("convert tmp/15fq91292337908.ps tmp/15fq91292337908.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.769 0.294 1.664