Proposition (F statistic in terms of sample partial correlation)
Let $(X_i, Y_i, Z_i)_{i=1}^n$ be iid copies of $(X,Y,Z)$ where $X\in \R$, $Y\in \R$, $Z\in \R^p$. Form the matrices $\mathbf{X} = \pmat{X_1 \\ \vdots \\X_n}$, $\mathbf{Y} = \pmat{Y_1 \\ \vdots \\ Y_n}$, $\mathbf{Z} = \pmat{Z_1^T \\ \vdots \\Z_n^T}$.
Assuming $\pmat{\v 1 & \mathbf{X} & \mathbf{Z}}$ has full column rank, let $P_0$, $P$ be the orthogonal projection matrices onto $\op{Col}\pmat{1 & \mathbf{Z}}$ and $\op{Col}\pmat{1 & \mathbf{X} & \mathbf{Z}}$.
Then the sample partial correlation is given by $$ \begin{align*} \hat ρ_{X,Y\mid Z} = \frac{\|(P - P_0) \mathbf{Y}\|}{\|(I-P_0) \mathbf{Y}\|}. \end{align*} $$
The $F$-statistic is then $$ \begin{align*} \frac{\|(P - P_0) \mathbf{Y}\|^2}{\|(I-P)\mathbf{Y}\|^2/(n-p-2)} = (n-p-2)\frac{\hat ρ_{X,Y\mid Z}^2}{1 - \hat ρ_{X,Y\mid Z}^2}. \end{align*} $$