R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(97.57 + ,127.96 + ,20.72 + ,97.74 + ,127.47 + ,21.45 + ,97.92 + ,126.47 + ,22.09 + ,98.19 + ,125.75 + ,21.53 + ,98.23 + ,125.42 + ,23.35 + ,98.41 + ,125.14 + ,23.57 + ,98.59 + ,125.15 + ,26.42 + ,98.71 + ,125.51 + ,25.21 + ,99.14 + ,125.63 + ,26.44 + ,99.62 + ,126.22 + ,29.34 + ,100.18 + ,126.88 + ,29.40 + ,100.66 + ,127.96 + ,33.05 + ,101.19 + ,128.74 + ,28.38 + ,101.75 + ,129.6 + ,26.01 + ,102.2 + ,131.2 + ,29.31 + ,102.87 + ,132.72 + ,30.36 + ,98.81 + ,134.67 + ,35.75 + ,97.6 + ,135.94 + ,36.15 + ,96.68 + ,136.39 + ,34.21 + ,95.96 + ,136.74 + ,37.91 + ,98.89 + ,137.2 + ,38.70 + ,99.05 + ,137.36 + ,42.12 + ,99.2 + ,138.63 + ,42.16 + ,99.11 + ,141.07 + ,39.80 + ,99.19 + ,143.32 + ,37.36 + ,99.77 + ,147.91 + ,38.35 + ,100.70 + ,152.56 + ,42.60 + ,100.78 + ,151.61 + ,41.25 + ,100.53 + ,156.56 + ,42.16 + ,101.01 + ,157.45 + ,46.94 + ,100.92 + ,158.13 + ,47.43 + ,101.10 + ,159.18 + ,47.06 + ,103.11 + ,159.47 + ,50.18 + ,102.99 + ,159.79 + ,50.13 + ,102.31 + ,161.65 + ,43.23 + ,102.61 + ,162.77 + ,40.04 + ,103.68 + ,163.48 + ,40.37 + ,104.72 + ,166.16 + ,42.21 + ,107.66 + ,163.86 + ,37.00 + ,108.87 + ,162.12 + ,39.74 + ,108.12 + ,149.08 + ,42.68 + ,107.61 + ,145.32 + ,46.29 + ,106.42 + ,141.21 + ,46.97 + ,105.61 + ,134.68 + ,48.73 + ,105.71 + ,133.65 + ,52.37 + ,105.49 + ,139.17 + ,50.05 + ,105.57 + ,138.61 + ,54.04 + ,105.18 + ,144.96 + ,57.78 + ,106.09 + ,157.99 + ,64.72 + ,106.34 + ,167.18 + ,63.41 + ,108.47 + ,174.48 + ,64.36 + ,116.87 + ,182.77 + ,66.03 + ,121.08 + ,190.00 + ,72.14 + ,123.27 + ,189.70 + ,76.60 + ,124.18 + ,188.90 + ,86.97 + ,125.60 + ,198.28 + ,93.48 + ,126.57 + ,201.18 + ,95.59 + ,127.18 + ,204.14 + ,81.89 + ,128.04 + ,221.02 + ,70.55 + ,128.55 + ,221.12 + ,50.38 + ,129.67 + ,220.68 + ,36.25) + ,dim=c(3 + ,61) + ,dimnames=list(c('Elektriciteit' + ,'Gas' + ,'Olie') + ,1:61)) > y <- array(NA,dim=c(3,61),dimnames=list(c('Elektriciteit','Gas','Olie'),1:61)) > 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: AUTHOR(S), (YEAR), 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: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > 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/freestat/rcomp/tmp/15ezb1229604429.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 > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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] 3 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 7.1378, p-value = 9.481e-13 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.6269473 > 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/freestat/rcomp/tmp/2qt3u1229604429.tab") > > system("convert tmp/15ezb1229604429.ps tmp/15ezb1229604429.png") > > > proc.time() user system elapsed 0.639 0.264 0.715