Seed 123 was balanced overall, but not within rooms.
Why room might matter
Rooms may differ in:
temperature or ventilation
routine or staff access
light, noise or disturbance
equipment and measurement conditions
If those differences may affect the response, room is a plausible source of nuisance variation.
Restrict the draw
Instead of shuffling all 24 labels together:
place eight pens in each room group
provide two labels for each diet in each room
shuffle those eight labels within that room
repeat independently for all rooms
The restriction fixes within-room replication; chance still fixes pen positions.
The R structure
library("tibble")library("dplyr")pens <-tibble(pen_id =sprintf("P%02d", 1:24),room =rep(c("North", "Central", "South"), each =8),position =rep(1:8, times =3))set.seed(123)allocation_blocked <- pens |>group_by(room) |>mutate(diet =sample(rep(c("Control", "Diet A", "Diet B", "Diet C"), each =2 ))) |>ungroup()
Name the design
Block: a group of experimental units expected to be relatively similar.
Randomised complete block design:
room is the block
pen remains the experimental unit
every block contains all four diet treatments
treatments are randomised among pens within each block
Not a fixed pattern
Both arrangements could place two labels per diet in each room:
randomly shuffle the eight labels within the room
repeat Control, A, B, C, Control, A, B, C
Only the first is randomised. The second may align treatment with a position pattern and is predictable.
A trade-off
Blocking is helpful when blocks capture important variation.
It also:
adds structure to allocation and analysis
needs enough units for treatment replication within blocks
can be inefficient if blocks are not informative
must be planned before looking at outcomes
Next class
In the Lego activity, you will:
build blocked designs physically
distinguish blocks from treatment factors
construct factorial treatment combinations
inspect what can be estimated from each design
For now, remember: restrict for a stated design reason, then randomise within the restriction.
Sources
Ruxton, Graeme D., and Nick Colegrave. 2016. Experimental Design for the Life Sciences. 4th ed. Oxford: Oxford University Press. Chapter 7, sections 7.1–7.4, pp. 101–108. ISBN 978-0-19-871735-5. Publisher page.
R Core Team. 2026. R: A Language and Environment for Statistical Computing. Vienna: R Foundation for Statistical Computing. R project.
Wickham, Hadley, et al. 2019. “Welcome to the tidyverse.” Journal of Open Source Software 4 (43): 1686. doi:10.21105/joss.01686.