Skip to content

glmmTMB: testing for temporal variation in effect of fixed predictor on response variable

2 messages · Thierry Onkelinx, Ben Bolker

#
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 at 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 at gmail.com

  
  
#
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 at r-project.org> wrote: