Model Diagnostics
Often statistical models such as linear regression and logistic regressions come with many assumptions that need to be validated before accepting the final solution. A model violating the assumptions will result in erroneous prediction and results will be prone to misinterpretation.
The following code shows a method for obtaining the diagnostic plots from the output of the lm() method. The plot has four different plots looking at the residuals. Let's understand how to interpret each plot. All these plots are about how well the fit matches the regression assumptions. If there is a violation, it will be clearly shown in the plots of the following code:
par(mfrow = c(2,2)) plot(multiple_PM25_linear_model)
The output is as follows:
In the next four sections, we will explore each of the plots with randomly generated data from a linear equation and a quadratic equation , and later come back to explain...