The seed-123 allocation had six pens per diet, but Diet C appeared in four Central-room pens.
That does not show that:
sample() failed
the allocation was non-random
the researcher should silently redraw
It shows that overall balance does not imply balance within every room.
Decide constraints first
Before generating an allocation, record:
the experimental unit
treatment replication
any scientifically justified blocks or restrictions
the random procedure
the checks that must pass
Then generate once, check, and retain the result.
Four records
Reproducible means complete
Keeping only the seed is insufficient.
set.seed(123)
The same seed can produce a different result if:
the unit order changes
the treatment vector changes
another random operation occurs first
the code changes
Audit without redesigning
Check that:
each experimental unit appears once
treatment totals match the design
pre-specified restrictions are satisfied
no predictable non-random rule replaced the draw
the retained table matches what is implemented
An audit checks the planned rules; it does not invent new rules after seeing the result.
Read and reflect
Read Ruxton and Colegrave, Chapter 7, sections 7.1–7.4, pp. 101–108.
As you read, answer:
What feature of random allocation limits researcher choice?
Why can a random allocation contain imbalance?
Which records would let another researcher audit your allocation?
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.