Answer

What are the assumptions of a t test, and which ones actually matter?

A frequently asked statistics question ·

t testhypothesis testingstudy design

The short answer

A t test needs independent observations, a roughly normal sampling distribution of the mean (not normal raw data), and, for Student's two-sample version, equal variances. Independence matters most and no sample size fixes it. Normality matters mainly for small, skewed one-sample or paired data. Unequal variances matter only with unequal group sizes, and Welch's test handles them.

The short answer

Every version of the t test (one-sample, paired and two-sample) rests on the same small set of assumptions. They are not equally important. Ranked by how much damage a violation does in practice:

  1. Independence. Each observation (or, in a paired test, each difference) carries its own information. This is the one that matters most, and a larger sample does not rescue you when it fails.
  2. A normal sampling distribution of the mean. The test needs the sample mean, or the difference between two means, to be close to normally distributed. Normal raw data guarantee that, but large enough samples get you there anyway. Skewed data in small samples are the real risk.
  3. Equal variances (Student's two-sample test only). Pooling the two variances is harmless when the groups are the same size and risky when they are not. Welch's version drops this assumption, so it costs almost nothing to use it by default.

Textbooks often add that the outcome should be measured on an interval scale and that there should be no extreme outliers. Both are really about whether a mean is a sensible summary of your outcome, which is a question about your research goal as much as about the test. This page is the overview; the linked pages go deeper into single questions such as Welch versus Student, minimum sample size, and when to switch to Mann-Whitney.

Independence: the problem no sample size can fix

The standard error in a t test is computed as if every observation were a fresh, separate piece of information. When observations are linked, for example pupils in the same classroom, repeated measurements on the same person treated as separate cases, or readings taken close together in time, they share part of their variation. The data then contain less information than the count suggests, the standard error comes out too small, and the test declares differences significant far too often.

With clustered data, the loss is summarised by the design effect, 1 + (m − 1) × ICC, where m is the cluster size and ICC is the intraclass correlation. In the simulation below, classrooms of 5 pupils with an ICC of 0.2 give a design effect of 1.8, so 20 pupils per group carry about as much information as 11 independent ones. Adding more pupils per classroom makes this worse, not better.

You cannot test your way out of this. Independence comes from the design: who was sampled and how. If the data are clustered, analyse them at the cluster level (for example, compare classroom means) or use a model that knows about the clusters, such as a mixed model. If each person was measured twice, use the paired test, which works on the differences and only needs the people to be independent of each other (see paired vs independent t test).

Normal raw data or a normal sampling distribution?

The t statistic follows a t distribution exactly when the data within each group are normal. But what the test actually relies on is that the mean (or the difference in means) is close to normal across repeated samples. By the central limit theorem, that becomes true as the sample grows even when the raw scores are skewed, so the assumption fades in importance with sample size. How fast depends on how skewed the data are: for mildly skewed data a dozen observations can be enough, for strongly skewed data 40 may not be.

Equal variances: only for Student's version

Student's two-sample t test pools the two sample variances into one estimate. With equal group sizes, the pooled and unpooled standard errors are identical, so unequal variances do little harm. With unequal group sizes, the pooled estimate leans towards the larger group. If the smaller group is the more variable one, the standard error is underestimated and the test rejects too often; if the larger group is the more variable one, the test becomes conservative and loses power.

Welch's t test estimates each variance separately and adjusts the degrees of freedom, so it does not need the assumption at all. It is R's default in t.test(), and when the variances really are equal it gives almost the same answer as Student's test. Using Welch from the start is simpler and safer than running Levene's test first and choosing a test from the result; Welch vs Student t test explains why. The equal-variance assumption does not arise in one-sample or paired tests, which involve only one set of numbers.

See it in R and Python

The code simulates 10,000 data sets for each scenario, always with no true difference, and records how often the t test gives p < .05. A well-behaved test should land near .05; higher means too many false positives.

R

set.seed(1118)
reps <- 10000

# Share of tests with p < .05 when the null hypothesis is true (target: .05)
false_pos <- function(one_p) round(mean(replicate(reps, one_p()) < 0.05), 3)

# Independence: each group = 4 classrooms of 5 pupils, ICC = 0.2,
# analysed as if the 20 pupils were independent
classes <- function() rep(rnorm(4, sd = 0.5), each = 5) + rnorm(20)

c(
  # Baseline: normal data, 10 per group, Welch's t test (R's default)
  normal_10        = false_pos(function() t.test(rnorm(10), rnorm(10))$p.value),
  # Independence violated
  clustered_20     = false_pos(function() t.test(classes(), classes())$p.value),
  # Normality: skewed (exponential) data, one-sample test of the true mean
  skew_one_10      = false_pos(function() t.test(rexp(10), mu = 1)$p.value),
  skew_one_40      = false_pos(function() t.test(rexp(40), mu = 1)$p.value),
  # Normality: two groups with the same skewed shape
  skew_two_10      = false_pos(function() t.test(rexp(10), rexp(10))$p.value),
  # Equal variances: SD 2 vs SD 1
  student_20_20    = false_pos(function() t.test(rnorm(20, sd = 2), rnorm(20),
                                                 var.equal = TRUE)$p.value),
  student_10_30    = false_pos(function() t.test(rnorm(10, sd = 2), rnorm(30),
                                                 var.equal = TRUE)$p.value),
  welch_10_30      = false_pos(function() t.test(rnorm(10, sd = 2), rnorm(30))$p.value)
)

Python

import numpy as np
from scipy import stats

rng = np.random.default_rng(1118)
reps = 10000

# Share of tests with p < .05 when the null hypothesis is true (target: .05)
def false_pos(p):
    return round(float(np.mean(p < 0.05)), 3)

def welch(x, y):
    return stats.ttest_ind(x, y, axis=1, equal_var=False).pvalue

def student(x, y):
    return stats.ttest_ind(x, y, axis=1, equal_var=True).pvalue

# Independence: each group = 4 classrooms of 5 pupils, ICC = 0.2,
# analysed as if the 20 pupils were independent
def classes():
    return np.repeat(rng.normal(0, 0.5, (reps, 4)), 5, axis=1) + rng.normal(size=(reps, 20))

def norm(n, sd=1):
    return rng.normal(0, sd, (reps, n))

def expo(n):
    return rng.exponential(size=(reps, n))

print({
    # Baseline: normal data, 10 per group, Welch's t test
    "normal_10": false_pos(welch(norm(10), norm(10))),
    # Independence violated
    "clustered_20": false_pos(welch(classes(), classes())),
    # Normality: skewed (exponential) data, one-sample test of the true mean
    "skew_one_10": false_pos(stats.ttest_1samp(expo(10), 1, axis=1).pvalue),
    "skew_one_40": false_pos(stats.ttest_1samp(expo(40), 1, axis=1).pvalue),
    # Normality: two groups with the same skewed shape
    "skew_two_10": false_pos(welch(expo(10), expo(10))),
    # Equal variances: SD 2 vs SD 1
    "student_20_20": false_pos(student(norm(20, 2), norm(20))),
    "student_10_30": false_pos(student(norm(10, 2), norm(30))),
    "welch_10_30": false_pos(welch(norm(10, 2), norm(30))),
})

The figures below come from one seeded run of the R code. Python's random numbers differ from R's, so its rates differ slightly (for example .100 instead of .095 for skewed data with n = 10), but they show the same pattern.

The ranking follows directly: clustering broke the test badly, skewness mattered only in the one-sample case with few observations, and unequal variances mattered only with unequal group sizes and a pooled test. Before you collect data, check that your planned sample has enough power as well; see does a t test need a minimum sample size?. For help choosing between a t test and its alternatives, use the test chooser.

How to report a t test and its checks in APA style (7th edition)

Readers mainly need to know which version of the test you used and why the assumptions are plausible. Put this in the method section, in a sentence or two, for example:

"Groups were compared with Welch's independent-samples t test, which does not assume equal variances. Each participant contributed one score, and Q-Q plots of each group showed no marked skew or outliers."

Then report the result itself, with placeholders replaced by your own values: "The training group scored higher (M = x.xx, SD = x.xx, n = xx) than the control group (M = x.xx, SD = x.xx, n = xx), t(xx.xx) = x.xx, p = .xxx, 95% CI [LL, UL], d = x.xx." Welch's degrees of freedom are usually not whole numbers; report them to two decimals. If the data were clustered and you analysed cluster means instead, say so and give the number of clusters as n.

Related tools and guides

More answered questions

Working with your own data?

General answers only go so far. Send us your situation and we'll reply by email within two business days.

Ask your question

Written by AskStats with AI assistance. This is general information, not advice for your specific data or study. When the results matter, check your approach with a qualified statistician.