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.
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
A saved draft is open. To run the published example, open Editor tools and select Restore example. Recover draft brings your code back.
Execution error
Technical error details
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?
Your result
Result tools
The 120 readings come from six simulated sessions. The smaller reading-level error treats shared session variation as if each reading were independent.
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?
Hints for this question
- Find where the treatment assignment happens.
- Ask which observations share the same assignment and environment.