← All topics

Step 3 · Methods · Topic 8 of 17 · 8 min

Comparing two groups

For two groups, choose a method from the data structure: independent observations or matched pairs. Each design has parametric and rank-based methods.

In short#

  • Independent groups: Welch's t-test uses t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂) and approximate Welch-Satterthwaite degrees of freedom. Student's t-test assumes a common group variance.
  • The paired t-test analyses differences within n complete pairs: t = d̄ / (s_d / √n), df = n − 1. Normality concerns the differences, not each measurement separately.
  • Rank-based methods include Mann-Whitney U for independent groups and Wilcoxon signed-rank for pairs. A Mann-Whitney location-shift interpretation requires similar distribution shapes. Interpreting Wilcoxon as a test of change in central location requires symmetric paired differences.
  • Pairing comes from design (the same object before and after), not from equal group sizes.

In plain words#

First identify the observational unit and how values are linked. Different units in two groups usually form an independent design; repeated measurements or units matched in advance form pairs. Equal group sizes alone do not create pairing.

Paired analysis uses the difference within each pair. It can improve precision when paired values are positively correlated, but this is not guaranteed. Pairs must follow the study design and be complete; in Linza, if one value is missing, exclude both values in that pair.

Welch's test does not require equal variances and is often a reasonable default for independent groups. It assumes independent observations. Normality of errors matters most with small n; strong skew and outliers can affect inference.

In Linza#

  1. Create a Column table with two columns. For paired data, values in each row must belong to the same unit or a matched pair. If one value is missing, exclude both values in that pair.
  2. In Analyses, choose a method or use the Which test should I choose? guide.
  3. For a t-test, review the estimated mean difference and its 95% confidence interval, then p and the assumption diagnostics. For a rank test, interpret its statistic in light of the question and distribution shapes.
Try it in Linza Opens in a new tab with synthetic data. Work in the original tab remains unchanged.

Common mistakes#

  • Analyzing before and after data as independent groups.
  • Using the Student test with very different variances and group sizes.

Check yourself#

Blood pressure was measured before and after exercise in 12 participants. All pairs are complete and the differences are approximately normal. Which test assesses the mean change?

Optional. Your answer is not saved.

Sources#

  • Student (1908) The probable error of a mean. Biometrika, 6(1). Open publication Opens in a new tab
  • Welch B.L. (1947) The generalization of "Student's" problem when several different population variances are involved. Biometrika, 34. Search for publication Opens in a new tab
  • Mann H.B., Whitney D.R. (1947) On a test of whether one of two random variables is stochastically larger than the other. Annals of Mathematical Statistics, 18(1). Search for publication Opens in a new tab
  • Wilcoxon F. (1945) Individual comparisons by ranking methods. Biometrics Bulletin, 1(6). Search for publication Opens in a new tab

References are for further reading. A method’s suitability depends on the study design and its assumptions.