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(3111 + ,5140 + ,17153 + ,2.5 + ,766 + ,332 + ,2.4 + ,3995 + ,4749 + ,15579 + ,1.8 + ,294 + ,369 + ,2.4 + ,5245 + ,3635 + ,16755 + ,7.3 + ,235 + ,384 + ,2.4 + ,5588 + ,4305 + ,16585 + ,9.9 + ,462 + ,373 + ,2.1 + ,10681 + ,5805 + ,16572 + ,13.2 + ,919 + ,378 + ,2 + ,10516 + ,4260 + ,16325 + ,17.8 + ,346 + ,426 + ,2 + ,7496 + ,3869 + ,17913 + ,18.8 + ,298 + ,423 + ,2.1 + ,9935 + ,7325 + ,17572 + ,19.3 + ,92 + ,397 + ,2.1 + ,10249 + ,9280 + ,17338 + ,13.9 + ,516 + ,422 + ,2 + ,6271 + ,6222 + ,17087 + ,7.5 + ,843 + ,409 + ,2 + ,3616 + ,3272 + ,15864 + ,8 + ,395 + ,430 + ,2 + ,3724 + ,7598 + ,15554 + ,4 + ,961 + ,412 + ,1.7 + ,2886 + ,1345 + ,16229 + ,3.6 + ,1231 + ,470 + ,1.3 + ,3318 + ,1900 + ,15180 + ,4.8 + ,794 + ,491 + ,1.2 + ,4166 + ,1480 + ,16215 + ,5.9 + ,420 + ,504 + ,1.1 + ,6401 + ,1472 + ,15801 + ,10.4 + ,331 + ,484 + ,1.4 + ,9209 + ,3823 + ,15751 + ,12.3 + ,312 + ,474 + ,1.5 + ,9820 + ,4454 + ,16477 + ,15.5 + ,692 + ,508 + ,1.4 + ,7470 + ,3357 + ,17324 + ,16.7 + ,1221 + ,492 + ,1.1 + ,8207 + ,5393 + ,16919 + ,18.8 + ,1272 + ,452 + ,1.1 + ,9564 + ,8329 + ,16438 + ,15.2 + ,622 + ,457 + ,1 + ,5309 + ,4152 + ,16239 + ,11.3 + ,479 + ,457 + ,1.4 + ,3385 + ,4042 + ,15613 + ,6.3 + ,757 + ,471 + ,1.3 + ,3706 + ,7747 + ,15821 + ,3.2 + ,463 + ,451 + ,1.2 + ,2733 + ,1451 + ,15678 + ,5.3 + ,534 + ,493 + ,1.5 + ,3045 + ,911 + ,14671 + ,2.4 + ,731 + ,514 + ,1.6 + ,3449 + ,406 + ,15876 + ,6.5 + ,498 + ,522 + ,1.8 + ,5542 + ,1387 + ,15563 + ,10.4 + ,629 + ,490 + ,1.5 + ,10072 + ,2150 + ,15711 + ,12.6 + ,542 + ,484 + ,1.3 + ,9418 + ,1577 + ,15583 + ,16.8 + ,519 + ,506 + ,1.6 + ,7516 + ,2642 + ,16405 + ,17.7 + ,1585 + ,501 + ,1.6 + ,7840 + ,4273 + ,16701 + ,16.2 + ,956 + ,462 + ,1.8 + ,10081 + ,8064 + ,16194 + ,15.7 + ,633 + ,465 + ,1.8 + ,4956 + ,3243 + ,16024 + ,13.3 + ,561 + ,454 + ,1.6 + ,3641 + ,1112 + ,14728 + ,6.9 + ,976 + ,464 + ,1.8 + ,3970 + ,2280 + ,14776 + ,4 + ,565 + ,427 + ,2 + ,2931 + ,505 + ,15399 + ,1.5 + ,151 + ,460 + ,1.3 + ,3170 + ,744 + ,14286 + ,2.9 + ,588 + ,473 + ,1.1 + ,3889 + ,1369 + ,15646 + ,3.9 + ,1043 + ,465 + ,1 + ,4850 + ,531 + ,14543 + ,9 + ,398 + ,422 + ,1.2 + ,8037 + ,1041 + ,15673 + ,14.5 + ,902 + ,415 + ,1.2 + ,12370 + ,2076 + ,15171 + ,16.7 + ,180 + ,413 + ,1.3 + ,6712 + ,577 + ,15999 + ,22.3 + ,150 + ,420 + ,1.3 + ,7297 + ,5080 + ,1626 + ,16.4 + ,1805 + ,363 + ,1.4 + ,10613 + ,6584 + ,16123 + ,17.9 + ,86 + ,376 + ,1.1 + ,5184 + ,3761 + ,16144 + ,13.6 + ,1093 + ,380 + ,0.9 + ,3506 + ,294 + ,15005 + ,9.2 + ,925 + ,384 + ,1 + ,3810 + ,5020 + ,14806 + ,6.5 + ,750 + ,346 + ,1.1 + ,2692 + ,1141 + ,15019 + ,7.1 + ,1038 + ,389 + ,1.4 + ,3073 + ,3805 + ,13909 + ,6 + ,679 + ,407 + ,1.5 + ,3713 + ,2127 + ,15211 + ,8 + ,848 + ,393 + ,1.8 + ,4555 + ,2531 + ,14385 + ,13.1 + ,300 + ,346 + ,1.8 + ,7807 + ,3682 + ,15144 + ,14.1 + ,1379 + ,348 + ,1.8 + ,10869 + ,3263 + ,14659 + ,17.5 + ,901 + ,353 + ,1.7 + ,9682 + ,2798 + ,15989 + ,17 + ,1606 + ,364 + ,1.5 + ,7704 + ,5936 + ,16262 + ,17.1 + ,422 + ,305 + ,1.1 + ,9826 + ,10568 + ,16021 + ,13.8 + ,968 + ,307 + ,1.3 + ,5456 + ,5296 + ,15662 + ,10.1 + ,319 + ,312 + ,1.6 + ,3677 + ,1870 + ,14531 + ,6.9 + ,583 + ,312 + ,1.9 + ,3431 + ,4390 + ,14544 + ,2.4 + ,765 + ,286 + ,1.9 + ,2765 + ,3707 + ,15071 + ,6.5 + ,963 + ,324 + ,2 + ,3483 + ,5201 + ,14236 + ,5.1 + ,392 + ,336 + ,2.2 + ,3445 + ,3748 + ,14771 + ,5.9 + ,919 + ,327 + ,2.2 + ,6081 + ,5282 + ,14804 + ,8.9 + ,339 + ,302 + ,2 + ,8767 + ,5349 + ,15597 + ,15.7 + ,327 + ,299 + ,2.3 + ,9407 + ,6249 + ,15418 + ,16.5 + ,397 + ,311 + ,2.6 + ,6551 + ,5517 + ,16903 + ,18.1 + ,1268 + ,315 + ,3.2 + ,12480 + ,8640 + ,16350 + ,17.4 + ,1137 + ,264 + ,3.2 + ,9530 + ,15767 + ,16393 + ,13.6 + ,1000 + ,278 + ,3.1 + ,5960 + ,8850 + ,15685 + ,10.1 + ,915 + ,278 + ,2.8 + ,3252 + ,5582 + ,14556 + ,6.9 + ,905 + ,287 + ,2.3 + ,3717 + ,6496 + ,14850 + ,2.4 + ,243 + ,279 + ,1.9 + ,2642 + ,3255 + ,15391 + ,0.8 + ,537 + ,324 + ,1.9 + ,2989 + ,6189 + ,13704 + ,3.3 + ,551 + ,354 + ,2 + ,3607 + ,6452 + ,15409 + ,6.3 + ,482 + ,354 + ,2 + ,5366 + ,5099 + ,15098 + ,12.2 + ,199 + ,360 + ,1.8 + ,8898 + ,6833 + ,15254 + ,13.9 + ,650 + ,363 + ,1.6 + ,9435 + ,7046 + ,15522 + ,15.6 + ,533 + ,385 + ,1.4 + ,7328 + ,7739 + ,16669 + ,18.1 + ,1071 + ,412 + ,0.2 + ,8594 + ,10142 + ,16238 + ,18.5 + ,469 + ,370 + ,0.3 + ,11349 + ,16054 + ,16246 + ,15 + ,335 + ,389 + ,0.4 + ,5797 + ,7721 + ,15424 + ,10.7 + ,598 + ,395 + ,0.7 + ,3621 + ,6182 + ,14952 + ,9.5 + ,1200 + ,417 + ,1 + ,3851 + ,6490 + ,15008 + ,2.2 + ,844 + ,404 + ,1.1) + ,dim=c(7 + ,84) + ,dimnames=list(c('Huwelijken' + ,'Bevolkingsgroei' + ,'Geborenen' + ,'Temperatuur' + ,'Neerslag' + ,'Werkloosheid' + ,'Inflatie') + ,1:84)) > y <- array(NA,dim=c(7,84),dimnames=list(c('Huwelijken','Bevolkingsgroei','Geborenen','Temperatuur','Neerslag','Werkloosheid','Inflatie'),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' > #'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/1nk2n1292693454.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] 7 > 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/2qk0b1292693454.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 = 3.9635, p-value = 7.385e-05 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.2943201 > 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 18 warnings (use warnings() to see them) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/3mugk1292693454.tab") > > try(system("convert tmp/1nk2n1292693454.ps tmp/1nk2n1292693454.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.000 0.290 1.259