I ran a linear regression using the following code:
rm(list = ls())
model =lm(mpg ~ horsepower, Auto)
par(mar = c(1,1,1,1))
plot(Auto$horsepower, Auto$mpg,ylab = “mpg”,xlab = “horsepower”)
The plot(model) commands gives the following graphs:
Can someone help me understand the meaning of the plots obtained? What could they alternately be and what would it then mean?
@Harshita_Dudhe, the first plot is basically the line of best fit on top of mpg vs. horsepower plot. Assuming you have already created the model, this can be generated separately by:
plot(Auto$horsepower, Auto$mpg,ylab = "mpg",xlab = "horsepower")
The rest of the plots display parameters pertaining to the model itself – meta-information of the model, if you will. To be honest, most of the terms are beyond my basic understanding of statistics, but the section 4.2 here will hopefully give you a start.