Independent t-test: a worked example

The independent (unpaired) t-test answers the simplest experimental question there is: do these two groups differ? It goes back to Student’s 1908 paper written at the Guinness brewery, and it remains the right first tool whenever two separate groups of subjects are measured once each.

The data

Root mass (g) of plants grown with and without a growth treatment, eight plants per group:

Values
r1r2 r3r4r5 r6r7r8
Control5.15.44.95.65.05.34.85.2
Treated6.06.45.86.66.15.96.36.2

r = replicate: r1 is replicate 1, r2 replicate 2, and so on.

Laid out exactly as MinutePlot’s data grid for a two-group comparison: one row per group, one column per replicate.

Check the assumptions first

Two things must hold, approximately: each group’s values are normally distributed (checked with the Shapiro–Wilk test), and the two groups have similar spread. Here both groups have a standard deviation of 0.27 g — as similar as it gets. When variances differ clearly, use Welch’s version of the test, which drops the equal-variance assumption; MinutePlot switches automatically when the data call for it.

Why Welch, and only Welch. MinutePlot performs Welch’s t-test, which does not assume equal variances and is the modern recommended default — and R’s own default in t.test(); the Student equal-variance variant is intentionally not offered. Readers comparing with tools that default to Student’s test (SPSS, Excel) may see small differences in t and p for that reason alone — the validation page shows both side by side.

The result

Control mean 5.16 ± 0.27 g; treated mean 6.16 ± 0.27 g. The test gives t(14) = 7.49, p < 0.001, with a very large effect size (Cohen’s d = 3.7). The treatment increased root mass by about 1.0 g — roughly 19% — and the difference is far too large to be sampling noise.

Bar chart of root mass by
group with significance letters

The figure MinutePlot produces for this analysis: group means with error bars, and letters marking the significant difference.

Report it like this

“Treated plants produced greater root mass than controls (5.16 ± 0.27 g vs. 6.16 ± 0.27 g; independent t-test, t(14) = 7.49, p < 0.001).”

Common pitfalls

Do not use this test when the same subjects appear in both columns (that is the paired t-test), and do not run several t-tests to compare three or more groups — that inflates false positives; use one-way ANOVA instead.

Try it yourself — in a minute. Paste the table above into MinutePlot, press Confirm and Analyze, and you will get this exact analysis and a publication-ready figure with the letters placed for you. Open MinutePlot in your browser — free 14-day trial, no card needed.
References
  1. Student (1908). The probable error of a mean. Biometrika, 6(1), 1–25. https://doi.org/10.1093/biomet/6.1.1
  2. Shapiro, S. S., & Wilk, M. B. (1965). An analysis of variance test for normality (complete samples). Biometrika, 52(3–4), 591–611. https://doi.org/10.1093/biomet/52.3-4.591
  3. Montgomery, D. C. (2017). Design and Analysis of Experiments (9th ed.). John Wiley & Sons.