I have a GAM model with several continuous parametric covariates, one non-parametric covariate, and two continuous parametric predictors. I am using R.

The reason I am employing GAM is to be able to control for the nonparametric covariate (an air pollution variable), but I am actually interested in the two main predictors (parametric: x1 and x2) and possibly their interaction.

I have 2 questions:

  1. Can I simply include the term x1*x2 in the model like I would do in the case of GLM?

  2. Suppose I can include that term, can I then assess additive interaction indices (RERI, AP, synergy index) like I would do for GLM in addition to presenting the results for multiplicative interactions or that can be done only under GLM ? In the case of GAM the model is additive so interactions cannot be assessed that way, I assume. I guess the word "additive" in the two contexts is misleading and my understanding of GAM is limited.


1 Answer 1


Before I answer the questions, in this context, how do you differentiate between continuous parametric covariates and continuous parametric predictors? Do they refer to continuous independent variables or covariates or is there any difference?

Presuming that the continuous covariates and continuous predictors simply imply continuous independent variables, and you are using mgcv package in R, here are my answers.

Q.1) Yeah, you can include the term $x_1*x_2$ interaction term in your model. In R, formulae, you mention it as $x_1:x_2$. Now, these variables are in parametric form, i.e. not to be enclosed within $s()$ or $te()$, so the interpretation will be straightforward as in a normal linear model.

Even though GAM is an additive model, you can still include interactions.

Interactions can be of the following form in GAMs:

1) Parametric Interactions as in Normal Linear Model. 2) Continuous-by-Continuous Interaction in case of Non-Parametric Terms or Smoothed Covariate. In R, it is done using $s(x_1,x_2)$ or $te(x_1,x_2)$ (tensor smoothing)

3) Binary-by-Continuous Interactions where the interaction is done between each level of a factor variable and a continuous covariate. In R, using mgcv package, it is done as follows, $s(x_1, by=x_2)$, where $x_1$ is the continuous variables and $x_2$ is a binary factor variable.

4) In addition, you can also do varying coefficients model which is a special class of continuous-by-continuous interaction models.

Following is the varying-coefficient model.

$y = a(x2) + b(x_2)*x_1 + \epsilon$, where $a(x_2)$ is the intercept non-parametric covariate of $x_2$ and the slope of parametric covariate $x_1$ is non-parametric covariate smoothed form $b(x_2)$.

Q.2.) I cannot specifically comment on Additive Interaction Indices, but you can certainly get results for interactions after running the GAM Model.

Further, the additive interaction indices: Relative excess risk due to interaction [RERI], attributable proportion [AP], synergy index [SI]) they are indices that can be done in case of continuous covariates also. (If it can be done in case of GLM, it can also be done in case of GAM also).

Before that, you can check whether additivity is sufficient or interaction required using anova.

Model 1: $y = x_1 + x_2 + s(x_3) + s(x_4)$ Model 2: $y = x_1 + x_2 + x_1:x_2 + s(x_3) + s(x_4)$ Model 3: $y = x_1 + x_2 + x_1:x_2 + s(x_3) + s(x_4) + s(x_3,x_4)$

anova(Model1, Model2, Model3)

If the p-value of any Model2 or Model 3 is insignificant then the previous model is sufficient.




Semiparametric regression By David Ruppert, M.P. Wand, and R.J. Carroll.


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.