[Durgical](https://durgical.com/en/) › [DurgiPedia](https://durgical.com/en/durgipedia/) › [Epidemiology](https://durgical.com/en/epidemiology/) › [Biostatistics](https://durgical.com/en/epidemiology/areas/stats/) › Student's t test

# Student's t test

- Statistical test

It compares two means and says whether the gap between them is larger than chance would explain.

Updated Nov 5, 2026

## Key points

- t = difference in means / SE of the difference.
- Independent: two different groups; degrees of freedom = n1 + n2 − 2 (pooled-variance version).
- Paired: the same people before and after, or matched pairs; the within-pair differences are analysed; df = number of pairs − 1.
- Assumptions: numerical variable, independent observations, rough normality and, in the classic version, equal variances (if not, Welch’s correction).
- If data are very skewed and samples small: Mann-Whitney (independent) or Wilcoxon (paired).
- With three or more groups, do not run several t tests: use ANOVA.

## What it is

The t test compares the mean of a numerical variable between two independent groups, or between two measurements in the same people (paired t test). Its statistic is the difference in means divided by its standard error, compared with Student’s t distribution for the degrees of freedom. It assumes roughly normal data (or large samples) and, in the classic independent version, similar variances.

## When to use it

- Two means of independent groups, or one mean of paired differences.
- Continuous numerical outcome, roughly normal in each group.
- With large samples, t behaves like z and tolerates moderate departures from normality.

## Worked example

- Data: kilograms lost over 8 weeks on diet A (5 people): 4, 6, 5, 7, 8; on diet B (5 people): 2, 3, 4, 3, 3.
- Means: A = 30 / 5 = 6 kg; B = 15 / 5 = 3 kg. Difference = 3 kg.
- Variances: A = (4 + 0 + 1 + 1 + 4) / 4 = 2.5; B = (1 + 0 + 1 + 0 + 0) / 4 = 0.5.
- Pooled variance = (4 × 2.5 + 4 × 0.5) / (5 + 5 − 2) = 12 / 8 = 1.5.
- SE of the difference = √[1.5 × (1/5 + 1/5)] = √0.6 = 0.77 kg.
- t = 3 / 0.77 = 3.87 with 8 degrees of freedom.
- Two-sided critical value at α = 0.05 and 8 df = 2.31. Since 3.87 > 2.31, H0 is rejected; p ≈ 0.005.
- Reading: diet A lost 3 kg more on average; the gap is unlikely to be due to chance alone, although the sample is tiny.

## Markers

- t
- df
- Welch

## How to read the result

- Report the difference in means with its 95% CI, not just t and p.
- When the same people are measured twice, the paired test usually has far more power than the independent one.

## Assumptions and pitfalls

- Using the independent test on paired data.
- Applying it to ordinal or very skewed variables with small samples.
- Running many t tests between pairs of groups instead of one ANOVA.

## Memory aid

‘t = signal / noise’: the difference in means is the signal; its standard error is the noise.

## Test yourself

Think of the answer, then tap the question to see it.

## When is a paired t test used?

When both measurements come from the same people (before and after) or from matched pairs; the within-pair differences are analysed.

## What are the assumptions of the independent-samples t test?

A numerical variable, independent observations, a roughly normal distribution in each group and, in the classic version, similar variances.

## Which non-parametric test replaces the independent t test?

The Mann-Whitney U test.

## Why not run several t tests to compare four groups?

Because each test adds false-positive risk; with 6 comparisons the overall type I error rises well above 5%. ANOVA is used instead.

[Add to my cards (4)](https://durgical.app/estudiar/?add=/en/epidemiology/student-s-t-test/)

## Connections

## Related 5

- [Choosing a statistical test](https://durgical.com/en/epidemiology/choosing-a-statistical-test/)
- [Analysis of variance (ANOVA)](https://durgical.com/en/epidemiology/analysis-of-variance/)
- [Non-parametric tests](https://durgical.com/en/epidemiology/non-parametric-tests/)
- [Standard error](https://durgical.com/en/epidemiology/standard-error/)
- [Hypothesis testing](https://durgical.com/en/epidemiology/hypothesis-testing/)

[← All of epidemiology](https://durgical.com/en/epidemiology/)

Educational content on epidemiological and statistical methods; the examples use made-up numbers to teach the calculation. Not a clinical or legal guide: current Colombian rules are in the official sources.

Sources: [Two-Sample t-Test for Equal Means](https://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm) (NIST/SEMATECH e-Handbook of Statistical Methods, National Institute of Standards and Technology, 2012); [Analysis of paired observations](https://www.itl.nist.gov/div898/handbook/prc/section3/prc311.htm) (NIST/SEMATECH e-Handbook of Statistical Methods, National Institute of Standards and Technology, 2012).

## **Spotted a mistake?** We are always improving for the community. Tell us what is wrong and our team will review it. Report a mistake

Representative model, for educational purposes only.

---
Source: https://durgical.com/en/epidemiology/student-s-t-test/
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite as: DurgiPedia (durgical.com), https://durgical.com/en/epidemiology/student-s-t-test/
