R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(68 + ,13 + ,13 + ,20 + ,17 + ,26 + ,27 + ,28 + ,1 + ,0 + ,0 + ,0 + ,114 + ,37 + ,37 + ,40 + ,95 + ,47 + ,39 + ,60 + ,148 + ,80 + ,99 + ,60 + ,56 + ,21 + ,21 + ,44 + ,26 + ,36 + ,33 + ,52 + ,63 + ,35 + ,36 + ,60 + ,96 + ,40 + ,44 + ,52 + ,74 + ,35 + ,33 + ,24 + ,65 + ,46 + ,47 + ,64 + ,40 + ,20 + ,19 + ,26 + ,173 + ,24 + ,41 + ,48 + ,28 + ,19 + ,22 + ,36 + ,55 + ,15 + ,17 + ,40 + ,58 + ,48 + ,46 + ,64 + ,25 + ,0 + ,0 + ,20 + ,103 + ,38 + ,31 + ,79 + ,29 + ,12 + ,20 + ,16 + ,31 + ,10 + ,10 + ,52 + ,43 + ,51 + ,55 + ,52 + ,74 + ,4 + ,6 + ,44 + ,99 + ,24 + ,17 + ,29 + ,25 + ,39 + ,33 + ,40 + ,69 + ,19 + ,33 + ,28 + ,62 + ,23 + ,32 + ,49 + ,25 + ,39 + ,37 + ,60 + ,38 + ,37 + ,44 + ,52 + ,57 + ,20 + ,22 + ,28 + ,52 + ,20 + ,15 + ,56 + ,91 + ,41 + ,18 + ,35 + ,48 + ,26 + ,25 + ,12 + ,52 + ,0 + ,7 + ,32 + ,35 + ,31 + ,35 + ,48 + ,0 + ,0 + ,0 + ,0 + ,31 + ,8 + ,14 + ,48 + ,107 + ,35 + ,31 + ,31 + ,242 + ,3 + ,9 + ,64 + ,41 + ,47 + ,59 + ,72 + ,57 + ,42 + ,62 + ,36 + ,32 + ,11 + ,12 + ,56 + ,17 + ,10 + ,23 + ,28 + ,36 + ,26 + ,31 + ,52 + ,29 + ,27 + ,57 + ,44 + ,22 + ,0 + ,23 + ,44 + ,21 + ,15 + ,14 + ,55 + ,41 + ,32 + ,31 + ,36 + ,64 + ,13 + ,17 + ,48 + ,71 + ,24 + ,24 + ,44 + ,28 + ,10 + ,11 + ,66 + ,36 + ,14 + ,16 + ,40 + ,45 + ,24 + ,32 + ,44 + ,22 + ,29 + ,36 + ,48 + ,27 + ,40 + ,37 + ,68 + ,38 + ,22 + ,25 + ,24 + ,26 + ,27 + ,30 + ,32 + ,41 + ,8 + ,10 + ,44 + ,21 + ,27 + ,16 + ,52 + ,28 + ,0 + ,3 + ,56 + ,36 + ,0 + ,0 + ,68 + ,58 + ,17 + ,17 + ,32 + ,65 + ,7 + ,9 + ,34 + ,29 + ,18 + ,22 + ,36 + ,21 + ,7 + ,5 + ,34 + ,19 + ,24 + ,23 + ,56 + ,55 + ,18 + ,16 + ,64 + ,119 + ,39 + ,53 + ,52 + ,34 + ,17 + ,23 + ,48 + ,25 + ,0 + ,0 + ,40 + ,113 + ,39 + ,51 + ,36 + ,46 + ,20 + ,25 + ,10 + ,28 + ,29 + ,51 + ,48 + ,63 + ,27 + ,46 + ,25 + ,52 + ,23 + ,16 + ,68 + ,35 + ,0 + ,0 + ,36 + ,32 + ,31 + ,25 + ,32 + ,45 + ,19 + ,34 + ,36 + ,42 + ,12 + ,14 + ,43 + ,28 + ,23 + ,32 + ,17 + ,32 + ,33 + ,24 + ,52 + ,32 + ,21 + ,16 + ,56 + ,27 + ,17 + ,19 + ,40 + ,69 + ,27 + ,27 + ,48 + ,30 + ,14 + ,24 + ,40 + ,48 + ,12 + ,12 + ,48 + ,57 + ,21 + ,43 + ,68 + ,36 + ,14 + ,13 + ,44 + ,20 + ,14 + ,19 + ,40 + ,54 + ,22 + ,24 + ,40 + ,26 + ,25 + ,27 + ,28 + ,58 + ,36 + ,26 + ,40 + ,35 + ,10 + ,14 + ,44 + ,28 + ,16 + ,26 + ,20 + ,8 + ,12 + ,15 + ,22 + ,96 + ,20 + ,30 + ,56 + ,50 + ,38 + ,33 + ,52 + ,15 + ,13 + ,14 + ,2 + ,65 + ,12 + ,11 + ,52 + ,33 + ,11 + ,12 + ,30 + ,7 + ,8 + ,8 + ,3 + ,17 + ,22 + ,22 + ,20 + ,55 + ,14 + ,12 + ,48 + ,32 + ,7 + ,6 + ,32 + ,22 + ,14 + ,10 + ,36 + ,41 + ,2 + ,1 + ,45 + ,50 + ,35 + ,31 + ,40 + ,7 + ,5 + ,5 + ,8 + ,0 + ,0 + ,0 + ,0 + ,26 + ,34 + ,35 + ,32 + ,22 + ,12 + ,15 + ,28 + ,26 + ,34 + ,36 + ,44 + ,37 + ,30 + ,27 + ,56 + ,29 + ,21 + ,36 + ,13 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,42 + ,28 + ,29 + ,52 + ,51 + ,16 + ,19 + ,51 + ,77 + ,12 + ,16 + ,52 + ,32 + ,14 + ,15 + ,48 + ,63 + ,7 + ,1 + ,3 + ,50 + ,41 + ,36 + ,48 + ,18 + ,21 + ,22 + ,24 + ,37 + ,28 + ,16 + ,37 + ,23 + ,1 + ,1 + ,32 + ,19 + ,10 + ,10 + ,8 + ,39 + ,31 + ,31 + ,44 + ,38 + ,7 + ,22 + ,48 + ,55 + ,26 + ,22 + ,56 + ,22 + ,1 + ,0 + ,8 + ,7 + ,0 + ,0 + ,0 + ,21 + ,12 + ,10 + ,25 + ,5 + ,0 + ,0 + ,4 + ,21 + ,17 + ,9 + ,12 + ,1 + ,5 + ,0 + ,0 + ,22 + ,4 + ,0 + ,6 + ,0 + ,0 + ,0 + ,0 + ,31 + ,6 + ,7 + ,48 + ,25 + ,0 + ,2 + ,52 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,0 + ,0 + ,20 + ,15 + ,16 + ,12 + ,29 + ,0 + ,25 + ,28 + ,33 + ,12 + ,6 + ,40) + ,dim=c(4 + ,144) + ,dimnames=list(c('CompendiumViews' + ,'BloggedComputations' + ,'Hyperlinks' + ,'submittedfeedback') + ,1:144)) > y <- array(NA,dim=c(4,144),dimnames=list(c('CompendiumViews','BloggedComputations','Hyperlinks','submittedfeedback'),1:144)) > 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/rcomp/tmp/10sdg1322150895.ps",horizontal=F,onefile=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > n <- length(y[,1]) > n [1] 4 > 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/rcomp/tmp/2pze71322150895.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 = 5.3762, df = 142, p-value = 3.050e-07 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.2655300 0.5385891 sample estimates: cor 0.4112439 > 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 > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/3hntc1322150895.tab") > > try(system("convert tmp/10sdg1322150895.ps tmp/10sdg1322150895.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.090 0.040 1.131