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@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.

Reply via email to