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(1.2286 + ,707.6 + ,721.8 + ,105.3 + ,1.1702 + ,655.6 + ,836.7 + ,102.5 + ,1.1692 + ,812.9 + ,817.8 + ,101.8 + ,1.1222 + ,756.2 + ,804.3 + ,94.7 + ,1.1139 + ,527.9 + ,773.3 + ,104.6 + ,1.1372 + ,883.9 + ,789.6 + ,100.7 + ,1.1663 + ,604.4 + ,882.5 + ,97.6 + ,1.1582 + ,756.0 + ,868.9 + ,91.3 + ,1.0848 + ,760.8 + ,885.7 + ,89.5 + ,1.0807 + ,666.6 + ,880.6 + ,106.1 + ,1.0773 + ,672.1 + ,846.2 + ,115.2 + ,1.0622 + ,744.8 + ,875.4 + ,107.1 + ,1.0183 + ,695.5 + ,799.6 + ,96.3 + ,1.0014 + ,755.7 + ,946.3 + ,87.0 + ,0.9811 + ,951.0 + ,987.3 + ,96.8 + ,0.9808 + ,705.9 + ,892.4 + ,99.8 + ,0.9778 + ,536.8 + ,885.1 + ,94.1 + ,0.9922 + ,877.3 + ,937.1 + ,90.8 + ,0.9554 + ,692.4 + ,935.9 + ,87.1 + ,0.9170 + ,851.7 + ,944.2 + ,90.6 + ,0.8858 + ,876.1 + ,930.9 + ,90.1 + ,0.8758 + ,836.3 + ,874.0 + ,83.9 + ,0.8700 + ,795.9 + ,891.9 + ,70.6 + ,0.8833 + ,773.9 + ,902.2 + ,68.4 + ,0.8924 + ,640.4 + ,767.0 + ,66.0 + ,0.8883 + ,812.7 + ,912.5 + ,66.3 + ,0.9059 + ,878.7 + ,918.6 + ,75.0 + ,0.9111 + ,686.0 + ,713.4 + ,90.5 + ,0.9005 + ,538.9 + ,849.9 + ,91.0 + ,0.8607 + ,885.6 + ,875.9 + ,88.5 + ,0.8532 + ,824.3 + ,1010.9 + ,95.1 + ,0.8742 + ,829.8 + ,1049.2 + ,97.2 + ,0.8920 + ,697.7 + ,900.5 + ,92.1 + ,0.9095 + ,911.6 + ,1111.6 + ,90.0 + ,0.9217 + ,910.6 + ,898.2 + ,96.4 + ,0.9383 + ,774.7 + ,1034.3 + ,90.8 + ,0.8973 + ,811.3 + ,996.7 + ,90.6 + ,0.8564 + ,886.6 + ,1188.9 + ,114.2 + ,0.8552 + ,939.6 + ,1092.5 + ,111.5 + ,0.8721 + ,1221.8 + ,952.0 + ,113.4 + ,0.9041 + ,626.6 + ,959.1 + ,103.8 + ,0.9397 + ,944.2 + ,846.1 + ,99.3 + ,0.9492 + ,655.4 + ,903.0 + ,103.4 + ,0.9060 + ,887.6 + ,1089.5 + ,96.9 + ,0.9470 + ,685.5 + ,879.9 + ,83.3 + ,0.9643 + ,1031.7 + ,1057.0 + ,96.3 + ,0.9834 + ,752.5 + ,932.6 + ,95.0 + ,1.0137 + ,681.6 + ,745.5 + ,88.6 + ,1.0110 + ,640.0 + ,817.2 + ,87.6 + ,1.0338 + ,648.5 + ,808.3 + ,85.0 + ,1.0706 + ,766.7 + ,832.9 + ,78.2 + ,1.0501 + ,692.8 + ,801.2 + ,80.7 + ,1.0604 + ,495.1 + ,773.1 + ,71.8 + ,1.0353 + ,860.1 + ,710.8 + ,66.6 + ,1.0378 + ,722.0 + ,820.4 + ,58.5 + ,1.0628 + ,633.0 + ,814.9 + ,57.4 + ,1.0704 + ,640.4 + ,833.5 + ,56.1 + ,1.0883 + ,777.6 + ,864.3 + ,46.9 + ,1.1208 + ,619.8 + ,844.9 + ,38.4 + ,1.1608 + ,544.5 + ,733.6 + ,40.3) + ,dim=c(4 + ,60) + ,dimnames=list(c('USD' + ,'import' + ,'export' + ,'aardolie') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('USD','import','export','aardolie'),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: 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/1o1oc1196247018.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 > 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 = -3.2847, p-value = 0.001021 alternative hypothesis: true tau is not equal to 0 sample estimates: tau -0.2910427 > 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/2z6vq1196247018.tab") > > system("convert tmp/1o1oc1196247018.ps tmp/1o1oc1196247018.png") > > > proc.time() user system elapsed 0.788 0.229 1.804