Challenge your conclusionLesson 21 of 30 · 6 min
What would happen without the effect?
Construct a reference distribution under a stated no-effect model.
A null hypothesis is a specific statistical claim used as a reference, such as a population mean difference of zero. A null model adds the assumptions needed to predict what data would look like under that claim.
A test statistic compresses the data into a quantity that is sensitive to the departure you care about. Here it is the mean difference. Simulate independent normal differences centred at zero, then calculate a mean for each simulated experiment.
Compare the observed statistic with this null distribution. For a two-sided test based on absolute mean difference, values at least as far from zero count as extreme. The fraction estimates a tail probability under this specified model. It is not the probability that the null hypothesis is true.
- Null-model means
- At least as extreme
Under a zero-mean model, must every sample mean be zero?
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 null 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 Fraction at least as extreme. The histogram shows differences from simulated experiments with no mean effect. Why can some simulated means lie as far from zero as −5 ms?
Your result
Result tools
The simulated means vary from sample to sample even with a population mean of zero. Both tails count because this comparison uses distance from zero.
Published example output
The site ran the original code to produce this reference. Build environment ↗
Simulated null experiments: 5000 Fraction at least as extreme: 0.0224
The simulated means vary from sample to sample even with a population mean of zero. Both tails count because this comparison uses distance from zero.
Change and run again
In the Python editor, change observed_mean = -5.0 to observed_mean = -1.0 and select Run Python. Then change noise_sd_ms from 10 to 20 and run again. Compare Fraction at least as extreme after each change. Which change moves the observed value and which spreads out the reference? Return to the Python editor
What this example supports. The noise level is treated as known in this simulation. Real tests usually estimate nuisance quantities and require their own assumptions.
Try a fresh case
A null model assumes independent observations. If your observations share session-level noise, what is the concern?
Hints for this question
- Think about the session example.
- A model must represent how whole experiments vary, not just individual values.