# Phi coefficient

In statistics, the phi coefficient (also referred to as the "mean square contingency coefficient" and denoted by φ (or rφ)) is a measure of association for two binary variables. Introduced by Karl Pearson,[1] this measure is similar to the Pearson correlation coefficient in its interpretation. In fact, a Pearson correlation coefficient estimated for two binary variables will return the phi coefficient.[2] The square of the Phi coefficient is related to the chi-squared statistic for a 2×2 contingency table (see Pearson's chi-squared test)[3]

${\displaystyle \phi ^{2}={\frac {\chi ^{2}}{n}}}$

where n is the total number of observations. Two binary variables are considered positively associated if most of the data falls along the diagonal cells. In contrast, two binary variables are considered negatively associated if most of the data falls off the diagonal. If we have a 2×2 table for two random variables x and y

 y = 1 y = 0 total x = 1 ${\displaystyle n_{11}}$ ${\displaystyle n_{10}}$ ${\displaystyle n_{1\bullet }}$ x = 0 ${\displaystyle n_{01}}$ ${\displaystyle n_{00}}$ ${\displaystyle n_{0\bullet }}$ total ${\displaystyle n_{\bullet 1}}$ ${\displaystyle n_{\bullet 0}}$ ${\displaystyle n}$

where n11, n10, n01, n00, are non-negative counts of number of observations that sum to n, the total number of observations. The phi coefficient that describes the association of x and y is

${\displaystyle \phi ={\frac {n_{11}n_{00}-n_{10}n_{01}}{\sqrt {n_{1\bullet }n_{0\bullet }n_{\bullet 0}n_{\bullet 1}}}}}$

Phi is related to the point-biserial correlation coefficient and Cohen's d and estimates the extent of the relationship between two variables (2×2).[4]

The Phi coefficient can also be expressed using only ${\displaystyle n}$, ${\displaystyle n_{11}}$, ${\displaystyle n_{1\bullet }}$, and ${\displaystyle n_{\bullet 1}}$, as

${\displaystyle \phi ={\frac {nn_{11}-n_{1\bullet }n_{\bullet 1}}{\sqrt {n_{1\bullet }n_{\bullet 1}(n-n_{1\bullet })(n-n_{\bullet 1})}}}}$

## Maximum values

Although computationally the Pearson correlation coefficient reduces to the phi coefficient in the 2×2 case, the interpretation of a Pearson correlation coefficient and phi coefficient must be taken cautiously. The Pearson correlation coefficient ranges from −1 to +1, where ±1 indicates perfect agreement or disagreement, and 0 indicates no relationship. The phi coefficient has a maximum value that is determined by the distribution of the two variables. If both have a 50/50 split, values of phi will range from −1 to +1. See Davenport El-Sanhury (1991) [5] for a thorough discussion.