Model Specification

We want to model flowering time (y) as a function of replicate, donor taxon, inv4m genotype, and a random effect of donor plant.

The model equation is:

\[ y_{ijk\ell} = \mu + \text{Rep}_i + \text{DonorTaxa}_j + \text{Inv4mGenotype}_k + u_{\ell} + \varepsilon_{ijk\ell} \]

Where:

Implementation in R

Using lme4::lmer

library(lme4)
# Example model (assuming your dataset is called df)
mod_lmer <- lmer(
  y ~ Rep + donor_taxa + inv4m_genotype + (1 | donor_plant),
  data = df
)
summary(mod_lmer)

Using nlme::lme

library(nlme)
mod_lme <- lme(
  fixed = y ~ Rep + donor_taxa + inv4m_genotype,
  random = ~ 1 | donor_plant,
  data = df
)
summary(mod_lme)