R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(308347,1.8,298427,1.6,289231,1.9,291975,1.7,294912,1.6,293488,1.3,290555,1.1,284736,1.9,281818,2.6,287854,2.3,316263,2.4,325412,2.2,326011,2,328282,2.9,317480,2.6,317539,2.3,313737,2.3,312276,2.6,309391,3.1,302950,2.8,300316,2.5,304035,2.9,333476,3.1,337698,3.1,335932,3.2,323931,2.5,313927,2.6,314485,2.9,313218,2.6,309664,2.4,302963,1.7,298989,2,298423,2.2,301631,1.9,329765,1.6,335083,1.6,327616,1.2,309119,1.2,295916,1.5,291413,1.6,291542,1.7,284678,1.8,276475,1.8,272566,1.8,264981,1.3,263290,1.3,296806,1.4,303598,1.1,286994,1.5,276427,2.2,266424,2.9,267153,3.1,268381,3.5,262522,3.6,255542,4.4,253158,4.2,243803,5.2,250741,5.8,280445,5.9,285257,5.4,270976,5.5,261076,4.7,255603,3.1,260376,2.6,263903,2.3,264291,1.9,263276,0.6,262572,0.6,256167,-0.4,264221,-1.1,293860,-1.7,300713,-0.8),dim=c(2,72),dimnames=list(c('werkloosheidvrouwen','inflatie'),1:72)) > y <- array(NA,dim=c(2,72),dimnames=list(c('werkloosheidvrouwen','inflatie'),1:72)) > 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/rcomp/tmp/1ith41261625944.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > 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] 2 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = -0.2872, p-value = 0.774 alternative hypothesis: true tau is not equal to 0 sample estimates: tau -0.02342924 > 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/20izz1261625944.tab") > > try(system("convert tmp/1ith41261625944.ps tmp/1ith41261625944.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.383 0.194 0.492