[R-sig-ME] random slopes in gamm4
john@morrong|e||o @end|ng |rom un|me|b@edu@@u
Fri Apr 5 14:47:40 CEST 2019
I posted this question back in 2015 but unfortunately didn't get a reply. I'd like to use these models again so thought it worth another ask.
Most GAMM examples involve the fitting of a model with just a random intercept (e.g. M1 below). However, I'd like to explore the possibility of each individual (ID) having a different X1 smoother 'slope', or even just linear slope, akin to a random slope in lmer (M2).
M1<-gamm4(response ~ s(X1,k=4), random =~(1|ID),data)
M2<-gamm4(response ~ s(X1,k=4), random =~(X1|ID),data)
However, I'm unsure how to interpret the random slope X1 in M2. If positive, is it an overall increase in smoother 'wriggliness' i.e. increase in edf (opposite for negative)? Or is it something else? Would someone know how to visualise these 'random slopes' so I can get a feel for what is going on?
A manuscript by Pedersen and colleagues has recently been posted on PeeJ that explores related models within the gam function https://peerj.com/preprints/27320/. I'm happy to use these, but still would like to understand the random slope in a gamm4 context.
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models