I am trying to analyse a split plot design for a plant growth experiment with the following variables:

  • Biomass (dependent variable)
  • Transect (sub plot factor with three levels)
  • Treatment (main plot factor with two levels)
  • Block (2 blocks in total, serving as replicates of the treatment)
  • Location (multiple locations within each transect point)

I know what the random effect structure should look like. However, I can’t work out how to write this in R script. Could someone please help me? It’s probably very easy, but I have been looking for hours and hours and can’t find it.

Random effects should be:

  • Block
  • Interaction Block and Treatment
  • Location nested within Transect
  • (Location nested within Transect), interaction with Treatment

So perhaps something like: (1|block)+(1|block*treatment)+(1|location:transect) +(1|(location:transect)*treatment)


1 Answer 1


I have found this article helpful for analyzing split-plots in R: http://personal.psu.edu/mar36/stat_461/split_plot/

Based on comments from your question on stack overflow, "Seeds were collected from plants along three independent transects and within each transects from different sublocations."
I would consider the "Location" variable as repeats or subsample from each Transect and not include it as a factor in the model. It ensure the error is calculated correctly, I would average each group of repeats/subsamples together and then perform the anova.

#in Base R
res.good <- aov(Biomass ~ Transect * Treatment +Error(Block:Transect), data=data)

#With the lme4 library
rmodel <- lmer(Biomass ~  Transect*Treatment + (1|Transect:Block), data = data)

Without running this on sample data, it is difficult to know if the degree of freedom works out correctly.
I'll welcome any comments or corrections. Good luck


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.