2
$\begingroup$

When evaluating residuals for a linear model, do we plot them against the fitted values or the x values. Here I have an example in R.
Do we want the first or second graph?

reg <- lm(dist ~ speed + 0, data = cars)
plot(reg$fitted.values, reg$residuals)
plot(cars$speed, reg$residuals)

Thank you

$\endgroup$

1 Answer 1

5
$\begingroup$

The graphs are identical because the fitted values are just a linear transformation of speed. In general (i.e., when you have more than one predictor), both graphs are valuable. The single-predictor by residuals plot tells you whether there is an association between the predictor and the residuals, which could be modeled in a future fit. The fitted values by residuals plot tells you broadly whether an association remains between your predictor set and the residuals, in which case an entirely different model form might be useful. With many predictors, it can be hard to do predictor by residual plots for every one, so the fitted by residual plot can be a useful summary.

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.