Relationship between the phi, Matthews and Pearson correlation coefficients Are the phi and Matthews correlation coefficients the same concept? How are they related or equivalent to Pearson correlation coefficient for two binary variables? I assume the binary values are 0 and 1.

The Pearson's correlation between two Bernoulli random variables $x$ and $y$ is:
$$ \rho = \frac{\mathbb{E} [(x - \mathbb{E}[x])(y - \mathbb{E}[y])]} {\sqrt{\text{Var}[x] \, \text{Var}[y]}}
= \frac{\mathbb{E} [xy] - \mathbb{E}[x] \, \mathbb{E}[y]}{\sqrt{\text{Var}[x] \, \text{Var}[y]}}
= \frac{n_{1 1} n - n_{1\bullet} n_{\bullet 1}}{\sqrt{n_{0\bullet}n_{1\bullet}  n_{\bullet 0}n_{\bullet 1}}} $$
where
$$ \mathbb{E}[x] = \frac{n_{1\bullet}}{n} \quad
\text{Var}[x] = \frac{n_{0\bullet}n_{1\bullet}}{n^2} \quad
\mathbb{E}[y] = \frac{n_{\bullet 1}}{n} \quad
\text{Var}[y] = \frac{n_{\bullet 0}n_{\bullet 1}}{n^2} \quad
\mathbb{E}[xy] = \frac{n_{11}}{n} $$

Phi coefficient from Wikipedia:

In statistics, the phi coefficient (also referred to as the "mean square contingency coefficient" and denoted by $\phi$ or $r_\phi$) is a measure of association for two binary variables introduced by Karl Pearson. 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...
If we have a 2 × 2 table for two random variables $x$ and $y$

The phi coefficient that describes the association of $x$ and $y$ is
  $$ \phi = \frac{n_{11}n_{00} - n_{10}n_{01}}{\sqrt{n_{1\bullet}n_{0\bullet}n_{\bullet0}n_{\bullet1}}} $$

Matthews correlation coefficient from Wikipedia:

The Matthews correlation coefficient (MCC) can be calculated directly from the confusion matrix using the formula:
  $$ \text{MCC} = \frac{ TP \times TN - FP \times FN } {\sqrt{ (TP + FP) (TP + FN) (TN + FP) (TN + FN) } } $$
In this equation, TP is the number of true positives, TN the number of true negatives, FP the number of false positives and FN the number of false negatives. If any of the four sums in the denominator is zero, the denominator can be arbitrarily set to one; this results in a Matthews correlation coefficient of zero, which can be shown to be the correct limiting value.

 A: Firstly, there was a typo error in the question: $\mathbb{E}[xy]$ is not $\displaystyle \frac{n_{\bullet 1}n_{1\bullet}}{n^2}$ but rather
$$ \frac{n_{11}}{n} \times 1 \times 1 + \frac{n_{10}}{n}\times 1 \times 0 + \frac{n_{01}}{n} \times 0 \times 1 + \frac{n_{00}}{n} \times 0 \times 0 = \frac{n_{11}}{n} $$
Secondly, the key to showing that $\rho = \phi$ is
$$ n_{11} n - n_{1\bullet} n_{\bullet 1}
= n_{11} (n_{01} + n_{10} + n_{11} + n_{00}) - (n_{11} + n_{10}) (n_{11} + n_{01}) \\
= n_{11} n_{00} - n_{10} n_{01} $$
A: I want to note that the phi coefficient $\phi$ (MCC is just a synonym for it) will be equal to the Pearson correlation coefficient $r$ not only when random variables $X$ and $Y$ take values from the set $R = \{0,1\}$ but also in the following cases:

*

*When $X$ and $Y$ take values from any other numeric binary set, for example, from $R = \{-1,1\}$ or $R = \{5.5,3.7\}$, etc.


*When random variable $X$ takes values from the set $R_X = \{x_1, x_2\}$ and random variable $Y$ takes values from the set $R_Y = \{y_1, y_2\}$ (this case may correspond to a situation when $X$ and $Y$ are two nominal variables with two categories each, and we mapped the categories into some different numeric values; such mapping is, of course, not unique) if the contingency table is built in such a way that numbers $\mathrm{max}(x_1,x_2)$ and $\mathrm{max}(y_1,y_2)$ are the names of the 1st row and 1st column of the table respectively (or the names of the 2nd row and the 2nd column of the table respectively).

The proof is given below.
A key mathematical property of the Pearson correlation coefficient is that it is invariant under separate changes in location and scale in the two variables. That is, we may transform $X$ to $a + b X$ and transform $Y$ to $c + d Y$, where $a, b, c, d$ are constants with $b, d \gt 0$, without changing the correlation coefficient (this holds for both the population and sample Pearson correlation coefficients). So if we have $R_X = \{x_1,x_2\}$ and $R_Y = \{y_1,y_2\}$ there always exist linear mappings $$f: X \to U = \frac{-x_1 + X}{x_2 - x_1}, \quad g:Y \to V = \frac{-y_1+Y}{y_2-y_1},$$
they map $R_X \overset{f}{\to} \{0,1\}, \, R_Y \overset{g}{\to} \{0,1\}$.
Using them, we get that Pearson's $r(\mathbf{x},\mathbf{y}) = r(f(\mathbf{x}), \, g(\mathbf{y})) = r(\mathbf{u}, \mathbf{v})$, where $\mathbf{u}, \mathbf{v} \in \{0,1\}^n$. Next, user ryan_tt proved in his post that $r(\mathbf{u}, \mathbf{v}) = \phi(\mathbf{u}, \mathbf{v})$. Hence,
$$r(\mathbf{x},\mathbf{y}) = \phi\left(\frac{-x_1 + \mathbf{x}}{x_2 - x_1}, \frac{-y_1+\mathbf{y}}{y_2-y_1} \right), \qquad \forall \mathbf{x},\mathbf{y} \in \mathbb{R}^n.$$
