3
$\begingroup$

I am doing an analysis in R and I have the model:

lm(birthrate~education+employment+lo(latitude, longitude),data=data2).

It seems to be a generalized additive model, can I still use the usual diagnostic plots (the four default ones are residuals-vs-fitted, normal-QQ, scale-location, residuals-vs-leverage with Cook's-distance contours marked on) to assess the model's validity?

$\endgroup$
3
  • 1
    $\begingroup$ If you found the answer helpful you could accept it by clicking the green arrow so that other readers can see the thread was closed (in your opinion). $\endgroup$
    – mdewey
    Commented Mar 3, 2017 at 12:16
  • $\begingroup$ I'm confused why you say "it seems to be a GAM". But it seems to be a LM model? $\endgroup$ Commented Apr 29, 2018 at 19:32
  • $\begingroup$ As far as I know, the plot(gam_X) function returns plots for each independent variable but not the typical diagnostic plots. Can you advise on your assertion that plot(gam_X) does return the typical diagnostic plots? $\endgroup$ Commented Aug 6, 2021 at 11:54

1 Answer 1

2
$\begingroup$

You can -- the plot method works with GAMs, and the interpretation is essentially the same.

The diagnostic plots relate to model assumptions under which inference might be performed; you don't necessarily need them all to hold if you're just trying to get a reasonable description of the relationships, say. However they can still be useful:

  • the residuals vs fitted would show pattern if you were oversmoothing

  • if the first plot is okay, then the scale-location plot would show changing error variance (heteroskedasticity). If there's strong effects the misspecified model would result in (at best) over-weighting the noisier parts and underweighting the places where the noise is less.

  • if both of those are okay, the normal scores plot might be useful because a misspecified model for the error term would suggest there are more efficient ways to estimate (and critically, any attempt to produce prediction intervals based on a normal assumption would perform poorly).

  • the residuals-leverage plot will still show points that are overly-influential on their own fitted values, this can be useful (for example you might want to see how much the fit changes if they're not there to see if the fit relies too much on only a point or two)

$\endgroup$
1
  • $\begingroup$ There is an added diagnostic check to consider. Generalized additive models use splines to estimate the unknown functions of the predictors. You would want to make sure that you've chosen a reasonable number of splines and that you're not over-smoothing or under-smoothing. You can check the effective degrees of freedom, and you can look at the fit and make sure it doesn't look too "wiggly" (under-penalized) or constant (over-penalized). $\endgroup$
    – Eli
    Commented Aug 6, 2021 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.