[R-sig-ME] interactions with a smoothed term in a gam

Rafael Mares crm53 at cam.ac.uk
Thu Jul 14 10:00:58 CEST 2011


Dear all

I am hoping someone can please help me with a gam I'm trying to
specify using gamm4 0.1-2 in R, particularly in trying to specify
interactions with a smoothed term.

I am looking at the occurrence or not of a behaviour (extraterritorial
foray) in each week across several years and how this behaviour might
be predicted by a series of continuous and categorical variables. I am
including week as a predictor variable in my model like so:
s(week,bs="cc") - as the behaviour is highly cyclical - , and I would
like to allow this smoothed term to interact with my other predictor
variables: age of the individual, total rainfall during week and
occurrence of an intergroup encounter (yes/no). Is it possible to
create a "fixed smoothed term" for week, that I could then allow to
interact linearly with each of my other predictor variables? I am
trying to avoid specifying interactions as either: s(week, age) or
s(week, by = age), because I am interested in multiple interactions
and to my understanding, these approaches would create a different
smooth for each interaction. My main interest is to see whether other
highly seasonal variables (such as oestrus and it's interactions),
which are expected to have linear effects, are better predictors than
a smooth of week (plus interactions), in explaining whether
individuals embark on extraterritorial forays or not.

Thank you in advance for any help.
All the best,

Raff
Rafael Mares
Large Animal Research Group (LARG)
Department of Zoology
University of Cambridge
Downing Street
Cambridge
CB2 3EJ




More information about the R-sig-mixed-models mailing list