Unit 3 — Randomisation and treatment allocation

Wednesday 16 September, 12:30–16:00

Planning and checking valid treatment allocations

This class develops randomisation into a practical method for allocating experimental units to treatments. We will use R to generate, check and record allocations, then introduce randomisation within blocks.

No preparation is required. Bring your laptop with R and RStudio available. We will recap the R commands needed for the workshop, using individual tidyverse packages and base R’s random sampling functions.

We will revisit experimental units and confounding, then work through a shared example allocating four diets to 24 pig pens in three rooms.

  • Build an allocation: follow the worked example using seed 123, then repeat it using your assigned group seed.
  • Audit the allocation: check that each pen appears once, count pens per diet and room, and plot the layout. Compare what changes with the seed and what stays fixed.
  • Randomise within rooms: allocate two pens to each diet in every room, then apply the method to your assigned extension case. Explain and justify the experimental unit, the restriction and the random allocation process.

Randomisation foundations Workshop slides Student worksheet

Read Chapter 7 of Ruxton and Colegrave, Experimental Design for the Life Sciences (4th edition), focusing on sections 7.1–7.4, pp. 101–108.

Review the two short follow-up videos:

  • Randomisation in practice: different seeds, chance imbalance and the records needed to reproduce an allocation.
  • Randomisation and blocks: why we might restrict randomisation within rooms, and how this prepares us for the next class on blocking and factorial designs using Lego.

Save your seed, code, ordered unit table and final allocation. Be ready to explain why a balanced allocation is not necessarily random.