Diagnostics are methods to evaluate assumptions of the regression, which can be used to determine whether a fitted model adequately represents the data. In the following recipe, we introduce how to diagnose a regression model through the use of a diagnostic plot.
You need to have completed the previous recipe by computing a linear model of the x and y1 variables from the quartet, and have the model assigned to the lmfit
variable.
Perform the following step to generate a diagnostic plot of the fitted model:
Plot the diagnostic plot of the regression model:
> par(mfrow=c(2,2)) > plot(lmfit)