Unit 3 of 8 · about 6 hours · derive, measure

Intervals, hypothesis tests, power and effect size

Intervals and tests are statements about a model and a procedure. Checking coverage reveals whether the procedure earns its advertised uncertainty, while effect size says what the result means in practice.

You'll be able to

  • Derive a normal-mean confidence interval and test from a pivot, and distinguish confidence, credible and prediction intervals.
  • Explain null, alternative, statistic, p-value, Type I/II error, power and effect size without assigning a posterior probability to a p-value.
  • Measure interval coverage and the null p-value distribution using repeated independent samples.

Covers

Confidence, credible and prediction intervalsHypothesis tests, errors, power and effect size
1

Read

In this order, only the parts listed

0 of 4 done

  1. 14.310x Lecture 13: reliability, intervals and testsMIT 14.310x - Data Analysis for Social Scientists

    Slides 5 to 26, standard errors, confidence intervals and the chi-square and distributions; slides 28 to 38, the known- and unknown-variance normal-mean intervals; slides 40 to 74, hypotheses, error types, critical regions, the - trade-off and power for a simple alternative

    Say 'fail to reject' rather than 'accept'. Use the normal-sample assumption for exact inference. Leave experiment sample-size calculations to the design unit.

  2. 18.05 Class 17 reading: p-valuesMIT 18.05 - Inference practice

    Section 4.3, Significance level and power; Section 7, p-values; Section 7.1, Example: z-tests

    Work the normal -test, then stop; do not turn a p-value into the probability that a hypothesis is true.

  3. 18.05 Class 22 reading: pivoting and t intervalsMIT 18.05 - Inference practice

    Sections 3 to 5: interval statistics, z confidence intervals and t confidence intervals

  4. Murphy: posterior intervals and future observationsProbabilistic Machine Learning: An Introduction

    April 18, 2025 online edition: Section 4.6.6, p. 146, definition (4.192) and central-interval quantiles; Section 11.7.4, pp. 406 to 407, posterior predictive and observation-noise term

    Stop 4.6.6 before Monte Carlo quantile estimation and HPD regions. In 11.7.4 use the intercept-only model to separate a mean interval from a future-observation interval; do not implement Bayesian regression.

2

Focus on

  • For iid data with known , is standard normal. Inverting gives . Replacing by gives an exact pivot under normal sampling; for other distributions it is only approximate.
  • Coverage is . A credible interval contains specified posterior mass conditional on data and prior. A prediction interval covers a new , so it includes observation noise as well as uncertainty about the mean.
  • For a continuous exact null statistic with CDF , is uniform under the null. For a two-sided normal test, is also uniform. Discrete valid p-values can be conservative rather than uniform.
  • Power is for a specified alternative ; Type II error is its complement. Report in outcome units and a practical threshold, not only whether crosses .
Common mistakes · 3
  • Reading a 95% confidence interval as a 95% posterior probability for the fixed parameter in the realized interval.
  • Using the mean interval to cover individual outcomes. Its width shrinks to zero even when outcome noise remains.
  • Taking failure to reject as evidence of equivalence. A wide interval can include both zero and practically important effects.
3

Try it yourself

Closed-book, before checking anything

Derive the known- mean interval by pivoting, and derive the future-observation interval from , using independence of and the sample. By hand, for , and , the 95% mean interval is approximately [0.824, 3.176]; the prediction interval is [-3.996, 7.996]. Check in NumPy float64 with SciPy normal/t quantiles: rng = numpy.random.default_rng(43); first draw x = rng.normal(2, 3, size=(20000, 25)), then future = rng.normal(2, 3, size=20000). Use means by row, c = scipy.stats.norm.ppf(0.975), Z = (means - 2)/0.6 and p = 2*norm.sf(abs(Z)). Mean-interval coverage is 0.9503, prediction-interval coverage 0.95015, is 0.0497 and is 0.49905. Unknown- intervals using x.std(axis=1, ddof=1)/5 and scipy.stats.t.ppf(0.975, 24) cover 0.95165. Require maximum absolute deviation below 0.01 from the five theoretical rates [0.95, 0.95, 0.05, 0.5, 0.95]. This is simulation error, not exact equality. Seeded values came from NumPy 2.5.4 with SciPy 1.18.1.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.Show that the two-sided normal p-value is uniform under the null.Answer

    For , iff . Under the exact standard-normal null, symmetry gives two tails of probability , hence . The endpoints follow by continuity. Normality and a continuous null distribution are used in the tail calculation.

  2. 2.What changes if is estimated from the same small normal sample?Answer

    The standardized mean uses and has a distribution, not a standard normal distribution. Independence of the normal sample mean and variance justifies this pivot. Using normal critical values ignores extra variance-estimation uncertainty.

  3. 3.Why does a future-observation interval not shrink to zero with n?Answer

    Independent future noise contributes to , while estimating the mean contributes . Only the second term vanishes.

  4. 4.Can a 95% Bayesian credible interval have less than 95% frequentist coverage?Answer

    Yes. It has 95% posterior mass under its prior and model. Repeated-sampling coverage at a fixed parameter is a different property and can be poor, especially with a mismatched strong prior.

5

Practice

  • 18.05 Problem Set 10: Soda and Probabilities for hypotheses

    Problem 2(a to c), Soda, p. 1; Problem 5(a to c), Probabilities for hypotheses, pp. 2 to 3

    Attempt before opening the official solutions linked on the course Problem Sets page. You may use NumPy/SciPy instead of R; distinguish interval coverage from posterior mass. In 5(b), means standard deviation 5, as the next sentence states. The official 98% interval in 2(c) prints a half-width of 3.89; its endpoints [352.20, 359.80] use the correct 3.80.

You're done when

You derive both intervals, pass the five rate checks, solve the two named problems, and explain why neither nor confidence level is a posterior hypothesis probability.

Only when you can do this without notes.

Leads to

Notes

Resources · 3 for this unit, 5 more in the section
  • MIT 14.310x - Data Analysis for Social ScientistsMIT OpenCourseWare · primary

    Follow lectures 11-15, 17-20 and 22 with matching slides and problem sets for inference, regression, causality and experiment design.

  • MIT 18.05 - Inference practiceMIT OpenCourseWare · required

    Use classes 17-20, 22-24 and 26 with their problem sets for tests, intervals, bootstrap and regression.

  • Probabilistic Machine Learning: An IntroductionKevin P. Murphy · reference

    Use the April 18, 2025 online edition: Sections 4.2.3 to 4.2.5, 4.5.1 and 4.6.4.1 for Bernoulli and Gaussian MLE/MAP; the definition and central intervals in 4.6.6; 2.1.2 and 11.7.4 for predictive uncertainty. Exercises 4.1 and 4.2 supply derivation practice.

Also in this section

  • Causal Inference: What IfHernán & Robins · required

    Read Chapters 1-3 and 6-8 for causal effects, DAGs, confounding, selection bias and identification reasoning.

  • Patterns of trustworthy experimentationMicrosoft ExP · required

    Read after the course to connect health checks, guardrails and statistical interpretation to production launch decisions.

  • Always Valid InferenceJohari, Pekelis & Walsh · depth

    Use the introduction and worked motivation to understand optional-stopping failure. Reproducing the theory is outside this gate.

  • Permutation nulls and false discovery controlSciPy · reference

    Read permutation_test Notes, Unpaired statistics, for exchangeability and exact partitions; false_discovery_control Notes and the named thrombolysis example for Bonferroni and Benjamini-Hochberg. Use as an independent implementation oracle, not as a substitute for stating assumptions.

  • Probability calibration: the statistical propertyscikit-learn · reference

    Read the opening calibration definition, the proper-scoring-rule note, and Section 1.16.1, Calibration curves. Stop before recalibration methods; the later Classical ML unit implements them.