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(216234 + ,627 + ,1.59 + ,213586 + ,696 + ,1.26 + ,209465 + ,825 + ,1.13 + ,204045 + ,677 + ,1.92 + ,200237 + ,656 + ,2.61 + ,203666 + ,785 + ,2.26 + ,241476 + ,412 + ,2.41 + ,260307 + ,352 + ,2.26 + ,243324 + ,839 + ,2.03 + ,244460 + ,729 + ,2.86 + ,233575 + ,696 + ,2.55 + ,237217 + ,641 + ,2.27 + ,235243 + ,695 + ,2.26 + ,230354 + ,638 + ,2.57 + ,227184 + ,762 + ,3.07 + ,221678 + ,635 + ,2.76 + ,217142 + ,721 + ,2.51 + ,219452 + ,854 + ,2.87 + ,256446 + ,418 + ,3.14 + ,265845 + ,367 + ,3.11 + ,248624 + ,824 + ,3.16 + ,241114 + ,687 + ,2.47 + ,229245 + ,601 + ,2.57 + ,231805 + ,676 + ,2.89 + ,219277 + ,740 + ,2.63 + ,219313 + ,691 + ,2.38 + ,212610 + ,683 + ,1.69 + ,214771 + ,594 + ,1.96 + ,211142 + ,729 + ,2.19 + ,211457 + ,731 + ,1.87 + ,240048 + ,386 + ,1.6 + ,240636 + ,331 + ,1.63 + ,230580 + ,707 + ,1.22 + ,208795 + ,715 + ,1.21 + ,197922 + ,657 + ,1.49 + ,194596 + ,653 + ,1.64 + ,194581 + ,642 + ,1.66 + ,185686 + ,643 + ,1.77 + ,178106 + ,718 + ,1.82 + ,172608 + ,654 + ,1.78 + ,167302 + ,632 + ,1.28 + ,168053 + ,731 + ,1.29 + ,202300 + ,392 + ,1.37 + ,202388 + ,344 + ,1.12 + ,182516 + ,792 + ,1.51 + ,173476 + ,852 + ,2.24 + ,166444 + ,649 + ,2.94 + ,171297 + ,629 + ,3.09 + ,169701 + ,685 + ,3.46 + ,164182 + ,617 + ,3.64 + ,161914 + ,715 + ,4.39 + ,159612 + ,715 + ,4.15 + ,151001 + ,629 + ,5.21 + ,158114 + ,916 + ,5.8 + ,186530 + ,531 + ,5.91 + ,187069 + ,357 + ,5.39 + ,174330 + ,917 + ,5.46 + ,169362 + ,828 + ,4.72 + ,166827 + ,708 + ,3.14 + ,178037 + ,858 + ,2.63 + ,186413 + ,775 + ,2.32 + ,189226 + ,785 + ,1.93 + ,191563 + ,1006 + ,0.62 + ,188906 + ,789 + ,0.6 + ,186005 + ,734 + ,-0.37 + ,195309 + ,906 + ,-1.1 + ,223532 + ,532 + ,-1.68 + ,226899 + ,387 + ,-0.78 + ,214126 + ,991 + ,-1.19 + ,206903 + ,841 + ,-0.97 + ,204442 + ,892 + ,-0.12 + ,220375 + ,782 + ,0.26) + ,dim=c(3 + ,72) + ,dimnames=list(c('Werklozen' + ,'Faillissementen' + ,'Inflatie') + ,1:72)) > y <- array(NA,dim=c(3,72),dimnames=list(c('Werklozen','Faillissementen','Inflatie'),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: 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/1qslq1292943177.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] 3 > 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/2m21h1292943177.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 = -1.9641, p-value = 0.04951 alternative hypothesis: true tau is not equal to 0 sample estimates: tau -0.1583074 > 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 > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/372zn1292943177.tab") > > try(system("convert tmp/1qslq1292943177.ps tmp/1qslq1292943177.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.550 0.230 0.753