[R] Interaction effects with GAMM

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Tue Feb 19 19:32:45 CET 2019


Wrong list. This list is about R programming, not statistical questions on
mixed models. Post on the r-sig-mixed-models list for that.

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 19, 2019 at 10:07 AM Louise Baruël Johansen <louisebj using drcmr.dk>
wrote:

> I have a question on how to model interaction terms including smooths in a
> GAMM model (using the mgcv and nlme packages in R).
>
> We have collected longitudinal behavioral and brain imaging data from ~100
> subjects across ~6 time points, and I would like to model main effects of
> age, sex, brain as well as to-way interaction terms (and maybe three-way
> interaction terms), while correcting for education level and taking random
> effects into account. Is using the ti() setup the way to do this:
>
> M = gamm(behav ~ ti(age) + sex + education + ti(age, by = sex) + brain +
> ti(brain, by = age), random = list(subjectID = ~1+age), data = data)
>
> All help will be appreciated.
>
> Thanks, Louise
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list