In R, after creating a linear model using the function model <- lm()
and plotting it using plot(model)
, you will get back 4 graphs each displaying your model differently. Can anyone explain what these graphs mean?
Asked
Active
Viewed 546 times
2

Has QUIT--Anony-Mousse
- 76,138
- 12
- 138
- 194

JohnBanter
- 49
- 3
-
5https://cran.r-project.org/doc/contrib/Robinson-icebreaker.pdf , section 9.3 – jogo Apr 23 '18 at 12:41
-
[Note to moderators: this is one of those questions that might seems inappropriate but I think lots of people, in particular students, will benefit from a good answer located in one place.] – mysteRious Apr 23 '18 at 12:51
-
Yes please I am a student and new to R. A simplified explanation of those 4 models would help a lot – JohnBanter Apr 23 '18 at 13:33
1 Answers
3
plot.lm
can produce 6 different diagnostic plots, controlled by the which
parameter. These are:
- a plot of residuals against fitted values
- a Normal Q-Q plot
- a Scale-Location plot of sqrt(| residuals |) against fitted values
- a plot of Cook's distances versus row labels
- a plot of residuals against leverages
- a plot of Cook's distances against leverage/(1-leverage)
By default it will produce numbers 1, 2, 3 and 5, pausing between plots in interactive mode.
You can see them all in one go if you set up the graphics device for multiple plots, eg:
mdl <- lm(hp~disp,mtcars)
par(mfrow=c(3,2))
plot(mdl,which=1:6)
Interpretation of these plots is a question for Cross Validated, though ?plot.lm
gives some basic information.

James
- 65,548
- 14
- 155
- 193