[R-sig-ME] random slopes in gamm4

René b|mono@om @end|ng |rom gm@||@com
Fri Apr 5 21:44:26 CEST 2019


Dear John,

I almost tend to say, you should ask Simon Wood, Fabian Scheipl directly :))
but, you know, in the gamm4 manual for formula they say: 'Note that ids for
smooths and fixed smoothing parameters are not supported.'
(Which I do not understand) But later it says:

gamm4 allows the random effects specifiable with lmer to be combined with
any number of any of the (single penalty) smooth terms available in gam from
package mgcv as well as t2 tensor product smooths. Note that the model
comparison on the basis of the (Laplace approximate) log likelihood is
possible with GAMMs fitted by gamm4.

Which I, honestly, again, absolutely do not understand. But it seems that
random slopes are about penalty smooth terms (how much you like them
to...). Interestingly, when clicking on 'gam' (to learn more), it redirects
me to the same page... which almost feels like magic (or buddhist).

And the second part of your question alarms me...  it seems that you want
to analyze residual terms (i.e. random errors, which by frequentist
definition are random), is this the case? Otherwise, whether positive or
negative, the mean of any random effect should be zero, and the residuals
should be normally (or appropriately) distributed. I would argue (as others
do), that any directed hypothesis should be part of the fixed effects. And
maybe the question is, whether there are better packages to do this, and
allow to predict the function parameters you are interested in (In case of
interest, check 'brms' and its non-linear function applications. You might
become happier with this, as it would be on you to define 'positive or
negative', and also with respect to the support.)

:)


Best wishes, René



Am Fr., 5. Apr. 2019 um 14:48 Uhr schrieb John Morrongiello <
john.morrongiello using unimelb.edu.au>:

> Hi all
>
>
>
> 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.
>
>
>
> Cheers
>
>
>
> John
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list