# How to compute Kendall tau for more than two variables

I am new to statistics. I decided to use Kendall tau correlation.

I want to find correlations between every variable of the data set. (For example, if there are three variables in the data $x, y$ and $z$, then I need the correlations between $x$and $y$, $y$ and $z$, and $x$ and $z$.)

I have about 100 variables.

I am unable to find any example with the correlation between more than two variables.

Question 1 Is the method to find the correlation between more than two variables the same as that for two variables?

Question 2 Some of my variables can be qualitative. Does Kendall tau satisfy my requirement? Please suggest any better method to do it.

Please suggest to me some readings about Kendall tau correlation.

• I've edited this rather heavily to remove repetitions and improve wording. Please check that your intent comes across. – Nick Cox Mar 15 '15 at 11:53

Note that Kendall tau correlation, which comes in different flavours, was suggested by the British statistician (Sir) Maurice G. Kendall, so "Kendall" not "kendall" is the form used.

Kendall tau is covered in just about any book on nonparametric statistics (a very unfortunate term, for reasons I won't go into here, but it remains standard for texts). Find one at your own level of understanding. The better texts assume rather more than an introductory knowledge of statistics, so there is a delicate trade-off. Some texts on nonparametric statistics rather imply, or even argue, that no other methods are valid, which is a position held by few experienced users of statistics.

Be that as it may, although there are other approaches, there is nothing different about the calculation of Kendall tau just because you have several variables. The calculation for each pair of variables is just as it would be if you had no other variables. Indeed, any good statistical software will on request produce a matrix (table) of correlations. (More advanced ideas come under the heading of partial correlations.)

Some warnings:

1. If some of your variables are qualitative, everything depends on what means. It is, or should be, explained in every text in this area that nominal-scale variables are not suitable for Kendall tau correlation.

2. Just looking at a bundle of correlations will only get you so far. You need to look at graphs of the data too. Also, if relationships between variables are not monotonic, then Kendall tau will not help any more than Pearson correlation will.

3. Your post has the air of suggesting that you think choosing one main method will be enough to help you understand a data set with many variables, but typically that is never the case in statistical applications.

You just calculate correlations between pairs of variables. This is the same as the case when calculating Pearson correlations across many variables.

If you want your correlation matrix to be positive semidefinite, you may run into problems if there are different sets of complete pairs for different pairs of variables (i.e. if the missing values don't correspond). Some people choose to omit all observations that are incomplete in this situation, but it can lead to problems if there are a non-tiny proportion of missing values.

To calculate a Kendall's tau you need to be able to decide if one value is larger(/smaller) than another. If your 'qualitative' values form nominal categories, it certainly won't work for that.