Inferential Statistics: Confidence Intervals, Hypothesis Testing, and P-Values
Learn how inferential statistics lets you draw conclusions about populations from samples — confidence intervals, hypothesis testing, p-values, Type I and II errors, and common misconceptions.
Inferential Statistics: Confidence Intervals, Hypothesis Testing, and P-Values
Inferential statistics takes data from a sample and uses it to draw conclusions about a larger population. Instead of describing only what you observed (descriptive stats), you make probabilistic statements: "We are 95% confident that..." or "This result is unlikely to have occurred by chance."
---
What Is Inferential Statistics?
| Descriptive Statistics | Inferential Statistics |
|---|---|
| Summarize the data you have | Generalize beyond your data |
| "The sample mean is 42" | "The population mean is likely between 38 and 46" |
| No probability statements | Uses probability to quantify uncertainty |
---
Population vs Sample
| Term | Definition |
|---|---|
| Population | The entire group you want to study (all customers, all products, all transactions) |
| Sample | A subset of the population you actually measure |
Key idea: Sample statistics (mean, proportion) vary from sample to sample. Inferential statistics quantifies this variation and helps you account for it.
---
Sampling Distributions
The sampling distribution is the distribution of a statistic (e.g., sample mean) across many hypothetical samples.
- Central Limit Theorem: For large enough samples, the sampling distribution of the mean is approximately Normal, regardless of the population shape.
- Standard Error (SE): The standard deviation of the sampling distribution. For the mean: SE = σ / √n, where σ is the population SD and n is the sample size.
- Larger samples → smaller SE → more precise estimates.
Confidence Intervals
A confidence interval (CI) is a range of values that likely contains the true population parameter.
What They Are
A 95% confidence interval means: If we repeated the sampling process many times and computed a 95% CI each time, about 95% of those intervals would contain the true parameter.
How to Interpret
| Correct Interpretation | Incorrect Interpretation |
|---|---|
| "We are 95% confident the true mean lies in [a, b]" | "There is a 95% probability the mean is in [a, b]" |
| The interval is random; the parameter is fixed | The parameter is random |
| 95% refers to the method, not this single interval | "The mean has a 95% chance of being in this interval" |
Common Misconceptions
- "95% of the data falls within the CI" — No. The CI is about the parameter (e.g., mean), not about individual data points.
- "Narrow CI = more significant" — Narrow means more precise, not more significant. Significance is about hypothesis testing.
- "CI of [0.1, 0.2] means the true value is probably 0.15" — The true value could be anywhere in the interval with equal plausibility under the model.
Formula (Mean, Known σ)
CI = sample mean ± (z × SE)
For 95% CI, z ≈ 1.96. For 99% CI, z ≈ 2.576.
---
Hypothesis Testing Framework
Hypothesis testing asks: "Is the observed result consistent with a null hypothesis, or should we reject it?"
The Steps
| Step | Description |
|---|---|
| 1. Null Hypothesis (H₀) | Default assumption (e.g., "no difference," "no effect") |
| 2. Alternative Hypothesis (H₁) | What you want to show (e.g., "there is a difference") |
| 3. Test Statistic | A number computed from the data (e.g., t, z, F) |
| 4. P-Value | Probability of obtaining a result at least as extreme as observed, if H₀ were true |
| 5. Decision | Reject H₀ if p < α; otherwise fail to reject |
Example
- H₀: The mean delivery time for Method A equals Method B (μA = μB)
- H₁: The means differ (μA ≠ μB)
- Test: Two-sample t-test → p = 0.03
- Decision: If α = 0.05, reject H₀. The difference is statistically significant.
Understanding P-Values
What a P-Value Is
The p-value is the probability of observing data at least as extreme as yours, assuming the null hypothesis is true.
- Small p (e.g., p = 0.01): The data would be unusual if H₀ were true → evidence against H₀.
- Large p (e.g., p = 0.50): The data would be common if H₀ were true → little evidence against H₀.
What a P-Value Is NOT
| Myth | Reality |
|---|---|
| "P is the probability H₀ is true" | P assumes H₀ is true; it does not give P(H₀) |
| "P = 0.05 means 95% chance we're right" | No. It means ~5% chance of such data if H₀ is true |
| "P measures effect size" | P combines effect size and sample size; a tiny effect can be significant with large n |
| "P = 0.06 means 'almost significant'" | Dichotomous thinking is misleading; report the actual p-value |
Interpreting P-Values
| P-Value Range | Common Interpretation |
|---|---|
| p < 0.001 | Very strong evidence against H₀ |
| 0.001 ≤ p < 0.01 | Strong evidence |
| 0.01 ≤ p < 0.05 | Moderate evidence (often called "significant") |
| 0.05 ≤ p < 0.10 | Weak evidence; sometimes called "marginally significant" |
| p ≥ 0.10 | Little or no evidence against H₀ |
Significance Levels (Alpha)
α (alpha) is the threshold for rejecting H₀. Common choices: 0.05, 0.01, 0.10.
- α = 0.05: We reject H₀ if p < 0.05. This is the most common choice.
- α = 0.01: Stricter; fewer false rejections, but more missed true effects.
- α = 0.10: More lenient; useful when missing an effect is costly.
Type I and Type II Errors
| Error | Definition | Probability |
|---|---|---|
| Type I (False Positive) | Reject H₀ when it's true | α (significance level) |
| Type II (False Negative) | Fail to reject H₀ when it's false | β |
| Situation | Your Decision |
|---|---|
| H₀ True, you reject | Type I error |
| H₀ True, you don't reject | Correct |
| H₀ False, you reject | Correct (power) |
| H₀ False, you don't reject | Type II error |
One-Tailed vs Two-Tailed Tests
| Type | Alternative Hypothesis | When to Use |
|---|---|---|
| Two-tailed | H₁: parameter ≠ value | You care about any difference |
| One-tailed | H₁: parameter > value (or < value) | You care only about direction |
- Two-tailed: "Is there any difference?" (increase or decrease)
- One-tailed: "Does it lower blood pressure?" (only decrease)
---
Practical Workflow
- Define H₀ and H₁ — Be clear about what you're testing.
- Choose α — Usually 0.05.
- Select the test — Match the test to your data (see [Statistical Tests Guide](statistical-tests-guide)).
- Check assumptions — Normality, independence, etc.
- Compute test statistic and p-value.
- Make a decision — Reject or fail to reject H₀.
- Report effect size and confidence interval — Don't rely on p alone (see [Effect Size and Power](effect-size-power-analysis)).
Common Misconceptions Summary
| Misconception | Correction |
|---|---|
| "Rejecting H₀ proves H₁" | It provides evidence against H₀, not proof of H₁ |
| "Failing to reject H₀ proves H₀" | It means insufficient evidence; H₀ might still be false |
| "P < 0.05 = important effect" | Significance ≠ practical importance; check effect size |
| "One test is enough" | Consider multiple testing correction (see [Post-Hoc Tests](post-hoc-multiple-testing)) |
| "P-hacking is OK" | Pre-register hypotheses; avoid data snooping |
Quick Reference
| Concept | Formula or Rule |
|---|---|
| 95% CI for mean | x̄ ± 1.96 × (s/√n) |
| Standard error | SE = s / √n |
| Reject H₀ if | p < α |
| Type I error rate | α |
| Power | 1 − β |
What's Next?
- [Statistics Overview](statistics-overview) — The statistics workspace and workflow
- [Probability Distributions](probability-distributions) — Understanding the shapes behind tests
- [Statistical Tests Guide](statistical-tests-guide) — Choose and run the right test
- [Effect Size and Power Analysis](effect-size-power-analysis) — Beyond p-values: practical significance
Related Articles
Statistics Overview: What Are Statistics and How to Use Them
A beginner-friendly introduction to statistics, descriptive vs inferential analysis, the Statistics workspace layout, and running your first analysis.
Probability Distributions: Understanding How Data Is Shaped
Learn about the most important probability distributions — Normal, Binomial, Poisson, Uniform, and Exponential — and how they help you understand and model real-world data.
Statistical Tests
A complete guide to all 14+ hypothesis tests -- when to use each one, how to run them, and how to interpret results.
Effect Size and Power Analysis: Beyond Statistical Significance
Why p-values aren't enough — learn effect size (Cohen's d, Pearson r, eta-squared), statistical power, sample size planning, and how to avoid underpowered studies and trivial significant results.
Was this helpful?