I am trying to find if there is a correlation between the two categorical variables (Var1 and Var2). For that I am performing Cramer's V test on the RxC contingency table since the test that gives the p-value is insufficient as it is dependent on the population size.

Having obtained the Cramer's value, I want to know specifically which labels (1,2,3,..M..N) taken from both variables correlate the most.

I have found that I can do a chi2 test to find if different rows or columns have some correlation (https://www.bmj.com/about-bmj/resources-readers/publications/statistics-square-one/8-chi-squared-tests)

Now I would like to find cell-wise correlations. The first thing I thought about was performing a test of whether Var1.labelN+Var2.labelM have strong or weak correlation in the population. For that I have thought about extracting 'local' 2x2 contingency table from the overall RxC contingency table and performing Cramer's V test on the local table. Below is the picture on how I am extracting the local contingency table.

The null hypothesis with the local contingency table would be that "in the taken population there is no correlation between Var1.label M and Var2.label N"

If the data would have been evenly distributed, I could have just use the likelihood (odds) test to verify or reject the null hypothesis, but in my case the data is very unbalanced

Could anyone tell me if such approach makes sense?

enter image description here


1 Answer 1


First, Cramér's V is itself based on the $\chi^2$ test for the corresponding contingency table and its p-value calculation is the same. (Note that such p values will always depend on sample size.) Its advantage is that it gives a value limited to [0,1] regardless of number of rows, columns, or observations.

Second, in a 2 x 2 table there is no difference between Cramér's V and the Phi coefficient, $\frac{\chi^2}{n}$.

This page shows two ways to proceed. One is to examine 2 x 2 tables encompassing each pair of categories of interest. A quick calculation suggests that would require 588 tests to cover your entire 8 x 7 array. The other way is similar to what you are proposing, to construct contingency tables for a chosen category against the corresponding sums of members of all other categories. The underlying tests are then $\chi^2$ tests, but as you are doing multiple tests you need to control for the multiple comparisons problem. This control for multiple comparisons could be quite major if you are contemplating all 56 2 x 2 tables outlined in your diagram; the Bonferroni correction for example would mean that you would need a p value of less than (0.05/56) or about 0.0009 for standard "statistical significance."

So except for the representation of the association as a value in [0,1], all that you wish to do can be done with $\chi^2$ tests provided that your data meet the requirements for that test. If your data are shown in your table, however, you have many cells with 0 entries. In particular categories #5 and #6 of Var_1 seem to have average cell values of 0.5 or less. At the least that will require some form of correction to the tests; you might consider merging some categories to reduce this problem. See this page for further discussion.

  • $\begingroup$ I have decided to use STATA to compute Pearson's chi-squared value for each cell using all possible two-way tables and compare it to the chi-square statistic for my described method. The results are very different. STATA, I suppose is using different way of constructing local 2x2 contingency tables than I do $\endgroup$ Commented Oct 13, 2019 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.