1
$\begingroup$

How to decide, based on data exploration and data visualisation, between a GAM and a GLM.

Linear Models (LM) assume that the relationship between the response and the predictor are linear. Generalized Linear Models (GLM) assume linearity on the link scale, which means we can work with non-linear relationship between the response and the predictor, but this relationship still needs to be monotonic (i.e. either going upwards on downwards). Generalized Additive Models (GAM) do not assume any particular relationship, which means this relationship can go up and down (i.e. it is curved or wiggly). I hope I correctly summarized it up to here.

The issue of difference between GLM and GAM, or when to use GAMs as opposed to GLMs has been covered elsewhere (e.g. here) - this is not what my question is about.

My primary question is what kind of data exploration or data visualisation tools would you typically use in order to determine if GAMs are an appropriate tool as opposed to GLM. What would be a good guidelines to follow for a typical practice on deciding that.

Sub-questions:

1) If the response is continuous, I suppose you could just do a scatterplot for the response and each of the predictors, which should likely give you a hint. Correct?

2a) But if the response is presence/absence (1/0), you would need a binomial model, whether GLM or GAM. How would you decide (based on data exploration and visualisation) on which one to use?

2b) If data are presence/absence, would it make sense to run simple GAMs for the response and each of the potential predictors in turn, plot them to see the relationships, and then either use GAMs if the relationships are curvy, or a GLM if they are not? Would this be considered a good practice to guide your analytical decisions?

$\endgroup$

marked as duplicate by kjetil b halvorsen, mdewey, Michael Chernick, jbowman, mkt Jan 22 at 10:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Respectfully, I fail to see how my question is a duplicate of the ones referred to above. I already made a reference to one of them in my original question, and specifically emphasized that this is not what I am asking. I was asking explicitly about exploratory data analysis and plotting to guide the choice. That does not seem to be addressed in the links provided by those who voted this post as a duplicate. What am I missing? $\endgroup$ – Tilen Jan 22 at 14:53
  • $\begingroup$ I have edited the question in an attempt to clarify and explain in a bit more detail what I am asking (and what I'm not). Hopefully this helps. $\endgroup$ – Tilen Jan 22 at 14:59
  • 1
    $\begingroup$ It is said in answers to those questions that most of what can be done with gams can be done with glm's, using splines. Estimation of splines is done differently within those frameworks (smoothing splines versus regression splines), but it is not clear how important this is. So mainly the decision is pragmatic, for instance gam's as implemented in mgcv (in R) have a lot of options integrated, so in some cases it might be practical to use. But you don't need any specific exploratory tools for that decision! If the question is if it is necessary to use splines: TRY! plot results, see. $\endgroup$ – kjetil b halvorsen Jan 22 at 15:00
  • 3
    $\begingroup$ I think the main thing missing here, and the main thing in using a GAM vs a GLM is that you must clearly be expecting some non-linearity (on the link scale) and you should really have some idea of the complexity of that non-linearity, and on which covariates have some effect. The GAMs fitted by mgcv are GLMs if we are not choosing smoothness parameters --- if we are, then the GAMs are just penalised GLMs --- once the basis expansions of the coavriates have been created. $\endgroup$ – Gavin Simpson Jan 22 at 19:36