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(300 + ,2.26 + ,591.000 + ,302 + ,2.57 + ,589.000 + ,400 + ,3.07 + ,584.000 + ,392 + ,2.76 + ,573.000 + ,373 + ,2.51 + ,567.000 + ,379 + ,2.87 + ,569.000 + ,303 + ,3.14 + ,621.000 + ,324 + ,3.11 + ,629.000 + ,353 + ,3.16 + ,628.000 + ,392 + ,2.47 + ,612.000 + ,327 + ,2.57 + ,595.000 + ,376 + ,2.89 + ,597.000 + ,329 + ,2.63 + ,593.000 + ,359 + ,2.38 + ,590.000 + ,413 + ,1.69 + ,580.000 + ,338 + ,1.96 + ,574.000 + ,422 + ,2.19 + ,573.000 + ,390 + ,1.87 + ,573.000 + ,370 + ,1.60 + ,620.000 + ,367 + ,1.63 + ,626.000 + ,406 + ,1.22 + ,620.000 + ,418 + ,1.21 + ,588.000 + ,346 + ,1.49 + ,566.000 + ,350 + ,1.64 + ,557.000 + ,330 + ,1.66 + ,561.000 + ,318 + ,1.77 + ,549.000 + ,382 + ,1.82 + ,532.000 + ,337 + ,1.78 + ,526.000 + ,372 + ,1.28 + ,511.000 + ,422 + ,1.29 + ,499.000 + ,428 + ,1.37 + ,555.000 + ,426 + ,1.12 + ,565.000 + ,396 + ,1.51 + ,542.000 + ,458 + ,2.24 + ,527.000 + ,315 + ,2.94 + ,510.000 + ,337 + ,3.09 + ,514.000 + ,386 + ,3.46 + ,517.000 + ,352 + ,3.64 + ,508.000 + ,383 + ,4.39 + ,493.000 + ,439 + ,4.15 + ,490.000 + ,397 + ,5.21 + ,469.000 + ,453 + ,5.80 + ,478.000 + ,363 + ,5.91 + ,528.000 + ,365 + ,5.39 + ,534.000 + ,474 + ,5.46 + ,518.000 + ,373 + ,4.72 + ,506.000 + ,403 + ,3.14 + ,502.000 + ,384 + ,2.63 + ,516.000 + ,364 + ,2.32 + ,528.000 + ,361 + ,1.93 + ,533.000 + ,419 + ,0.62 + ,536.000 + ,352 + ,0.60 + ,537.000 + ,363 + ,-0.37 + ,524.000 + ,410 + ,-1.10 + ,536.000 + ,361 + ,-1.68 + ,587.000 + ,383 + ,-0.78 + ,597.000 + ,342 + ,-1.19 + ,581.000 + ,369 + ,-0.79 + ,564.000 + ,361 + ,-0.12 + ,558.000 + ,317 + ,0.26 + ,575.000 + ,386 + ,0.62 + ,580.000 + ,318 + ,0.70 + ,575.000 + ,407 + ,1.66 + ,563.000 + ,393 + ,1.80 + ,552.000 + ,404 + ,2.27 + ,537.000 + ,498 + ,2.46 + ,545.000 + ,438 + ,2.57 + ,601.000) + ,dim=c(3 + ,67) + ,dimnames=list(c('Bouwvergunningen' + ,'Inflatie' + ,'Werklozen') + ,1:67)) > y <- array(NA,dim=c(3,67),dimnames=list(c('Bouwvergunningen','Inflatie','Werklozen'),1:67)) > 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/html/rcomp/tmp/1yfik1292940237.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] 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/html/rcomp/tmp/2nyin1292940238.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 = 0.1949, p-value = 0.8455 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.01635250 > 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/html/rcomp/tmp/3qhgb1292940238.tab") > > try(system("convert tmp/1yfik1292940237.ps tmp/1yfik1292940237.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.479 0.212 1.075