# Are the statistical results of a linear regression affected if I swap IV and DV with each other? [duplicate]

This question already has an answer here:

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.

## marked as duplicate by whuber♦ regression StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 20 '18 at 15:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• "the test statistic for the significance of the coefficient for the dependent variable" what is difference between test statistic and significance ? these are different or same ? – Subhash C. Davar Apr 20 '18 at 14:26

## 1 Answer

Galton (1886) showed that, if your variables are standardized (so that they have a unit variance), by reversing DV and IV you get the same coefficient. The reason for that is that: $\beta_1=\frac{Cov(X,Y)}{Var(X)}$;
$\beta_1'= \frac{Cov(X,Y)}{Var(Y)}$. Basically, you are always testing the null hypothesis of null correlation (given $Corr(X,Y)=0 \iff Cov(X,Y)=0).$

So, the answer is Yes: you will reject/accept with the same p-value, and obtain the same R^2 for the model.

Galton, Francis (1886): “Regression Towards Mediocrity in Hereditary Stature,” The Journal of the Anthropological Institute of Great Britain and Ireland, 15, 246-263.

• Basically, you are always testing the null hypothesis of null correlation ? please elaborate ? – Subhash C. Davar Apr 20 '18 at 14:35
• $Cov(X,Y)/Var(X)=0 \iff Cov(X,Y)/Var(Y)=0 \iff Cov(X,Y)=0$ given a ratio is null $\iff$ its numerator is null. Then, $Cov(X,Y)=0$. But since $Cov(X,Y)=\rho(X,Y)*\sigma_X*\sigma_Y$, $Cov(X,Y)=0 \iff \rho(X,Y)=0$. Of course I'm not considering here degenerate cases where either $X$ or $Y$ do not vary (a regression only makes sense when there is variation). – Federico Tedeschi Apr 20 '18 at 15:07