Is Plot residuals vs predicted response equivalent to Plot residuals vs fitted ?
If so, then would be plotted by plot(lm)
and plot(predict(lm))
, where lm
is the linear model ?
Am I correct?
Is Plot residuals vs predicted response equivalent to Plot residuals vs fitted ?
If so, then would be plotted by plot(lm)
and plot(predict(lm))
, where lm
is the linear model ?
Am I correct?
Yes, the fitted values are the predicted responses on the training data, i.e. the data used to fit the model, so plotting residuals vs. predicted response is equivalent to plotting residuals vs. fitted.
As for your second question, the plot would be obtained by plot(lm)
, but before that you have to run par(mfrow = c(2, 2))
. This is because plot(lm)
outputs 4 plots, one of which is the one you want, i.e the residuals vs fitted plot. The command above divides the output screen into four facets, so each plot will be shown in one. The plot you are looking for will appear in the top left.
Maybe little off-topic, but as an addition: package named ggfortify
might come handy. Super easy to use, like this:
library(ggfortify)
autoplot(mod3)
Yields an output with the most important things you need to know, if your model violates the lm
assumptions or not. An example output here: