Type I vs Type II Error Simulator

Visualize the trade-offs between false positives and false negatives

Parameters

P(Type I Error) = α = Rejecting true H₀

Distance between H₀ and H₁ distributions

Larger samples increase power and reduce β

Distribution Visualization

Error Probabilities

Simulation Results

2×2 Confusion Matrix

Power vs Sample Size

Understanding Type I and Type II Errors

Type I Error (α): False Positive - Rejecting the null hypothesis when it is actually true. This is the significance level you set (e.g., 0.05 means 5% chance of false positive).

Type II Error (β): False Negative - Failing to reject the null hypothesis when it is actually false. This depends on effect size, sample size, and alpha.

Statistical Power (1-β): The probability of correctly detecting a true effect. Higher power means lower chance of missing a real difference.

The Trade-off: For a fixed sample size, lowering α (being more conservative) increases β (more likely to miss real effects). The solution is to increase sample size!

Decision Matrix

H₀ is True H₀ is False
Reject H₀ Type I Error (α) Correct (Power)
Fail to Reject H₀ Correct (1-α) Type II Error (β)