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(14543 + ,411 + ,8243 + ,5964 + ,14291 + ,416 + ,8243 + ,5859 + ,14788 + ,418 + ,8434 + ,5793 + ,15241 + ,408 + ,8576 + ,5682 + ,15265 + ,402 + ,8580 + ,5584 + ,15322 + ,401 + ,8645 + ,5482 + ,15175 + ,400 + ,8660 + ,5384 + ,14817 + ,389 + ,8720 + ,5265 + ,14579 + ,371 + ,8787 + ,5213 + ,15247 + ,364 + ,9162 + ,5161 + ,15385 + ,350 + ,9144 + ,5074 + ,14891 + ,332 + ,8806 + ,5010 + ,14766 + ,323 + ,8778 + ,4902 + ,14420 + ,316 + ,8660 + ,4817 + ,14850 + ,312 + ,8826 + ,4751 + ,15117 + ,315 + ,8609 + ,4667 + ,15352 + ,314 + ,8628 + ,4579 + ,15099 + ,313 + ,8619 + ,4514 + ,15291 + ,314 + ,8775 + ,4399 + ,15208 + ,317 + ,8840 + ,4360 + ,14995 + ,308 + ,8745 + ,4301 + ,15454 + ,312 + ,9092 + ,4285 + ,15251 + ,306 + ,8934 + ,4242 + ,14975 + ,304 + ,8749 + ,4201 + ,14005 + ,297 + ,8298 + ,4070 + ,13550 + ,284 + ,8067 + ,3968 + ,13422 + ,278 + ,7969 + ,3921 + ,13848 + ,273 + ,7999 + ,3846 + ,13376 + ,265 + ,7865 + ,3746 + ,13038 + ,259 + ,7746 + ,3654 + ,12974 + ,252 + ,7633 + ,3553 + ,12554 + ,245 + ,7458 + ,3487 + ,11971 + ,235 + ,7391 + ,3403 + ,12916 + ,232 + ,7856 + ,3488 + ,12757 + ,229 + ,7720 + ,3491 + ,11924 + ,219 + ,7297 + ,3372 + ,11693 + ,218 + ,7123 + ,3307 + ,11382 + ,215 + ,7004 + ,3274 + ,11821 + ,211 + ,7151 + ,3255 + ,12421 + ,210 + ,7106 + ,3217 + ,12372 + ,216 + ,7007 + ,3177 + ,12186 + ,217 + ,6980 + ,3160 + ,12092 + ,210 + ,6979 + ,3123 + ,11539 + ,216 + ,6736 + ,3077 + ,11567 + ,210 + ,6822 + ,3056 + ,12316 + ,206 + ,7245 + ,3070 + ,12152 + ,205 + ,7247 + ,3064 + ,11609 + ,199 + ,7040 + ,2993 + ,11462 + ,199 + ,7294 + ,2953 + ,11519 + ,201 + ,7160 + ,2924 + ,12012 + ,200 + ,7774 + ,2921 + ,12731 + ,203 + ,8063 + ,2915 + ,12925 + ,205 + ,8172 + ,2883 + ,13148 + ,210 + ,8239 + ,2879 + ,13021 + ,209 + ,8200 + ,2850 + ,12845 + ,204 + ,8143 + ,2826 + ,12981 + ,205 + ,8314 + ,2815 + ,13592 + ,208 + ,8734 + ,2811 + ,13446 + ,202 + ,8622 + ,2800 + ,12928 + ,202 + ,8205 + ,2763) + ,dim=c(4 + ,60) + ,dimnames=list(c('voeding' + ,'tabak' + ,'textiel' + ,'kleding') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('voeding','tabak','textiel','kleding'),1:60)) > 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/1cbdz1258626148.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] 4 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 6.3929, p-value = 1.627e-10 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.5683539 > 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/23geg1258626149.tab") > > system("convert tmp/1cbdz1258626148.ps tmp/1cbdz1258626148.png") > > > proc.time() user system elapsed 0.496 0.212 1.052