R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(631.923 + ,21.454 + ,97.06 + ,130.678 + ,654.294 + ,23.899 + ,97.73 + ,120.877 + ,671.833 + ,24.939 + ,98 + ,137.114 + ,586.840 + ,23.580 + ,97.76 + ,134.406 + ,600.969 + ,24.562 + ,97.48 + ,120.262 + ,625.568 + ,24.696 + ,97.77 + ,130.846 + ,558.110 + ,23.785 + ,97.96 + ,120.343 + ,630.577 + ,23.812 + ,98.22 + ,98.881 + ,628.654 + ,21.917 + ,98.51 + ,115.678 + ,603.184 + ,19.713 + ,98.19 + ,120.796 + ,656.255 + ,19.282 + ,98.37 + ,94.261 + ,600.730 + ,18.788 + ,98.31 + ,89.151 + ,670.326 + ,21.453 + ,98.6 + ,119.880 + ,678.423 + ,24.482 + ,98.96 + ,131.468 + ,641.502 + ,27.474 + ,99.11 + ,155.089 + ,625.311 + ,27.264 + ,99.64 + ,149.581 + ,628.177 + ,27.349 + ,100.02 + ,122.788 + ,589.767 + ,30.632 + ,99.98 + ,143.900 + ,582.471 + ,29.429 + ,100.32 + ,112.115 + ,636.248 + ,30.084 + ,100.44 + ,109.600 + ,599.885 + ,26.290 + ,100.51 + ,117.446 + ,621.694 + ,24.379 + ,101 + ,118.456 + ,637.406 + ,23.335 + ,100.88 + ,101.901 + ,595.994 + ,21.346 + ,100.55 + ,89.940 + ,696.308 + ,21.106 + ,100.82 + ,129.143 + ,674.201 + ,24.514 + ,101.5 + ,126.102 + ,648.861 + ,28.353 + ,102.15 + ,143.048 + ,649.605 + ,30.805 + ,102.39 + ,142.258 + ,672.392 + ,31.348 + ,102.54 + ,131.011 + ,598.396 + ,34.556 + ,102.85 + ,146.471 + ,613.177 + ,33.855 + ,103.47 + ,114.073 + ,638.104 + ,34.787 + ,103.56 + ,114.642 + ,615.632 + ,32.529 + ,103.69 + ,118.226 + ,634.465 + ,29.998 + ,103.49 + ,111.338 + ,638.686 + ,29.257 + ,103.47 + ,108.701 + ,604.243 + ,28.155 + ,103.45 + ,80.512 + ,706.669 + ,30.466 + ,103.48 + ,146.865 + ,677.185 + ,35.704 + ,103.93 + ,137.179 + ,644.328 + ,39.327 + ,103.89 + ,166.536 + ,664.825 + ,39.351 + ,104.4 + ,137.070 + ,605.707 + ,42.234 + ,104.79 + ,127.090 + ,600.136 + ,43.630 + ,104.77 + ,139.966 + ,612.166 + ,43.722 + ,105.13 + ,122.243 + ,599.659 + ,43.121 + ,105.26 + ,109.097 + ,634.210 + ,37.985 + ,104.96 + ,116.591 + ,618.234 + ,37.135 + ,104.75 + ,111.964 + ,613.576 + ,34.646 + ,105.01 + ,109.754 + ,627.200 + ,33.026 + ,105.15 + ,77.609 + ,668.973 + ,35.087 + ,105.2 + ,138.445 + ,651.479 + ,38.846 + ,105.77 + ,127.901 + ,619.661 + ,42.013 + ,105.78 + ,156.615 + ,644.260 + ,43.908 + ,106.26 + ,133.264 + ,579.936 + ,42.868 + ,106.13 + ,143.521 + ,601.752 + ,44.423 + ,106.12 + ,152.139 + ,595.376 + ,44.167 + ,106.57 + ,131.523 + ,588.902 + ,43.636 + ,106.44 + ,113.925 + ,634.341 + ,44.382 + ,106.54 + ,86.495 + ,594.305 + ,42.142 + ,107.1 + ,127.877 + ,606.200 + ,43.452 + ,108.1 + ,107.017 + ,610.926 + ,36.912 + ,108.4 + ,78.716 + ,633.685 + ,42.413 + ,108.84 + ,138.278 + ,639.696 + ,45.344 + ,109.62 + ,144.238 + ,659.451 + ,44.873 + ,110.42 + ,143.679 + ,593.248 + ,47.510 + ,110.67 + ,159.932 + ,606.677 + ,49.554 + ,111.66 + ,136.781 + ,599.434 + ,47.369 + ,112.28 + ,148.173 + ,569.578 + ,45.998 + ,112.87 + ,125.673 + ,629.873 + ,48.140 + ,112.18 + ,105.573 + ,613.438 + ,48.441 + ,112.36 + ,122.405 + ,604.172 + ,44.928 + ,112.16 + ,128.045 + ,658.328 + ,40.454 + ,111.49 + ,94.467 + ,612.633 + ,38.661 + ,111.25 + ,85.573 + ,707.372 + ,37.246 + ,111.36 + ,121.501 + ,739.770 + ,36.843 + ,111.74 + ,125.074 + ,777.535 + ,36.424 + ,111.1 + ,144.979 + ,685.030 + ,37.594 + ,111.33 + ,142.120 + ,730.234 + ,38.144 + ,111.25 + ,124.213 + ,714.154 + ,38.737 + ,111.04 + ,144.407 + ,630.872 + ,34.560 + ,110.97 + ,125.170 + ,719.492 + ,36.080 + ,111.31 + ,109.267 + ,677.023 + ,33.508 + ,111.02 + ,122.354 + ,679.272 + ,35.462 + ,111.07 + ,122.589 + ,718.317 + ,33.374 + ,111.36 + ,104.982 + ,645.672 + ,32.110 + ,111.54 + ,90.542) + ,dim=c(4 + ,84) + ,dimnames=list(c('werkloosheid' + ,'vacatures' + ,'consumentprijsindex' + ,'inschrijvingen') + ,1:84)) > y <- array(NA,dim=c(4,84),dimnames=list(c('werkloosheid','vacatures','consumentprijsindex','inschrijvingen'),1:84)) > 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' > 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/wessaorg/rcomp/tmp/1glac1355227342.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/279a21355227342.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.2285, p-value = 0.2193 alternative hypothesis: true tau is not equal to 0 sample estimates: tau -0.09122203 > 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/wessaorg/rcomp/tmp/3lrt91355227342.tab") > > try(system("convert tmp/1glac1355227342.ps tmp/1glac1355227342.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.918 0.254 2.186