1
$\begingroup$

I have a question regarding a linear mixed-effects model, specifically the random effects. I have taken one core in each zone (three Zones (U,L,P)) across five transects (T1-T5) and three seasonalities (A, J, O), each core was halved into two Horizons (upper, lower) and analysed separately. My main interestes are how lipid pattern changes across Zone, Season and Horizon.

I would like to run a linear mixed effects model, but I am uncertain how to inform the model of the dependency of my halved cores. I had considered creating a "plotID" from the Zone and Transect factors as a unique identifier and add the horizon as nested within this.

This is the code I have for now:

m3 <- lmer(Bacteria ~ Zone*Season*Horizon + (1 | PlotID)+(1 | Horizon:PlotID),df)   

Is this the correct way to identify this for the model?

Thank you in advance for your help

$\endgroup$

1 Answer 1

0
$\begingroup$

You have Horizon as both a fixed effect and a random effect. That's almost always not a good idea. It should be either fixed or random, and there are a bunch of competing considerations for when to include things as random such as:

  • when we don't care about the fixed effect of a factor
  • when a factor has a large number of levels
  • when we have sampled from larger population of levels
  • when we want to generalise the inferences to other levels of the factor that were not in our sample

The reasons for treating a factor as fixed are:

  • when the research question specifically concerns inference for that factor
  • when the factor has a relatively few number of levels
  • when we have the entire population of levels for that factor

In this case it is fairly clear that all these considerations point towards modelling Horizon as fixed:

  • because the research question involves inference on Horizon
  • because we have only 2 levels of Horizon
  • because the 2 levels of horizon are the entire population of horizons
$\endgroup$
5
  • $\begingroup$ Hello Robert, thank you very much for your kind reply, this has helped me a lot to identify what is missing in my model. I am now considering using the function: (1|Transect)+(1|PlotID: Transect) $\endgroup$
    – Maria R
    Commented Jul 22, 2021 at 14:42
  • $\begingroup$ No problem, you're welcome. Indeed, if plot is nested within transect, this would make sense, but what exactly is "plot" ? From the first paragraph, this is unclear. What is the relationship between plot, transect and zone ? $\endgroup$ Commented Jul 22, 2021 at 15:42
  • $\begingroup$ Hello Robert, Apologies, I did not make that very clear, the "plotID" is an identifier of each core (I just named it plot), consider it as "coreID". The Transects cut across the three Zones and within each Transect and Zone I took one core and halved it per sampling Season. $\endgroup$
    – Maria R
    Commented Jul 23, 2021 at 8:47
  • $\begingroup$ Ahh, OK that makes sense now - so yes I would agree that (1|Transect)+(1|PlotID: Transect) makes sense - the only possible difficulty is that you have only 5 transects that that's rather few for fitting random intercepts. You can still do it, but I would also fit a model with transect as a fixed effect instead, just to compare your inferences. $\endgroup$ Commented Jul 23, 2021 at 9:06
  • $\begingroup$ Does this answer your question ? If so please consider marking it as the accepted answer. If not, please let us know why. Also, if you haven't already, please consider upvoting it $\endgroup$ Commented Aug 21, 2021 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.