x <- array(list(2.6 ,2.00 ,2849.27 ,10872 ,2.3 ,2.00 ,2921.44 ,10625 ,2.3 ,2.00 ,2981.85 ,10407 ,2.6 ,2.00 ,3080.58 ,10463 ,3.1 ,2.00 ,3106.22 ,10556 ,2.8 ,2.00 ,3119.31 ,10646 ,2.5 ,2.00 ,3061.26 ,10702 ,2.9 ,2.00 ,3097.31 ,11353 ,3.1 ,2.00 ,3161.69 ,11346 ,3.1 ,2.00 ,3257.16 ,11451 ,3.2 ,2.00 ,3277.01 ,11964 ,2.5 ,2.00 ,3295.32 ,12574 ,2.6 ,2.00 ,3363.99 ,13031 ,2.9 ,2.21 ,3494.17 ,13812 ,2.6 ,2.25 ,3667.03 ,14544 ,2.4 ,2.25 ,3813.06 ,14931 ,1.7 ,2.45 ,3917.96 ,14886 ,2.0 ,2.50 ,3895.51 ,16005 ,2.2 ,2.50 ,3801.06 ,17064 ,1.9 ,2.64 ,3570.12 ,15168 ,1.6 ,2.75 ,3701.61 ,16050 ,1.6 ,2.93 ,3862.27 ,15839 ,1.2 ,3.00 ,3970.10 ,15137 ,1.2 ,3.17 ,4138.52 ,14954 ,1.5 ,3.25 ,4199.75 ,15648 ,1.6 ,3.39 ,4290.89 ,15305 ,1.7 ,3.50 ,4443.91 ,15579 ,1.8 ,3.50 ,4502.64 ,16348 ,1.8 ,3.65 ,4356.98 ,15928 ,1.8 ,3.75 ,4591.27 ,16171 ,1.3 ,3.75 ,4696.96 ,15937 ,1.3 ,3.90 ,4621.40 ,15713 ,1.4 ,4.00 ,4562.84 ,15594 ,1.1 ,4.00 ,4202.52 ,15683 ,1.5 ,4.00 ,4296.49 ,16438 ,2.2 ,4.00 ,4435.23 ,17032 ,2.9 ,4.00 ,4105.18 ,17696 ,3.1 ,4.00 ,4116.68 ,17745 ,3.5 ,4.00 ,3844.49 ,19394 ,3.6 ,4.00 ,3720.98 ,20148 ,4.4 ,4.00 ,3674.40 ,20108 ,4.2 ,4.00 ,3857.62 ,18584 ,5.2 ,4.00 ,3801.06 ,18441 ,5.8 ,4.00 ,3504.37 ,18391 ,5.9 ,4.18 ,3032.60 ,19178 ,5.4 ,4.25 ,3047.03 ,18079 ,5.5 ,4.25 ,2962.34 ,18483 ,4.7 ,3.97 ,2197.82 ,19644 ,3.1 ,3.42 ,2014.45 ,19195 ,2.6 ,2.75 ,1862.83 ,19650 ,2.3 ,2.31 ,1905.41 ,20830 ,1.9 ,2.00 ,1810.99 ,23595 ,0.6 ,1.66 ,1670.07 ,22937 ,0.6 ,1.31 ,1864.44 ,21814 ,-0.4 ,1.09 ,2052.02 ,21928 ,-1.1 ,1.00 ,2029.60 ,21777 ,-1.7 ,1.00 ,2070.83 ,21383 ,-0.8 ,1.00 ,2293.41 ,21467 ,-1.2 ,1.00 ,2443.27 ,22052 ,-1.0 ,1.00 ,2513.17 ,22680) ,dim=c(4 ,60) ,dimnames=list(c('Aindex' ,'rente' ,'BEL20' ,'Goud(EUR/kg)') ,1:60)) y <- array(NA,dim=c(4,60),dimnames=list(c('Aindex','rente','BEL20','Goud(EUR/kg)'),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/186991258392353.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() #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 cor.test(y[1,],y[2,],method='kendall') 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/2ypt51258392353.tab") system("convert tmp/186991258392353.ps tmp/186991258392353.png")