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(2.074996377 + ,2.293994811 + ,-1.892018822 + ,153.6755174 + ,117.7565127 + ,1.235760721 + ,103.4196238 + ,124.0593836 + ,0.563031786 + ,216.1898032 + ,-57.63118383 + ,-1.681777069 + ,335.3820105 + ,-148.4807117 + ,0.409391642 + ,463.3705437 + ,2.067407253 + ,-1.163771183 + ,-382.8200703 + ,302.1252747 + ,0.273844923 + ,-186.9031405 + ,308.9934276 + ,0.419261998 + ,-303.4154138 + ,7.711016284 + ,0.142069989 + ,238.6742901 + ,-53.06218801 + ,-1.616052502 + ,176.0761762 + ,-215.8121082 + ,0.69356418 + ,96.57783568 + ,-179.2793928 + ,0.368288103 + ,95.33921883 + ,-36.66712334 + ,1.277297206 + ,216.6037348 + ,-7.308481737 + ,-1.42554929 + ,274.9607427 + ,-133.1500993 + ,2.687348328 + ,-244.1681739 + ,93.76314183 + ,0.117391693 + ,354.9893264 + ,206.619249 + ,0.100325687 + ,-17.81939426 + ,-229.5349296 + ,1.041133291 + ,-12.85380621 + ,259.0708568 + ,1.723122897 + ,943.6989083 + ,-99.58126552 + ,-1.393957144 + ,-472.6073813 + ,269.9669353 + ,0.954507778 + ,-100.888253 + ,48.91481502 + ,1.872948154 + ,-304.0164742 + ,-29.12063 + ,-2.215147469 + ,275.0929878 + ,-61.5094603 + ,-1.926013968 + ,50.20149727 + ,57.5987677 + ,1.104353558 + ,-30.68259605 + ,-327.2439788 + ,0.582607051 + ,-399.52372 + ,-50.22952022 + ,0.89288225 + ,-171.4074482 + ,-13.61930104 + ,0.384912275 + ,-4.339155562 + ,163.6860018 + ,-2.405751477 + ,100.9903684 + ,18.89331263 + ,-0.145150523 + ,-45.12506111 + ,106.4302721 + ,-0.56354464 + ,60.52427221 + ,-70.56844503 + ,-1.252593096 + ,150.9095456 + ,-12.83994858 + ,-0.323909682 + ,405.3066564 + ,6.97089635 + ,-2.902829867 + ,-65.48005392 + ,-167.8275625 + ,-1.154904595 + ,-103.4874919 + ,-85.94257367 + ,0.308168949 + ,-130.7373627 + ,50.78900794 + ,-0.189829183 + ,-57.03483193 + ,-117.6915576 + ,2.175477764 + ,-145.5754633 + ,-155.6069484 + ,0.777371211 + ,253.0943148 + ,46.73153252 + ,-0.027873566 + ,28.20610726 + ,-286.1272517 + ,1.082335914 + ,24.63196686 + ,-17.53192217 + ,-1.72111969 + ,607.7026379 + ,137.8713085 + ,1.617255615 + ,-0.307703691 + ,-115.515968 + ,-0.611267443 + ,95.49117344 + ,-126.7975933 + ,-2.651404008 + ,644.3581066 + ,-186.4451633 + ,-3.44540633 + ,190.4962992 + ,24.28894823 + ,-0.668921862 + ,-221.7566749 + ,80.13347931 + ,0.817370596 + ,-140.3691816 + ,-238.2445942 + ,1.258840183) + ,dim=c(3 + ,49) + ,dimnames=list(c('Huwelijken' + ,'Echtscheidingen' + ,'Fin.situatie ') + ,1:49)) > y <- array(NA,dim=c(3,49),dimnames=list(c('Huwelijken','Echtscheidingen','Fin.situatie '),1:49)) > 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/1tm8t1197391379.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) Warning messages: 1: In strwidth(labels, "user") : font width unknown for character 0xd 2: In text.default(x, y, txt, cex = cex, font = font) : font width unknown for character 0xd 3: In text.default(x, y, txt, cex = cex, font = font) : font metrics unknown for character 0xd 4: In text.default(x, y, txt, cex = cex, font = font) : font width unknown for character 0xd > 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] 3 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] T = 528, p-value = 0.3067 alternative hypothesis: true tau is not equal to 0 sample estimates: tau -0.1020408 > 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/2gkje1197391379.tab") > > system("convert tmp/1tm8t1197391379.ps tmp/1tm8t1197391379.png") > > > proc.time() user system elapsed 0.722 0.208 0.796