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(-0.1471 + ,137.1 + ,11.9 + ,48.3 + ,-0.1374 + ,132.7 + ,87.7 + ,56.6 + ,-0.124 + ,254.1 + ,192.7 + ,49.4 + ,-0.1234 + ,45.1 + ,46.4 + ,27.2 + ,-0.1568 + ,254.6 + ,274.6 + ,39.5 + ,-0.0886 + ,-66.6 + ,82.6 + ,44.9 + ,-0.0956 + ,84.1 + ,135.3 + ,32.7 + ,-0.1563 + ,131.5 + ,186 + ,32 + ,-0.178 + ,529 + ,150.8 + ,32.7 + ,-0.2154 + ,172.9 + ,259.6 + ,33.3 + ,-0.1774 + ,238.1 + ,380.6 + ,29.2 + ,-0.1137 + ,171.3 + ,179.5 + ,3 + ,-0.0754 + ,93.1 + ,288.8 + ,2.2 + ,-0.0617 + ,158.1 + ,-34.4 + ,1.4 + ,-0.0548 + ,-120.1 + ,54.6 + ,-6.3 + ,-0.055 + ,12.2 + ,20.6 + ,8.8 + ,-0.0318 + ,-57.8 + ,-40.3 + ,0.3 + ,-0.096 + ,168.9 + ,107.9 + ,-8.3 + ,-0.079 + ,-58.6 + ,29.8 + ,-10.8 + ,-0.0036 + ,-87.7 + ,-109.2 + ,-12.8 + ,0.039 + ,-535.8 + ,-238.6 + ,-22.9 + ,0.0507 + ,-60.9 + ,-173.9 + ,-36.5 + ,0.0319 + ,-73.9 + ,-276.4 + ,-47.9 + ,-0.0049 + ,-170.9 + ,-229.7 + ,-24.6 + ,-0.055 + ,-0.8 + ,-132.1 + ,-22.4 + ,-0.0517 + ,-114.7 + ,-6.3 + ,-25.8 + ,-0.0337 + ,-75.3 + ,-237.6 + ,-6.1 + ,-0.0062 + ,178.4 + ,30.4 + ,-2 + ,0.0428 + ,21.9 + ,-105 + ,-6.6 + ,0.1022 + ,-131.9 + ,-75 + ,-8 + ,0.1315 + ,-8.3 + ,61.2 + ,2.3 + ,0.0773 + ,-2.1 + ,35.2 + ,3.1 + ,0.0697 + ,19.9 + ,179 + ,9.3 + ,0.0752 + ,72.3 + ,68.7 + ,21.8 + ,0.1131 + ,-57 + ,33.8 + ,20.7 + ,0.1259 + ,55.1 + ,32.6 + ,30.3 + ,0.1789 + ,-29.1 + ,-26.8 + ,38.7 + ,0.2073 + ,-123.8 + ,-45.7 + ,44.6 + ,0.2049 + ,-169.7 + ,6.6 + ,22.2 + ,0.199 + ,-115.3 + ,-45.2 + ,-0.6 + ,0.2412 + ,-95.7 + ,-75.3 + ,0.7 + ,0.2109 + ,-88 + ,-53.4 + ,10.5 + ,0.145 + ,6.6 + ,-147.5 + ,9.9 + ,0.1361 + ,-8.9 + ,-111.8 + ,10.5 + ,0.1414 + ,50.3 + ,-88.1 + ,-5.1 + ,0.1881 + ,-138.1 + ,-169.5 + ,5 + ,0.1688 + ,-100.1 + ,-109.6 + ,15.5 + ,0.2103 + ,12.1 + ,-77.8 + ,9) + ,dim=c(4 + ,48) + ,dimnames=list(c('dollarkoers' + ,'export' + ,'import' + ,'aardolie') + ,1:48)) > y <- array(NA,dim=c(4,48),dimnames=list(c('dollarkoers','export','import','aardolie'),1:48)) > 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/1xp7l1196276285.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 cor.test.default(x, y, method = "kendall") : Cannot compute exact p-value with ties 2: In cor.test.default(x, y, method = "kendall") : Cannot compute exact p-value with ties 3: In cor.test.default(x, y, method = "kendall") : Cannot compute exact p-value with ties 4: In cor.test.default(x, y, method = "kendall") : Cannot compute exact p-value with ties 5: In cor.test.default(x, y, method = "kendall") : Cannot compute exact p-value with ties > 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 = -4.5953, p-value = 4.321e-06 alternative hypothesis: true tau is not equal to 0 sample estimates: tau -0.4585366 Warning message: In cor.test.default(y[1, ], y[2, ], method = "kendall") : Cannot compute exact p-value with ties > 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) + } + } Warning messages: 1: In cor.test.default(y[i, ], y[j, ], method = "kendall") : Cannot compute exact p-value with ties 2: In cor.test.default(y[i, ], y[j, ], method = "kendall") : Cannot compute exact p-value with ties 3: In cor.test.default(y[i, ], y[j, ], method = "kendall") : Cannot compute exact p-value with ties 4: In cor.test.default(y[i, ], y[j, ], method = "kendall") : Cannot compute exact p-value with ties 5: In cor.test.default(y[i, ], y[j, ], method = "kendall") : Cannot compute exact p-value with ties > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/2lvhg1196276285.tab") > > system("convert tmp/1xp7l1196276285.ps tmp/1xp7l1196276285.png") > > > proc.time() user system elapsed 0.747 0.219 0.815