1

I want to fit a linear mixed effect model with a response variable called "PhiPS2", along with independent variables such as habitat, season, and species. However, I'm not sure which of these independent variables should be the random effect.

The experimental design looks like this- the PhiPS2 is measured in different plants from different habitats. Different habitats have different species, but few of the species are occurring in more than one habitat. I have total of 310 individual plants, comprising of 10 species from 5 different habitats. and 3 out of 10 species occurring in more than one habitat (10 species, 5 replicates, 5 habitat types, 4 times(June-Sept = season)). There is no pseudoreplication, because each time, different plant individual is measured from the same habitat.

I am hoping to find answer to the following questions:

  1. How PhiPS2 value varies with habitat seasonally (I think species variation should be considered as it explains a large proportion of variation.
  2. How PhiPS2 value varies for each species in different habitat seasonally.

Maybe there is a partially crossed random effect. Not sure. Please suggest an R code for this model fitting. Below are some candidate models:

First Model

M1 <- lmer(PhiPS2 ~ habitat + season + (1|species), REML = F, data = physio2)

Second Model

M2 <- lmer(PhiPS2 ~ habitat * season + (1|species), REML = F, data = physio2)

Third Model

M3 <- lmer(PhiPS2 ~ habitat * season + (1 + species|habitat), REML = F, data = physio2)
T.E.G.
  • 2,332
  • What is sampling number here? – Shawn Hemelstrand Jan 14 '24 at 21:36
  • I have 310 sample number. 310 individual plants, comprising of 10 species from 5 different habitats. and 3 out of 10 species occurring in more than one habitat. – scholar101 Jan 14 '24 at 21:38
  • Is each individual plant measured multiple times then? I saw you mentioned there is a seasonality aspect to this, but wasn't sure if I missed something there (the code doesn't seem to include anything related to season, which I'm sure was part of your own confusion). – Shawn Hemelstrand Jan 14 '24 at 21:42
  • What question(s) are you trying to answer with this model? – CFD Jan 14 '24 at 22:31
  • @ShawnHemelstrand I have modified the question. I have season here, just have used a confusing nomenclature. Its clear now, I guess. CFD I have the research question that I expect to answer in the question. Thanks – scholar101 Jan 14 '24 at 23:01
  • You wrote “(10 species, 5 replicates, 5 habitat types, 4 times).” What is the meaning of replicates? Also, does the variable season correspond to times here? – T.E.G. Jan 15 '24 at 00:21
  • Season corresponds to no of times the measurements were done- June, July, August, September. and replicates meaning each time 5 number of individuals were measured. For instance - species 1 in habitat type 1 were measured 5 times in June, species 1 in habitat type 1 were measured 5 times in July, species 1 in habitat type 1 were measured 5 times in August, and species 1 in habitat type 1 were measured 5 times in September. @T.E.G. – scholar101 Jan 15 '24 at 07:25
  • 1
    See my answer to your other post: https://stats.stackexchange.com/a/636941/87305 – Erik Ruzek Jan 15 '24 at 21:47

0 Answers0