R version 2.6.0 (2007-10-03) Copyright (C) 2007 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(-5331 + ,0.99 + ,11.1 + ,-1.89 + ,-8267 + ,4.05 + ,-7.1 + ,-0.1 + ,-5560 + ,-7.4 + ,-5.7 + ,-0.02 + ,-8672 + ,-1.19 + ,-4 + ,-0.05 + ,-4490 + ,3.15 + ,7.2 + ,0.03 + ,-127 + ,-0.05 + ,-0.4 + ,6.73 + ,-1075 + ,1.83 + ,2.4 + ,0.02 + ,738 + ,-0.83 + ,-8.7 + ,0.1 + ,-618 + ,-5.17 + ,-6.8 + ,0 + ,755 + ,3.51 + ,19.1 + ,0 + ,295 + ,2.94 + ,1.5 + ,-0.14 + ,4034 + ,0.48 + ,-2.7 + ,-0.13 + ,-3485 + ,-1.51 + ,-17.2 + ,1.79 + ,2312 + ,-7.38 + ,-7.5 + ,0.01 + ,6976 + ,0.44 + ,18.4 + ,0.24 + ,5929 + ,6.2 + ,4.5 + ,-0.01 + ,282 + ,-0.21 + ,-3.2 + ,-0.04 + ,476 + ,3.63 + ,0.8 + ,0.01 + ,-3701 + ,-2.61 + ,-13.8 + ,0.05 + ,-552 + ,-3.75 + ,17 + ,-0.1 + ,-398 + ,2.16 + ,-6.4 + ,0.01 + ,-2534 + ,-0.59 + ,2.1 + ,-0.03 + ,1465 + ,0.35 + ,2.2 + ,0 + ,-1741 + ,0.7 + ,-5.5 + ,-0.02 + ,1714 + ,2.31 + ,8 + ,0.6 + ,-3792 + ,0.92 + ,-6 + ,0.06 + ,-7342 + ,2.62 + ,11 + ,-0.26 + ,-5552 + ,-7.4 + ,-17.9 + ,0.34 + ,-274 + ,2.63 + ,12.6 + ,0 + ,2725 + ,1.37 + ,6.7 + ,-0.01 + ,-34 + ,-2.36 + ,-15.1 + ,-0.06 + ,1193 + ,4.35 + ,19.8 + ,0.13 + ,-682 + ,-8.94 + ,-33.2 + ,0.22 + ,-2997 + ,-0.78 + ,2.5 + ,0.04 + ,-690 + ,2.05 + ,26.1 + ,0 + ,-3109 + ,7.69 + ,-8.9 + ,-0.016205333 + ,2213 + ,-0.63 + ,18.1 + ,-0.379989333 + ,3915 + ,3.62 + ,-22.8 + ,1.679586667 + ,5410 + ,-9.45 + ,-10.4 + ,0.057826667 + ,683 + ,6.01 + ,31.2 + ,-0.34 + ,4331 + ,2.96 + ,-13.3 + ,0 + ,-3353 + ,-5.22 + ,10.8 + ,0.009565333 + ,187 + ,3.76 + ,-19.4 + ,0.018261333 + ,-1402 + ,-8.02 + ,-11.8 + ,-0.120434667 + ,-1479 + ,-7.73 + ,1.5 + ,-0.210869333 + ,1210 + ,7.29 + ,16.3 + ,0.056957333 + ,-1097 + ,6.13061375 + ,14.7 + ,0 + ,-1331 + ,-3.852974833 + ,-28.2 + ,1.190656333 + ,12.3 + ,4.995579833 + ,20.9 + ,-4.206122917 + ,-23 + ,-2.433080333 + ,-3.5 + ,2.484848 + ,16.2 + ,-1.708333 + ,-17.1 + ,-10.62531358 + ,-32.4 + ,4.503787 + ,20.3 + ,6.535667917 + ,16.4 + ,0.81534075 + ,8.1) + ,dim=c(4 + ,58) + ,dimnames=list(c('inschrijvingen' + ,'brandstof' + ,'aardolie' + ,'wegvervoer') + ,1:58)) > y <- array(NA,dim=c(4,58),dimnames=list(c('inschrijvingen','brandstof','aardolie','wegvervoer'),1:58)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > main = 'Kendall tau Correlation Plot' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2007), Multivariate Correlation Matrix (v1.0.3) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_pairs.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program 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='kendall') + 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/11o5q1197728887.ps",horizontal=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 > load(file='/var/www/html/rcomp/createtable') > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Kendall tau rank correlations for all pairs of data series',3,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'pair',1,TRUE) > a<-table.element(a,'tau',1,TRUE) > a<-table.element(a,'p-value',1,TRUE) > a<-table.row.end(a) > n <- length(y[,1]) > n [1] 4 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 1.61, p-value = 0.1074 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.1452345 > for (i in 1:(n-1)) + { + for (j in (i+1):n) + { + a<-table.row.start(a) + dum <- paste('tau(',dimnames(t(x))[[2]][i]) + dum <- paste(dum,',') + dum <- paste(dum,dimnames(t(x))[[2]][j]) + dum <- paste(dum,')') + a<-table.element(a,dum,header=TRUE) + r <- cor.test(y[i,],y[j,],method='kendall') + a<-table.element(a,r$estimate) + a<-table.element(a,r$p.value) + a<-table.row.end(a) + } + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/2l4ol1197728887.tab") > > system("convert tmp/11o5q1197728887.ps tmp/11o5q1197728887.png") > > > proc.time() user system elapsed 0.736 0.209 0.799