Design a fair testLesson 09 of 30 · 7 min

One hundred readings, how many experiments?

Identify the experimental unit and avoid counting repeated readings as independent replications.

The experimental unit is the smallest unit assigned a treatment independently. Repeated readings within that unit are subsamples. Ten measurements from one prepared batch do not create ten independently prepared batches.

Measurements from the same session can share cache state, temperature or background load. Treating them as independent can make uncertainty look much smaller than the between-session evidence justifies. This is often called pseudoreplication.

The simulated array has six sessions and twenty readings per session. Each session gets a shared random offset plus small reading noise. A standard error estimates how much an estimated mean would vary across repeated experiments. Compare one computed as if all readings were independent with one computed from session means. The relevant count depends on the question and assignment, not the file's row count.

Count sessions, not just readings
S1S2S3S4S5S620 readings per session
S1S2S3S4S5S620 readings per session
Structure of the seeded model: six independent session offsets, with twenty readings per session. The dots are subsamples. More readings within a session do not create more independent sessions.

Which calculation notices that an entire session can be unusually slow?

Write a prediction (optional)

Run the prepared example

This page puts the example in the Python editor. Select Run Python with the code unchanged.

Seeded simulation

Editor tools
About Python ↗

Ctrl+Enter or ⌘+Enter runs the code.

What to compare

Find the two counts in Sessions, readings/session. Compare SE assuming independent readings (ms) with SE across session means (ms). Which calculation uses one value from each session?

Published example output

The site ran the original code to produce this reference. Build environment ↗

Sessions, readings/session: (6, 20)
SE assuming independent readings (ms): 0.65
SE across session means (ms): 3.14
Session means (ms): [ 95.19 102.99 106.99  88.59 109.   103.08]

The 120 readings come from six simulated sessions. The smaller reading-level error treats shared session variation as if each reading were independent.

Change and run again

In the Python editor, change readings_per_session from 20 to 200. Select Run Python again. Compare the two counts and the two SE lines with the first run. Which count tells you how many independent sessions the model still contains? Return to the Python editor

What this example supports. The session model assumes independent session offsets. Repeated sessions on the same device may still share trends; independence needs a design argument.

Try a fresh case

A fertiliser is assigned to four plots, with 50 plants measured in each. How many independently assigned units are there?

Choose an answer

Hints for this question
  1. Find where the treatment assignment happens.
  2. Ask which observations share the same assignment and environment.
Your notes