← back to statistics

Inference for Means

OpenIntro Statistics · CC BY-SA 3.0 · Chapter 7

When data are numerical, inference targets the mean. The t-distribution replaces the normal when the population standard deviation is unknown. ANOVA generalizes the two-sample test to any number of groups.

x̄1 x̄2 Group 1 Group 2

Compare independent groups with paired measurements before working through the t procedures. Read the guided introduction →

The design chooses the standard error

These are constructed quiz-score examples. Choose two independent groups of twelve people, or twelve people measured twice. The paired example has large differences between people but much smaller changes within a person.

Group A mean: 50.0. Group B mean: 53.0. Difference: 3.0 points.

95% interval for the mean difference · fixed −12 to 12 point scale
-10 points0 points10 points

Welch t: estimated difference 3.00, SE 1.33, df 21.9. 95% interval [0.25, 5.75]. Two-sided p-value 0.034 for a zero mean difference.

Read the measurements
Row (not a pair)AB
14852
25254
34749
45557
55055
64951
75353
84650
95158
105456
114547
125054

The paired method assumes independent people and approximately normal differences for this small sample. Welch’s method assumes independent groups and observations, with approximately normal populations for small samples; it allows unequal variances. Inspect data and design before using either method. Before-and-after changes alone do not establish causation.

One-sample t-test

Test whether a sample mean differs from a hypothesized value. The t-statistic replaces Z when sigma is unknown: t = (x-bar - mu0) / (s / sqrt(n)). It follows a wpt-distribution with n - 1 degrees of freedom. As n grows, t approaches Z.

Scheme

Two-sample t-test

Compare means from two independent groups. The standard error combines variability from both samples: SE = sqrt(s1^2/n1 + s2^2/n2). Degrees of freedom come from Welch's approximation when variances are unequal.

Scheme

Paired t-test

When observations come in pairs (before/after, matched subjects), compute the differences and run a one-sample t-test on those differences. This controls for subject-level variation that would inflate the two-sample SE.

Scheme

ANOVA and the F-distribution

Analysis of variance tests whether any group mean differs among k groups. It decomposes total variation into between-group (MSG) and within-group (MSE) components. The F-statistic = MSG / MSE follows an F-distribution with (k-1, n-k) degrees of freedom. A large F means the group means spread more than within-group noise would predict.

Scheme

Notation reference

Symbol Formula Meaning
t(x̄ - μ0) / (s/√n)t-statistic
dfn - 1Degrees of freedom (one-sample)
MSGSSG / (k-1)Mean square between groups
MSESSE / (n-k)Mean square within groups
FMSG / MSEF-statistic for ANOVA
Neighbors

Cross-references

Foundations (Wikipedia)