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(6.8 + ,3.0 + ,597141 + ,25 + ,16.5 + ,3.0 + ,593408 + ,24 + ,23.4 + ,2.3 + ,590072 + ,21 + ,32.7 + ,2.7 + ,579799 + ,22 + ,31.3 + ,2.9 + ,574205 + ,20 + ,32.4 + ,2.7 + ,572775 + ,24 + ,21.2 + ,2.6 + ,572942 + ,24 + ,20.7 + ,2.7 + ,619567 + ,24 + ,11.8 + ,2.8 + ,625809 + ,24 + ,14.2 + ,2.9 + ,619916 + ,28 + ,16.1 + ,2.9 + ,587625 + ,27 + ,16.6 + ,2.9 + ,565742 + ,18 + ,16.5 + ,3.0 + ,557274 + ,25 + ,13.7 + ,3.1 + ,560576 + ,27 + ,11.9 + ,2.9 + ,548854 + ,25 + ,11 + ,2.9 + ,531673 + ,28 + ,10.1 + ,2.3 + ,525919 + ,28 + ,11.3 + ,2.3 + ,511038 + ,27 + ,17.9 + ,2.4 + ,498662 + ,25 + ,23 + ,2.2 + ,555362 + ,24 + ,28.6 + ,2.3 + ,564591 + ,24 + ,29.9 + ,2.8 + ,541657 + ,25 + ,32 + ,3.2 + ,527070 + ,18 + ,33.9 + ,3.6 + ,509846 + ,22 + ,39.1 + ,3.8 + ,514258 + ,20 + ,29.8 + ,4.1 + ,516922 + ,23 + ,30 + ,4.9 + ,507561 + ,23 + ,22.8 + ,4.7 + ,492622 + ,19 + ,29.8 + ,5.6 + ,490243 + ,17 + ,26.6 + ,6.1 + ,469357 + ,15 + ,29.2 + ,6.2 + ,477580 + ,13 + ,21.2 + ,5.9 + ,528379 + ,15 + ,18.9 + ,6.1 + ,533590 + ,17 + ,17.3 + ,5.8 + ,517945 + ,9 + ,14.2 + ,4.9 + ,506174 + ,4 + ,9.1 + ,4.5 + ,501866 + ,1 + ,5.5 + ,4.3 + ,516141 + ,6 + ,0.9 + ,3.8 + ,528222 + ,2 + ,1 + ,2.6 + ,532638 + ,2 + ,3.3 + ,2.5 + ,536322 + ,4 + ,3.8 + ,1.7 + ,536535 + ,7 + ,3.9 + ,0.9 + ,523597 + ,8 + ,1.1 + ,0.3 + ,536214 + ,9 + ,4.5 + ,0.8 + ,586570 + ,15 + ,9.6 + ,0.4 + ,596594 + ,15 + ,14.8 + ,0.4 + ,580523 + ,14 + ,16.8 + ,0.7 + ,564478 + ,16 + ,23.5 + ,0.7 + ,557560 + ,11 + ,31.4 + ,0.9 + ,575093 + ,11 + ,34.8 + ,1.1 + ,580112 + ,11 + ,30.5 + ,1.9 + ,574761 + ,13 + ,33.1 + ,2.1 + ,563250 + ,18 + ,37.8 + ,2.6 + ,551531 + ,13 + ,45.1 + ,3.0 + ,537034 + ,17 + ,46.9 + ,3.2 + ,544686 + ,19 + ,44.4 + ,3.1 + ,600991 + ,22 + ,42.4 + ,3.6 + ,604378 + ,22 + ,30.5 + ,3.5 + ,586111 + ,24 + ,28.9 + ,3.5 + ,563668 + ,26 + ,27.1 + ,3.6 + ,548604 + ,24) + ,dim=c(4 + ,60) + ,dimnames=list(c('pers' + ,'infl' + ,'werkloos' + ,'cv') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('pers','infl','werkloos','cv'),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: 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/1m5q41293563132.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/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] 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/html/rcomp/tmp/2qoos1293563132.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 = 1.571, df = 58, p-value = 0.1216 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: -0.05470712 0.43370035 sample estimates: cor 0.202024 > 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/html/rcomp/tmp/34f4j1293563132.tab") > > try(system("convert tmp/1m5q41293563132.ps tmp/1m5q41293563132.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.507 0.220 1.034