Interaction effects with GAMM

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Interaction effects with GAMM

louiba
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]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Interaction effects with GAMM

Bert Gunter-2
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 <[hidden email]>
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]]
>
> ______________________________________________
> [hidden email] 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]]

______________________________________________
[hidden email] 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.