Skip to content
Prev 17753 / 20628 Next

Nested random effects in mgcv gam/bam

Replies inline.

Op 24-06-2019 om 18:07 schreef Mathew Guilfoyle:
I believe it should, but I'm not sure if this would actually give you a different fit, given that the groups perfectly separate the subjects? I've tried both constructions on some toy data of my own and the fits are exactly the same up to rounding error (in which case the non-by version is more parsimonious). But I guess this question would be answered for your data by a likelihood-ratio test.
Yes, precisely.
Ahh, sorry, I mistakenly thought you did not want nesting in your gamm model (I usually write the %in% explicitly if I use lme). Yes, of course, this is completely correct.