Skip to main content
Statistics LibreTexts

27.2: Model Criticism and Diagnostics (Section 26.5)

  • Page ID
    8859
  • Once we have fitted the model, we want to look at some diagnostics to determine whether the model is actually fitting properly. We can do this using the autoplot() function from the ggfortify package.

    autoplot(lm_result,which=1:2)

    file114.png

    The left panel in this plot shows the relationship between the predicted (or “fitted”) values and the residuals. We would like to make sure that there is no clear relationship between these two (as we will see below). The right panel shows a Q-Q plot, which helps us assess whether the residuals from the model are normally distributed. In this case, they look reasonably normal, as the points don’t differ too much from the unit line.