# Cramer's $\phi$ for three-way contingency tables

Can Cramer's $\phi$ be determined for three-way contingency tables?

I know how to calculate the expected values, chi squared, and how Cramer's $\phi$ works with two-way contingency tables. However, I'm struggling to understand how the denominator of Cramer's $\phi$ has to be adapted for "three-dimensional" data.

In case it cannot: What alternative measures of association are possible that are normalized to fall within $[0, 1]$ or $(0, 1)$?

Note: I am aware of this and this question. I am interested, however, especially in Cramer's $\phi$ and how to calculate it by hand.

## 1 Answer

There really isn't a straightforward generalization to Cramer's V, in the same way that Pearson's $\phi$ isn't defined for $2 x 2 .... 2$ tables. This is because there are multiple null models to be selecting from, so a single collapsed relationship statistic is not meaningful.

As an example, say you have a large $\chi^2$ value in your association test. In a $2 x 2$ case this is simple, because the rescaling of the $\chi^2$ to a correlation is still meaningful: one unit of increase has a correlation of $\phi$ with the second variable. However, for a $2 x 2 x 2$ model, a large/significant $\chi^2$ could mean that there are many possible relationships present (V1 with V2, V1 with V3, V2 with V3, or V1 with V2 with V3). So a single number would not capture where this co-relationship is occurring, and hence a single correlation statistic would just be ambiguous. The same principle applies to Cramer's V, where higher dimensional tables are not easily collapsible to single number relationships.

Overall goodness of fit measures that are analogous to $R^2$ in linear regression are possible and several have been proposed (e.g., Pseudo R squared formula for GLMs), though these are not that easily done by hand as they rely on computing log-likelihood/deviation values.

• (A) I don't see the need of a hypothesis when studying a descriptive measure of association. (B) the null hypothesis of no association in a multiway table is nothing special. – Michael M Apr 24 '15 at 17:52
• @MichaelM (B) Agreed, no association in a multiway table is nothing special, and it's analogous to Bartlett's test that $R = I$ for continuous data. (A) Because it relates directly to the question, i.e., how to compute a Cramer's V analogue for higher dimensional tables? Could you perhaps elaborate on what you mean. The second part of my comment about pseudo-R squared measures seems to cover that anyway as it is about descriptive analogues to $R^2$ (which are largely likelihood/model-based, and therefore a hypothesis is implied). – philchalmers Apr 24 '15 at 18:04
• @MichaelM, in the sense that the p-value can be understood as a measure of the uncertainty that the data differ from the null, an effect size can be understood as the magnitude that the data differ from the null. Thus, a null is always implied (albeit usually trivially). Phil Chalmers is correct: the problem is there is no null specified. Given a 2x2x2 table AxBxC, you could ask how strongly is A associated w/ B ignoring C, OR how strongly is A associated w/ B&C, OR how strongly is A associated w/ B*C, etc. – gung - Reinstate Monica Apr 24 '15 at 19:18
• The strength / magnitude of those associations will typically differ. You could also decompose the table & ask how much of the multidimensional variance is accounted for by the 1st eigenvector, but that is again a different question. W/o specifying which association you are interested in (which implies a null), the strength of the association cannot be assessed. – gung - Reinstate Monica Apr 24 '15 at 19:21
• @gung: Indeed, and well explained thoughts! – Michael M Apr 24 '15 at 20:14