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(9506 + ,1775 + ,8704 + ,2197 + ,10079 + ,2920 + ,8993 + ,4240 + ,9957 + ,5415 + ,10240 + ,6136 + ,10098 + ,6719 + ,10090 + ,6234 + ,9867 + ,7152 + ,9736 + ,3646 + ,9040 + ,2165 + ,9232 + ,2803 + ,9520 + ,1615 + ,9217 + ,2350 + ,9868 + ,3350 + ,9455 + ,3536 + ,9984 + ,5834 + ,9556 + ,6767 + ,10190 + ,5993 + ,9906 + ,7276 + ,9824 + ,5641 + ,9972 + ,3477 + ,9185 + ,2247 + ,9765 + ,2466 + ,9838 + ,1567 + ,9084 + ,2237 + ,9643 + ,2598 + ,10051 + ,3729 + ,9987 + ,5715 + ,9827 + ,5776 + ,10491 + ,5852 + ,9722 + ,6878 + ,9472 + ,5488 + ,9728 + ,3583 + ,8510 + ,2054 + ,9511 + ,2282 + ,9492 + ,1552 + ,8638 + ,2261 + ,9792 + ,2446 + ,9605 + ,3519 + ,9237 + ,5161 + ,9533 + ,5085 + ,10293 + ,5711 + ,9938 + ,6057 + ,9984 + ,5224 + ,9563 + ,3363 + ,8871 + ,1899 + ,9301 + ,2115 + ,9215 + ,1491 + ,8834 + ,2061 + ,9998 + ,2419 + ,9604 + ,3430 + ,9507 + ,4778 + ,9718 + ,4862 + ,10095 + ,6176 + ,9583 + ,5664 + ,9883 + ,5529 + ,9365 + ,3418 + ,8919 + ,1941 + ,9449 + ,2402 + ,9769 + ,1579 + ,9321 + ,2146 + ,9939 + ,2462 + ,9336 + ,3695 + ,10195 + ,4831 + ,9464 + ,5134 + ,10010 + ,6250 + ,10213 + ,5760 + ,9563 + ,6249 + ,9890 + ,2917 + ,9305 + ,1741 + ,9391 + ,2359 + ,9743 + ,1511 + ,8587 + ,2059 + ,9731 + ,2635 + ,9563 + ,2867 + ,9998 + ,4403 + ,9437 + ,5720 + ,10038 + ,4502 + ,9918 + ,5749 + ,9252 + ,5627 + ,9737 + ,2846 + ,9035 + ,1762 + ,9133 + ,2429 + ,9487 + ,1169 + ,8700 + ,2154 + ,9627 + ,2249 + ,8947 + ,2687 + ,9283 + ,4359 + ,8829 + ,5382 + ,9947 + ,4459 + ,9628 + ,6398 + ,9318 + ,4596 + ,9605 + ,3024 + ,8640 + ,1887 + ,9214 + ,2070 + ,9676 + ,1351 + ,8642 + ,2218 + ,9402 + ,2461 + ,9610 + ,3028 + ,9294 + ,4784 + ,9448 + ,4975 + ,10319 + ,4607 + ,9548 + ,6249 + ,9801 + ,4809 + ,9596 + ,3157 + ,8923 + ,1910 + ,9746 + ,2228 + ,9829 + ,1594 + ,9125 + ,2467 + ,9782 + ,2222 + ,9441 + ,3607 + ,9162 + ,4685 + ,9915 + ,4962 + ,10444 + ,5770 + ,10209 + ,5480 + ,9985 + ,5000 + ,9842 + ,3228 + ,9429 + ,1993 + ,10132 + ,2288 + ,9849 + ,1588 + ,9172 + ,2105 + ,10313 + ,2191 + ,9819 + ,3591 + ,9955 + ,4668 + ,10048 + ,4885 + ,10082 + ,5822 + ,10541 + ,5599 + ,10208 + ,5340 + ,10233 + ,3082 + ,9439 + ,2010 + ,9963 + ,2301) + ,dim=c(2 + ,132) + ,dimnames=list(c('births' + ,'marriages') + ,1:132)) > y <- array(NA,dim=c(2,132),dimnames=list(c('births','marriages'),1:132)) > 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: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #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/1ohfn1293210426.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] 2 > 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/29iea1293210426.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 = 6.0997, df = 130, p-value = 1.134e-08 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.3272224 0.5946600 sample estimates: cor 0.4717195 > 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 message: 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/3n9cj1293210426.tab") > > try(system("convert tmp/1ohfn1293210426.ps tmp/1ohfn1293210426.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.446 0.202 0.989