R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(450.7 + ,156.5 + ,294.2 + ,-378 + ,-1346.9 + ,968.9 + ,-502.8 + ,193.2 + ,-696 + ,790.1 + ,247.5 + ,542.6 + ,14.5 + ,349.5 + ,-335 + ,-156.5 + ,5.4 + ,-161.9 + ,1900.3 + ,1316.7 + ,583.6 + ,-961.2 + ,-934 + ,-27.2 + ,-582 + ,30.2 + ,-612.2 + ,993.6 + ,1062.6 + ,-69 + ,-892.5 + ,-628.7 + ,-263.8 + ,1395.5 + ,1110.3 + ,285.2 + ,111.5 + ,588.2 + ,-476.7 + ,-754.8 + ,-1056.9 + ,302.1 + ,469.5 + ,1450.7 + ,-981.2 + ,-306.7 + ,-602.7 + ,296 + ,42 + ,-244.4 + ,286.4 + ,-381.1 + ,-259.7 + ,-121.4 + ,-27 + ,-393.6 + ,366.6 + ,-653.4 + ,-758.8 + ,105.4 + ,904.9 + ,798.4 + ,106.5 + ,-285 + ,97.2 + ,-382.2 + ,-457.5 + ,-573.8 + ,116.3 + ,901.6 + ,621.8 + ,279.8 + ,-738.8 + ,-352.1 + ,-386.7 + ,115.1 + ,-66.5 + ,181.6 + ,1302.8 + ,410 + ,892.8 + ,-1387 + ,-626.9 + ,-760.1 + ,766.3 + ,687.3 + ,79 + ,1325.1 + ,1493.5 + ,-168.4 + ,-897 + ,-919 + ,22 + ,-545.4 + ,-357 + ,-188.4 + ,1937.4 + ,2736.9 + ,-799.5 + ,-1589.8 + ,-2354.7 + ,764.9 + ,1351.8 + ,1562.6 + ,-210.8 + ,-623.2 + ,-526.8 + ,-96.4 + ,-394.1 + ,-986.3 + ,592.2 + ,1306 + ,1510.3 + ,-204.3 + ,-608.1 + ,-555.9 + ,-52.2 + ,-435.5 + ,-477.7 + ,42.2 + ,-130.1 + ,212.9 + ,-343 + ,-58.2 + ,-461.7 + ,403.5 + ,239.7 + ,247.7 + ,-8 + ,329.8 + ,715 + ,-385.2 + ,-1073.1 + ,-1423.6 + ,350.5 + ,-370.7 + ,-239.2 + ,-131.5 + ,929.8 + ,746.4 + ,183.4 + ,103.8 + ,204.2 + ,-100.4 + ,-1504.4 + ,-1407.7 + ,-96.7 + ,1795.2 + ,2170.2 + ,-375 + ,-333.8 + ,-116.4 + ,-217.4 + ,188.4 + ,286.2 + ,-97.8 + ,-356.1 + ,-1021.8 + ,665.7 + ,780.7 + ,1626 + ,-845.3 + ,-2617.6 + ,-2865.9 + ,248.3 + ,2898.8 + ,2008.7 + ,890.1 + ,-1021.2 + ,-1552.8 + ,531.6 + ,107.9 + ,714.6 + ,-606.7 + ,-293 + ,-150.9 + ,-142.1 + ,-761.3 + ,-778.2 + ,16.9 + ,1923.1 + ,2083.6 + ,-160.5 + ,-1314.5 + ,-1962.2 + ,647.7 + ,-1568 + ,-1980.7 + ,412.7 + ,2105.6 + ,1977 + ,128.6 + ,-586.4 + ,-234.8 + ,-351.6 + ,-544.1 + ,-1351.9 + ,807.8 + ,1146.4 + ,2061.2 + ,-914.8 + ,-1041 + ,-136.9 + ,-904.1 + ,665.4 + ,73.1 + ,592.3 + ,1016.3 + ,1882.5 + ,-866.2 + ,-495.3 + ,-1934.7 + ,1439.4 + ,-1221 + ,-226.1 + ,-994.9 + ,1957.4 + ,2120.8 + ,-163.4 + ,-1585.4 + ,-979.9 + ,-605.5 + ,-245.8 + ,116.3 + ,-362.1 + ,2472.7 + ,3350.8 + ,-878.1 + ,595 + ,-186.8 + ,781.8 + ,-3027.6 + ,-1953.3 + ,-1074.3 + ,4341.4 + ,3791.1 + ,550.3 + ,-3726.1 + ,-3885.9 + ,159.8 + ,522.3 + ,468.5 + ,53.8) + ,dim=c(3 + ,81) + ,dimnames=list(c('Uitvoer' + ,'Invoer' + ,'Handelsbalans') + ,1:81)) > y <- array(NA,dim=c(3,81),dimnames=list(c('Uitvoer','Invoer','Handelsbalans'),1:81)) > 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/1fo061229912177.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] 3 > cor.test(y[1,],y[2,],method='kendall') Kendall's rank correlation tau data: y[1, ] and y[2, ] z = 9.9758, p-value < 2.2e-16 alternative hypothesis: true tau is not equal to 0 sample estimates: tau 0.7549383 > 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/2qmk91229912177.tab") > > system("convert tmp/1fo061229912177.ps tmp/1fo061229912177.png") > > > proc.time() user system elapsed 0.478 0.198 0.547