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(493 + ,116 + ,377 + ,7.4 + ,9.1 + ,9 + ,481 + ,111 + ,370 + ,7.2 + ,9.1 + ,9 + ,462 + ,104 + ,358 + ,7 + ,9 + ,9 + ,457 + ,100 + ,357 + ,7 + ,8.9 + ,8.9 + ,442 + ,93 + ,349 + ,6.8 + ,8.8 + ,8.9 + ,439 + ,91 + ,348 + ,6.8 + ,8.7 + ,8.8 + ,488 + ,119 + ,369 + ,6.7 + ,8.7 + ,8.8 + ,521 + ,139 + ,381 + ,6.7 + ,8.6 + ,8.7 + ,501 + ,134 + ,368 + ,6.7 + ,8.5 + ,8.7 + ,485 + ,124 + ,361 + ,6.8 + ,8.4 + ,8.6 + ,464 + ,113 + ,351 + ,6.7 + ,8.4 + ,8.6 + ,460 + ,109 + ,351 + ,6.6 + ,8.3 + ,8.5 + ,467 + ,109 + ,358 + ,6.4 + ,8.2 + ,8.5 + ,460 + ,106 + ,354 + ,6.3 + ,8.2 + ,8.5 + ,448 + ,101 + ,347 + ,6.3 + ,8.1 + ,8.5 + ,443 + ,98 + ,345 + ,6.5 + ,8.1 + ,8.5 + ,436 + ,93 + ,343 + ,6.5 + ,8.1 + ,8.5 + ,431 + ,91 + ,340 + ,6.4 + ,8.1 + ,8.5 + ,484 + ,122 + ,362 + ,6.2 + ,8.1 + ,8.5 + ,510 + ,139 + ,370 + ,6.2 + ,8.1 + ,8.6 + ,513 + ,140 + ,373 + ,6.5 + ,8.1 + ,8.6 + ,503 + ,132 + ,371 + ,7 + ,8.2 + ,8.6 + ,471 + ,117 + ,354 + ,7.2 + ,8.2 + ,8.7 + ,471 + ,114 + ,357 + ,7.3 + ,8.3 + ,8.7 + ,476 + ,113 + ,363 + ,7.4 + ,8.2 + ,8.7 + ,475 + ,110 + ,364 + ,7.4 + ,8.3 + ,8.8 + ,470 + ,107 + ,363 + ,7.4 + ,8.3 + ,8.8 + ,461 + ,103 + ,358 + ,7.3 + ,8.4 + ,8.9 + ,455 + ,98 + ,357 + ,7.4 + ,8.5 + ,8.9 + ,456 + ,98 + ,357 + ,7.4 + ,8.5 + ,8.9 + ,517 + ,137 + ,380 + ,7.6 + ,8.6 + ,9 + ,525 + ,148 + ,378 + ,7.6 + ,8.6 + ,9 + ,523 + ,147 + ,376 + ,7.7 + ,8.7 + ,9 + ,519 + ,139 + ,380 + ,7.7 + ,8.7 + ,9 + ,509 + ,130 + ,379 + ,7.8 + ,8.8 + ,9 + ,512 + ,128 + ,384 + ,7.8 + ,8.8 + ,9 + ,519 + ,127 + ,392 + ,8 + ,8.9 + ,9.1 + ,517 + ,123 + ,394 + ,8.1 + ,9 + ,9.1 + ,510 + ,118 + ,392 + ,8.1 + ,9 + ,9.1 + ,509 + ,114 + ,396 + ,8.2 + ,9 + ,9.1 + ,501 + ,108 + ,392 + ,8.1 + ,9 + ,9.1 + ,507 + ,111 + ,396 + ,8.1 + ,9.1 + ,9.1 + ,569 + ,151 + ,419 + ,8.1 + ,9.1 + ,9.1 + ,580 + ,159 + ,421 + ,8.1 + ,9 + ,9.1 + ,578 + ,158 + ,420 + ,8.2 + ,9.1 + ,9.1 + ,565 + ,148 + ,418 + ,8.2 + ,9 + ,9.1 + ,547 + ,138 + ,410 + ,8.3 + ,9.1 + ,9.1 + ,555 + ,137 + ,418 + ,8.4 + ,9.1 + ,9.2 + ,562 + ,136 + ,426 + ,8.6 + ,9.2 + ,9.3 + ,561 + ,133 + ,428 + ,8.6 + ,9.2 + ,9.3 + ,555 + ,126 + ,430 + ,8.4 + ,9.2 + ,9.3 + ,544 + ,120 + ,424 + ,8 + ,9.2 + ,9.2 + ,537 + ,114 + ,423 + ,7.9 + ,9.2 + ,9.2 + ,543 + ,116 + ,427 + ,8.1 + ,9.3 + ,9.2 + ,594 + ,153 + ,441 + ,8.5 + ,9.3 + ,9.2 + ,611 + ,162 + ,449 + ,8.8 + ,9.3 + ,9.2 + ,613 + ,161 + ,452 + ,8.8 + ,9.3 + ,9.2 + ,611 + ,149 + ,462 + ,8.5 + ,9.3 + ,9.2 + ,594 + ,139 + ,455 + ,8.3 + ,9.4 + ,9.2 + ,595 + ,135 + ,461 + ,8.3 + ,9.4 + ,9.2 + ,591 + ,130 + ,461 + ,8.3 + ,9.3 + ,9.2 + ,589 + ,127 + ,463 + ,8.4 + ,9.3 + ,9.2 + ,584 + ,122 + ,462 + ,8.5 + ,9.3 + ,9.2 + ,573 + ,117 + ,456 + ,8.5 + ,9.3 + ,9.2 + ,567 + ,112 + ,455 + ,8.6 + ,9.2 + ,9.1 + ,569 + ,113 + ,456 + ,8.5 + ,9.2 + ,9.1 + ,621 + ,149 + ,472 + ,8.6 + ,9.2 + ,9 + ,629 + ,157 + ,472 + ,8.6 + ,9.1 + ,8.9 + ,628 + ,157 + ,471 + ,8.6 + ,9.1 + ,8.9 + ,612 + ,147 + ,465 + ,8.5 + ,9.1 + ,9 + ,595 + ,137 + ,459 + ,8.4 + ,9.1 + ,8.9 + ,597 + ,132 + ,465 + ,8.4 + ,9 + ,8.8 + ,593 + ,125 + ,468 + ,8.5 + ,8.9 + ,8.7 + ,590 + ,123 + ,467 + ,8.5 + ,8.8 + ,8.6 + ,580 + ,117 + ,463 + ,8.5 + ,8.7 + ,8.5 + ,574 + ,114 + ,460 + ,8.6 + ,8.6 + ,8.5 + ,573 + ,111 + ,462 + ,8.6 + ,8.6 + ,8.4 + ,573 + ,112 + ,461 + ,8.4 + ,8.5 + ,8.3 + ,620 + ,144 + ,476 + ,8.2 + ,8.4 + ,8.2 + ,626 + ,150 + ,476 + ,8 + ,8.4 + ,8.2 + ,620 + ,149 + ,471 + ,8 + ,8.3 + ,8.1 + ,588 + ,134 + ,453 + ,8 + ,8.2 + ,8 + ,566 + ,123 + ,443 + ,8 + ,8.2 + ,7.9 + ,557 + ,116 + ,442 + ,7.9 + ,8 + ,7.8 + ,561 + ,117 + ,444 + ,7.9 + ,7.9 + ,7.6 + ,549 + ,111 + ,438 + ,7.9 + ,7.8 + ,7.5 + ,532 + ,105 + ,427 + ,7.9 + ,7.7 + ,7.4 + ,526 + ,102 + ,424 + ,8 + ,7.6 + ,7.3 + ,511 + ,95 + ,416 + ,7.9 + ,7.6 + ,7.3 + ,499 + ,93 + ,406 + ,7.4 + ,7.6 + ,7.2 + ,555 + ,124 + ,431 + ,7.2 + ,7.6 + ,7.2 + ,565 + ,130 + ,434 + ,7 + ,7.6 + ,7.2 + ,542 + ,124 + ,418 + ,6.9 + ,7.5 + ,7.1 + ,527 + ,115 + ,412 + ,7.1 + ,7.5 + ,7 + ,510 + ,106 + ,404 + ,7.2 + ,7.4 + ,7 + ,514 + ,105 + ,409 + ,7.2 + ,7.4 + ,6.9 + ,517 + ,105 + ,412 + ,7.1 + ,7.4 + ,6.9 + ,508 + ,101 + ,406 + ,6.9 + ,7.3 + ,6.8 + ,493 + ,95 + ,398 + ,6.8 + ,7.3 + ,6.8 + ,490 + ,93 + ,397 + ,6.8 + ,7.4 + ,6.8 + ,469 + ,84 + ,385 + ,6.8 + ,7.5 + ,6.9 + ,478 + ,87 + ,390 + ,6.9 + ,7.6 + ,7 + ,528 + ,116 + ,413 + ,7.1 + ,7.6 + ,7 + ,534 + ,120 + ,413 + ,7.2 + ,7.7 + ,7.1 + ,518 + ,117 + ,401 + ,7.2 + ,7.7 + ,7.2 + ,506 + ,109 + ,397 + ,7.1 + ,7.9 + ,7.3 + ,502 + ,105 + ,397 + ,7.1 + ,8.1 + ,7.5 + ,516 + ,107 + ,409 + ,7.2 + ,8.4 + ,7.7 + ,528 + ,109 + ,419 + ,7.5 + ,8.7 + ,8.1 + ,533 + ,109 + ,424 + ,7.7 + ,9 + ,8.4 + ,536 + ,108 + ,428 + ,7.8 + ,9.3 + ,8.6 + ,537 + ,107 + ,430 + ,7.7 + ,9.4 + ,8.8 + ,524 + ,99 + ,424 + ,7.7 + ,9.5 + ,8.9 + ,536 + ,103 + ,433 + ,7.8 + ,9.6 + ,9.1 + ,587 + ,131 + ,456 + ,8 + ,9.8 + ,9.2 + ,597 + ,137 + ,459 + ,8.1 + ,9.8 + ,9.3 + ,581 + ,135 + ,446 + ,8.1 + ,9.9 + ,9.4 + ,564 + ,124 + ,441 + ,8 + ,10 + ,9.4 + ,558 + ,118 + ,439 + ,8.1 + ,10 + ,9.5 + ,575 + ,121 + ,454 + ,8.2 + ,10.1 + ,9.5 + ,580 + ,121 + ,460 + ,8.4 + ,10.1 + ,9.7 + ,575 + ,118 + ,457 + ,8.5 + ,10.1 + ,9.7 + ,563 + ,113 + ,451 + ,8.5 + ,10.1 + ,9.7 + ,552 + ,107 + ,444 + ,8.5 + ,10.2 + ,9.7 + ,537 + ,100 + ,437 + ,8.5 + ,10.2 + ,9.7 + ,545 + ,102 + ,443 + ,8.5 + ,10.1 + ,9.6 + ,601 + ,130 + ,471 + ,8.4 + ,10.1 + ,9.6 + ,604 + ,136 + ,469 + ,8.3 + ,10.1 + ,9.6 + ,586 + ,133 + ,454 + ,8.2 + ,10.1 + ,9.6 + ,564 + ,120 + ,444 + ,8.1 + ,10.1 + ,9.6 + ,549 + ,112 + ,436 + ,7.9 + ,10.1 + ,9.6 + ,551 + ,109 + ,442 + ,7.6 + ,10.1 + ,9.6 + ,556 + ,110 + ,446 + ,7.3 + ,10 + ,9.5 + ,548 + ,106 + ,442 + ,7.1 + ,9.9 + ,9.5 + ,540 + ,102 + ,438 + ,7 + ,9.9 + ,9.4 + ,531 + ,98 + ,433 + ,7.1 + ,9.9 + ,9.4 + ,521 + ,92 + ,428 + ,7.1 + ,9.9 + ,9.5 + ,519 + ,92 + ,426 + ,7.1 + ,10 + ,9.5 + ,572 + ,120 + ,452 + ,7.3 + ,10.1 + ,9.6 + ,581 + ,127 + ,455 + ,7.3 + ,10.2 + ,9.7 + ,563 + ,124 + ,439 + ,7.3 + ,10.3 + ,9.8 + ,548 + ,114 + ,434 + ,7.2 + ,10.5 + ,9.9 + ,539 + ,108 + ,431 + ,7.2 + ,10.6 + ,10 + ,541 + ,106 + ,435 + ,7.1 + ,10.7 + ,10 + ,562 + ,111 + ,450 + ,7.1 + ,10.8 + ,10.1) + ,dim=c(6 + ,145) + ,dimnames=list(c('Totaal_werklozen' + ,'Jonger_dan_25_jaar' + ,'Vanaf_25_jaar' + ,'Belgie' + ,'Eurogebied' + ,'EU_27') + ,1:145)) > y <- array(NA,dim=c(6,145),dimnames=list(c('Totaal_werklozen','Jonger_dan_25_jaar','Vanaf_25_jaar','Belgie','Eurogebied','EU_27'),1:145)) > 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/fisher/rcomp/tmp/1c40s1354906561.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/rcomp/createtable") > > n <- length(y[,1]) > n [1] 6 > 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/fisher/rcomp/tmp/2g5rm1354906561.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 = 8.7304, p-value < 2.2e-16 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.493793 > 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) + } + } There were 15 warnings (use warnings() to see them) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/31nd91354906561.tab") > > try(system("convert tmp/1c40s1354906561.ps tmp/1c40s1354906561.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.975 0.300 2.254