Context: The linear regression Y = mX + c
Intuitively, it seems to me that swapping the independent variable and dependent variables won't change the test statistic for the significance of the coefficient for the dependent variable (the null hypothesis is that the coefficient is zero).
i.e. for the same $X$ and $Y$, $$Y = \hat{\beta_0} + \hat{\beta_1} X\\ X = \hat{\beta_0}' + \hat{\beta_1}' Y$$
is it true that, $$ \hat{\beta_1} /\mathrm{SE}(\hat{\beta_1} ) = \hat{\beta_1}'/\mathrm{SE}(\hat{\beta_1}')$$
Such that either way I do the hypothesis test, $$\mathrm{H}_0 : \beta_1 = 0 \\ \mathrm{H}_1 : \beta_1 \neq 0 \\ \mathrm{H}_0': \beta_1' = 0 \\ \mathrm{H}_1': \beta_1' \neq 0 $$
I will reject/accept with the same $p$-value, and obtain the same $R^2$ for the model?
I've tested this out on a data set that is available to me, and it seems to be true, but I'm not sure about the mathematics of it.