Parametric Tests
SciPy - Statistical Testing
2 min read
Published Nov 17 2025
Guide Sections
Guide Comments
Parametric tests assume (approximately) normal data and continuous measurements.
They are among the most commonly used statistical tests in practice.
One-Sample t-Test
Question: Does the mean of a sample differ from a specific value?
Used for:
- Comparing a sample to a known benchmark
- Checking whether a measurement meets a target
- Testing changes from a historical or expected mean
Example
Interpretation
p < 0.05→ sample mean is significantly different from 5.0p ≥ 0.05→ no significant difference
Independent Two-Sample t-Test
Question: Do two independent groups have different means?
Used for:
- A/B tests
- Male vs female comparisons
- Treatment vs control groups
Example
Welch’s t-test (if variances differ)
Interpretation
p < 0.05→ groups differ significantlyp ≥ 0.05→ no evidence of difference
Paired t-Test
Question: Do two related measurements differ?
Used when:
- Measurements are on the same subjects
- Before/after experiments
- Paired samples (e.g. left hand vs right hand)
Example
Interpretation
p < 0.05→ the before/after difference is significant- Good for clinical improvements, performance upgrades, etc.
One-Way ANOVA (3+ groups)
Question: Do 3 or more groups differ?
Used for:
- Comparing multiple product versions
- Multiple study groups
- Any ≥3 independent samples
Example
Interpretation
p < 0.05→ at least one group differs- Does not tell which groups differ (requires post-hoc tests)
Post-hoc example using Statsmodels
(Not SciPy, but commonly paired.)
wo-Way ANOVA (Not in SciPy)
SciPy only supports one-way ANOVA directly.
For factorial designs (e.g., "treatment × gender"), use Statsmodels:
Z-Tests (Statsmodels, not SciPy)
SciPy does not include z-tests, but Statsmodels does.
Two-sample z-test
Use for:
- Large samples (n > 30)
- Known population variance (rare)
One-sample z-test
Assumptions Checklist (Practical)
Parametric tests work well if:
- Data are roughly normal
- Measurements are continuous
- Groups have similar variances (for t-tests & ANOVA)
- Sample size is reasonably large (CLT helps)
If not:
- Use non-parametric tests
Quick Summary Table (Parametric Tests)
Goal | Test | SciPy Function |
Compare sample to known value | One-sample t-test |
|
Compare two groups | Independent t-test |
|
Compare two related measurements | Paired t-test |
|
Compare 3+ groups | One-way ANOVA |
|
Compare mean(s) using z | Z-tests |
|














