I want to resurrect a question that I asked two months ago (Comparing gam models using ti( )), but adding more explanations.

  • The aim of my analyses was to compare several gam models with different combinations of independent variables.

  • My analyses are done in R using the gam function from the mgcv package

  • Some of the models include interactions between some of the independent variables and in such a case, I use the following gam structure. gam(Y ~ ti(X1) + ti(X2) + ti(X1,X2), data = dat). The ti() function is a tensor product that is appropriate when interaction terms and main effects occur simultaneously (https://stat.ethz.ch/R-manual/R-devel/library/mgcv/html/te.html).

  • Models that do not include interactions can be written as gam(Y ~ ti(X1) + ti(X2), data = dat) or gam(Y ~ s(X1) + s(X2), data = dat) with s() a function providing a smoother of the variable considered (https://stat.ethz.ch/R-manual/R-devel/library/mgcv/html/s.html)

I have two questions concerning this setup:

  1. Is it correct using ti() (i.e. tensor product) when there is no interaction in the formula ?

(I am sure I will be blasted for this question, but if I use ti() instead of s() in those models their AIC value is better ... but see my second question)

  1. Can I compare directly (e.g. using AIC for example) models fitted with ti() and models fitted with s() ?

Thanks for your help !


  • 1
    $\begingroup$ I'm not knowledgable enough to help out here, but just wanted to let you know that simply editing your previous question puts it at the top of the active page, which a lot of users watch. This shouldn't be abused, but it is designed so that you can provide more clarification without being lost in the sea of questions. $\endgroup$ – Chris C Apr 14 '15 at 15:57
  • $\begingroup$ @Chris C Thanks! I did not know that ... so sorry for the double posting $\endgroup$ – Arnaud Apr 14 '15 at 19:05
  • $\begingroup$ No skin off my back, just wanted to let you know for the future so you know the site better :) $\endgroup$ – Chris C Apr 14 '15 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.