4
$\begingroup$

Why is it so that the regression line is horizontal to the x-axis when r-squared = 0?

I do understand that when r-squared = 1, estimated Y and actual Y are equal.

$\endgroup$

2 Answers 2

5
$\begingroup$

Nonmathematically: R-squared quantifies how well X lets you know Y (given the linear model). If the best-fit line is horizontal, then knowing X doesn't help you even the tiniest bit in knowing Y. Your best prediction for future Y values is the mean of all the current Y values, regardless of X. Since knowing X provides no useful information in predicting future Y values, R-squared is zero.

$\endgroup$
2
  • 2
    $\begingroup$ ... with the caveat, as Ben points out in his answer, that if all the $Y$ values are the same, a horizontal line will give you an $R^2 = 1$! $\endgroup$
    – jbowman
    Commented Oct 29, 2018 at 2:58
  • 1
    $\begingroup$ @jbowman. If all the Y values are the same, I think R2 is undefined, involving division by zero. $\endgroup$ Commented Oct 30, 2018 at 15:55
2
$\begingroup$

I calculate R-squared as "1.0 - (absolute_error_variance / dependent_data_variance)", so if all errors are zero (no variance) the R-squared is then "1.0 - (0.0 / dependent_data_variance)", or more simply "1.0 - 0.0". For a horizontal line the error variance equals the dependent data variance, so that would be "(1.0 - 1.0)", or simply 0.0.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.