[R-sig-ME] glmmTMB: testing for temporal variation in effect of fixed predictor on response variable

Ben Bolker bbolker @ending from gm@il@com
Wed Nov 7 17:42:32 CET 2018


  Yes, to amplify slightly: suppose you have categorical fixed effects
f1, f2, f3 and continuous fixed effect x1.

  The most complete random-effects model would be (1+f1+f2+f3+x1|year)
 (assuming that all of the fixed effects vary among years and so it
even makes sense to estimate year-by-effect variation), but this is
very likely to be too complex to fit, especially if your categorical
predictors have more than 2 levels.

  (1|year) + (1|f1:year) + (1|f2:year) + (1|f3:year) + (0+x1|year)

would be a reasonable simplification (this only fits 5 variance
parameters), but does assume that the effects vary independently.

  Also note that likelihood ratio tests of variance components are
generally conservative (see details at
http://bbolker.github.io/mixedmodels-misc/glmmFAQ.html#testing-significance-of-random-effects
)
On Wed, Nov 7, 2018 at 10:53 AM Thierry Onkelinx via
R-sig-mixed-models <r-sig-mixed-models using r-project.org> wrote:
>
> Dear Brenna,
>
> Please keep the mailing list in cc.
>
> (1 + fixed|year) fits a random intercept and a random slope along "fixed"
> for every "year". Keep in mind that you need enough data to support such a
> model. See e.g.
> https://www.muscardinus.be/2018/02/highly-correlated-random-effects/
>
> Best regards,
>
> ir. Thierry Onkelinx
> Statisticus / Statistician
>
> Vlaamse Overheid / Government of Flanders
> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
> FOREST
> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
> thierry.onkelinx using inbo.be
> Havenlaan 88 bus 73, 1000 Brussel
> www.inbo.be
>
> ///////////////////////////////////////////////////////////////////////////////////////////
> To call in the statistician after the experiment is done may be no more
> than asking him to perform a post-mortem examination: he may be able to say
> what the experiment died of. ~ Sir Ronald Aylmer Fisher
> The plural of anecdote is not data. ~ Roger Brinner
> The combination of some data and an aching desire for an answer does not
> ensure that a reasonable answer can be extracted from a given body of data.
> ~ John Tukey
> ///////////////////////////////////////////////////////////////////////////////////////////
>
> <https://www.inbo.be>
>
>
> Op wo 7 nov. 2018 om 14:18 schreef Brenna Levine <levine.brenna.a using gmail.com
> >:
>
> > Hi Thierry,
> >
> > Thanks for your detailed response. I have one fixed effect that is not
> > discrete. How should I fit this interaction in this case?
> >
> > Thanks!
> >
> > Brenna
> >
> > On Wed, Nov 7, 2018, 3:35 AM Thierry Onkelinx <thierry.onkelinx using inbo.be
> > wrote:
> >
> >> Dear Brenna,
> >>
> >> Adding a random effect (1|year:fixed) makes sense, assuming that both
> >> year and fixed are discrete. Note that adding this allows for a very
> >> liberal temporal variantion by the fixed effect. Each level of the
> >> interaction is independent from all other levels.
> >>
> >> Best regards,
> >>
> >> ir. Thierry Onkelinx
> >> Statisticus / Statistician
> >>
> >> Vlaamse Overheid / Government of Flanders
> >> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE
> >> AND FOREST
> >> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
> >> thierry.onkelinx using inbo.be
> >> Havenlaan 88 bus 73, 1000 Brussel
> >> www.inbo.be
> >>
> >>
> >> ///////////////////////////////////////////////////////////////////////////////////////////
> >> To call in the statistician after the experiment is done may be no more
> >> than asking him to perform a post-mortem examination: he may be able to say
> >> what the experiment died of. ~ Sir Ronald Aylmer Fisher
> >> The plural of anecdote is not data. ~ Roger Brinner
> >> The combination of some data and an aching desire for an answer does not
> >> ensure that a reasonable answer can be extracted from a given body of data.
> >> ~ John Tukey
> >>
> >> ///////////////////////////////////////////////////////////////////////////////////////////
> >>
> >> <https://www.inbo.be>
> >>
> >>
> >> Op wo 7 nov. 2018 om 00:16 schreef Brenna Levine <
> >> levine.brenna.a using gmail.com>:
> >>
> >>> Dr. Bolker,
> >>>
> >>> I'm hoping that I might be able to bother you with a quick question. I am
> >>> trying to *test whether there is significant temporal variation in the
> >>> effect of a fixed predictor on my response variable *with a model in
> >>> which
> >>> year is specified as a random effect (I have 20 years of data).
> >>> Currently,
> >>> I am doing this by fitting an interaction between the fixed effect and
> >>> the
> >>> random effect of year as* (1|year:fixed)* (per a recommendation that I
> >>> saw
> >>> on RSeek.org at some point and some tips that I have read on this
> >>> list-serve), and am testing the significance of this random interaction
> >>> with a LRT (i.e., with a model lacking this interaction).
> >>>
> >>> Could you tell me if (a) (1|year:fixed) is the correct way to specify
> >>> this,
> >>> and (b) if not, do you have a recommendation for how I should specify
> >>> this
> >>> interaction to test for temporal variation in the effect of a fixed
> >>> predictor on my response variable?
> >>>
> >>> Thanks.
> >>>
> >>>         [[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]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



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