mercredi 23 décembre 2020

Using a variable both as fixed and random effect?

We want to know whether leaf length depends on the amount of nutrients in the soil or by the family it originates from. We collected 10 seeds of the parent plant (i.e. the “family”) of which 5 are raised in the lab under high levels of available nutrients (“rich”) and 5 in a nutrient poor environment (“poor”). We have data from 10 such families. It is a split-plot design.

Normally we would add family as a random factor in a mixed model, but now we are also interested in the family effect as well. Can we include family both as a fixed factor and a random factor in our model? (R in RStudio)

model1 <- lmer(length~soil + FAM + (1|FAM) + (1|FAM:soil), data)

model2 <- lmer(length~soil + FAM + (1|FAM:soil), data)

Thanks in advance!

ps: it is a statistical exercise, the design cannot be changed




Aucun commentaire:

Enregistrer un commentaire