Set the null hypothesis, the true population mean, and see how often we reject H₀
Scenario: H₀: μ = 0 vs H₁: μ ≠ 0. The null hypothesis is FALSE (true μ = 0.5 ≠ 0). Failures to reject are Type II errors.
| H₀ is True | H₀ is False | |
|---|---|---|
| Reject H₀ | Type I Error (α) | Correct (Power = 1 − β) |
| Fail to Reject H₀ | Correct (1 − α) | Type II Error (β) |
Set the true mean equal to the null mean to observe Type I errors. Set them differently to observe power and Type II errors.
Power is the probability of correctly rejecting a false null hypothesis. It depends on three factors:
For a z-test with known σ, the power for a two-tailed test is:
A key insight from this simulation:
This is why the p-value histogram is one of the most important diagnostic plots in statistics — it reveals whether there is a signal or just noise.
Set the null hypothesis, the true population mean, and see how often we reject H₀
Scenario: H₀: μ = 0 vs H₁: μ ≠ 0. The null hypothesis is FALSE (true μ = 0.5 ≠ 0). Failures to reject are Type II errors.
| H₀ is True | H₀ is False | |
|---|---|---|
| Reject H₀ | Type I Error (α) | Correct (Power = 1 − β) |
| Fail to Reject H₀ | Correct (1 − α) | Type II Error (β) |
Set the true mean equal to the null mean to observe Type I errors. Set them differently to observe power and Type II errors.
Power is the probability of correctly rejecting a false null hypothesis. It depends on three factors:
For a z-test with known σ, the power for a two-tailed test is:
A key insight from this simulation:
This is why the p-value histogram is one of the most important diagnostic plots in statistics — it reveals whether there is a signal or just noise.