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(1606 + ,6 + ,3.74 + ,16 + ,1391 + ,1634 + ,6.81 + ,4.17 + ,29 + ,1621 + ,2013 + ,9.75 + ,4.84 + ,22 + ,1837 + ,1654 + ,6.96 + ,4.21 + ,30 + ,2132 + ,1003 + ,3.94 + ,3.93 + ,20 + ,1489 + ,1029 + ,5 + ,4.9 + ,39 + ,1817 + ,1052 + ,4.9 + ,4.7 + ,18 + ,1586 + ,1653 + ,5.7 + ,3.5 + ,9.6 + ,1565 + ,1918 + ,6.5 + ,3.4 + ,10.2 + ,1787 + ,1926 + ,7.1 + ,3.7 + ,20.2 + ,1804 + ,1862 + ,7.5 + ,4 + ,50 + ,1763 + ,1816 + ,7.8 + ,4.3 + ,120 + ,1675 + ,1712 + ,7 + ,4.1 + ,19.8 + ,1575 + ,1646 + ,7.4 + ,4.5 + ,18 + ,1524 + ,1555 + ,8.55 + ,5.5 + ,3 + ,1686 + ,1402 + ,7.43 + ,5.3 + ,11 + ,1800 + ,1047 + ,4.7 + ,4.5 + ,15 + ,1442 + ,891 + ,4.7 + ,5.3 + ,27 + ,1345 + ,940 + ,5.3 + ,5.6 + ,28 + ,1500 + ,1372 + ,6.2 + ,4.5 + ,14 + ,1556 + ,2012 + ,7.4 + ,3.7 + ,5.6 + ,2012 + ,1879 + ,7.5 + ,4 + ,6.5 + ,1618 + ,1667 + ,7.32 + ,4.4 + ,8.5 + ,1487 + ,1856 + ,8.15 + ,4.4 + ,87.9 + ,1607 + ,1771 + ,7.24 + ,4.1 + ,5.8 + ,1308 + ,1721 + ,7.4 + ,4.3 + ,25.2 + ,1429 + ,1773 + ,9.4 + ,5.3 + ,7.5 + ,1596 + ,1507 + ,8.9 + ,5.9 + ,13.7 + ,1884 + ,1033 + ,4.5 + ,4.4 + ,34 + ,1262 + ,1011 + ,4.9 + ,4.9 + ,17 + ,1283 + ,1111 + ,5.6 + ,5.1 + ,9 + ,1346 + ,1736 + ,6.4 + ,3.7 + ,9.2 + ,1505 + ,1865 + ,6 + ,3.2 + ,5 + ,1151 + ,2078 + ,6.9 + ,3.3 + ,24 + ,1600 + ,1947 + ,6.7 + ,3.5 + ,40 + ,1420 + ,1428 + ,5.4 + ,3.8 + ,86.5 + ,1073 + ,1500 + ,5.6 + ,3.8 + ,0.54 + ,1076 + ,1950 + ,6.9 + ,3.5 + ,14 + ,1510 + ,1591 + ,6.9 + ,4.3 + ,4.8 + ,1345 + ,1613 + ,7 + ,4.3 + ,28 + ,1631 + ,1077 + ,4 + ,3.7 + ,16 + ,1135 + ,880 + ,3.7 + ,4.2 + ,5.8 + ,1009 + ,1128 + ,4.9 + ,4.3 + ,16 + ,1155 + ,1320 + ,5 + ,3.8 + ,9.1 + ,1184 + ,1692 + ,5.7 + ,3.4 + ,6 + ,1285 + ,1575 + ,6.1 + ,3.9 + ,17 + ,1257 + ,1478 + ,5.3 + ,3.6 + ,26 + ,1131 + ,1500 + ,5.5 + ,3.6 + ,99.6 + ,1274 + ,1368 + ,5.7 + ,4.2 + ,41 + ,235 + ,1563 + ,5.21 + ,3.3 + ,72 + ,1299 + ,1424 + ,5.4 + ,3.8 + ,23 + ,1460 + ,1274 + ,4.5 + ,3.5 + ,42 + ,1455 + ,1047 + ,3.7 + ,3.7 + ,40 + ,1113 + ,1049 + ,4.1 + ,3.9 + ,18 + ,1263 + ,1069 + ,4.8 + ,4.5 + ,45 + ,1401 + ,981 + ,4.1 + ,4.2 + ,18 + ,1135 + ,1540 + ,5 + ,3.2 + ,2 + ,1137 + ,1559 + ,5.2 + ,3.3 + ,10 + ,1140 + ,1459 + ,5.5 + ,3.8 + ,13.6 + ,1014 + ,1559 + ,5.9 + ,3.8 + ,160 + ,1220) + ,dim=c(5 + ,60) + ,dimnames=list(c('aanvoer' + ,'aanvoerwaarde' + ,'prijzen' + ,'interventie' + ,'visserijen') + ,1:60)) > y <- array(NA,dim=c(5,60),dimnames=list(c('aanvoer','aanvoerwaarde','prijzen','interventie','visserijen'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par1 = 'pearson' > 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/1dbsa1292346615.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] 5 > 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/2gu9y1292346615.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) Pearson's product-moment correlation data: y[1, ] and y[2, ] t = 9.159, df = 58, p-value = 7.256e-13 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.6399298 0.8557537 sample estimates: cor 0.768911 > 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) + } + } Warning messages: 1: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 2: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 3: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 4: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 5: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 6: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 7: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 8: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 9: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties 10: In cor.test.default(y[i, ], y[j, ], method = "spearman") : Cannot compute exact p-values with ties > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/3ul6p1292346615.tab") > try(system("convert tmp/1dbsa1292346615.ps tmp/1dbsa1292346615.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.569 0.270 1.385