0
$\begingroup$

I have data from a field survey. The objective of the study is to relate number of seedling (respond variable, count data), flood duration (exploratory variable, categorical variable with 3 levels) and percent canopy coverage (exploratory variable, quantitative).

In each flooding duration, I have data from five 25x25 meter plots. The plots were randomly placed throughout study site, so I do not think they are dependent. Within each plot I used three 2x2 meter subplots nested within the bigger plot, and number of seedlings were count from these subplots. Total number of observations is 45; 3 flood levels x 5 plots x 3 subplots.The data looks like this.

enter image description here

I am new to mixed effect model, and from my understanding the subplots nested within plots. I would like to do this using lmer as follows.

Model <- lmer(seedling ~ flood duration * canopy  + (1|plot/subplots), data = mydata)

I am not sure about the (1|plot/subplots) term. Is the term correct?

Just a bit about syntax, as @Dimitris Rizopoulos mentioned that because in mydata, the sub-plots index numbers are not the same within each plot (in my case subplots 1-1, 1-2, and 1-3 are within plot 1 only), I could use glmer (seedling ~ flood duration * canopy + (1 | plot) + (1 | subplots), data = mydata, family = poisson()). From my understanding that I might be wrong the “(1 | plot) + (1 | subplots)” is a way to tell R that these are crossed random effect. However, because my sub-plots index numbers are not the same within each plot, R will know that these are nested effect, and this syntax will give the same result as glmer (seedling ~ flood duration * canopy + (1 | plot/subplots), data = mydata, family = poisson()). Is this understanding correct?

$\endgroup$

closed as off-topic by jbowman, Michael Chernick, kjetil b halvorsen, mkt, mdewey Oct 12 '18 at 13:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – jbowman, Michael Chernick, kjetil b halvorsen, mkt, mdewey
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Thank you very much Prof. @Dimitris Rizopoulos.Thank you very much. I would like just to make sure that I understand some points of your answer correctly. You mentioned that I have only 45 observations and I should start with random intercept for the plot level. To do this is glmer (seedling ~ flood duration * canopy + (1 | plot), data = mydata, family = poisson()) a correct syntax for the random intercept for the plot level only ? $\endgroup$ – Ponlawat Oct 11 '18 at 10:47
  • $\begingroup$ Yes, this indeed correct. $\endgroup$ – Dimitris Rizopoulos Oct 11 '18 at 11:27
  • $\begingroup$ a bit about syntax, @Dimitris Rizopoulos because in mydata, the sub-plots index numbers are not the same within each plot (in my case subplots 1-1, 1-2, and 1-3 are within plot 1 only), I could use (1 | plot) + (1 | subplots). From my understanding that I might be wrong the “(1 | plot) + (1 | subplots)” is a way to tell R that these are crossed random effect. However, because my sub-plots index numbers are not the same within each plot, R will know that these are nested effect, and this syntax will give the same result as (1 | plot/subplots), Is this understanding correct? $\endgroup$ – Ponlawat Oct 11 '18 at 11:33
  • $\begingroup$ Check the last bullet in this section of the GLMM FAQ: bbolker.github.io/mixedmodels-misc/… $\endgroup$ – Dimitris Rizopoulos Oct 11 '18 at 11:38
3
$\begingroup$

A couple of observations:

  • Since your outcome variable, seeding, is a count, you would need a Poisson mixed effects model rather than a linear mixed model (the latter being used for normally distributed outcomes). To fit a Poisson mixed model, you need to use glmer(..., family = poisson()).
  • Given that you only have 45 observations, I would first start with random intercepts at the plot level, and then see if you need nested intercepts for the sub-plot level.
  • Because the sub-plots index numbers are not the same within each plot, you could use the following syntax: glmer(seedling ~ flood duration * canopy + (1 | plot) + (1 | subplots), data = mydata, family = poisson()).
$\endgroup$

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