0

I am confused about how random effects are structured in my model. I've read the discussion about it Crossed vs nested random effects: how do they differ and how are they specified correctly in lme4?. But I'm still having doubts.

I measured the response in plants as Duration [in seconds] at two Ages [young and old] using the same plants. So, I think it's a repeated measures design with crossed random effects, because the same individuals were measured two times, first at T1, then at T2. I assumed it is not nested, because subjects are not independently measured at Age. My experimental design

My data:

plantID Age Duration Nleaves.plant
1 Young 1.33 18
1 Old 2.64 75
2 Young 4.68 14
2 Old 4.99 56
3 Young 3.34 26
3 Old 3.75 94

I think that I have a crossed design, so a model like this would be appropriate:

m <- glmmTMB(Duration~ Age+ Nleaves.plant +(1|plantID) + (1|Age), data=df, family = Gamma("log"))

But I also was wondering if this model is correct as well:

m2 <- glmmTMB(Duration~ Age+ Nleaves.plant + (Age|plantID), data=df, family = Gamma("log"))

My questions are:

  1. Which model is correctly specified?

Sorry about this question, I know that it has been adressed many times in this forum, but I am still confused on this topic. Thank you for your time.

M Sandoval
  • 13
  • 3

1 Answers1

1

The first model:

Duration~ Age+ Nleaves.plant +(1|plantID) + (1|Age)

...does not make sense because Age has only 2 levels plus it appears to be of primary interest in your research question. So it should be a fixed effect.

The 2nd model makes sense, provided that random slopes ate supported by the data.

Robert Long
  • 53,316
  • 10
  • 84
  • 148
  • Thank you for your response and time. I think you are right, it makes more sense to fit a model with random slopes and intercepts. – M Sandoval Sep 21 '21 at 16:05