T-Test#
A hypothesis test comparing means using the t-distribution for smaller samples.
Important
✨ AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.
What it is#
A t-test asks whether the means of two groups differ significantly, using the Student’s t-distribution. It is the tool of choice when the sample is small (\(n < 30\)) and the population standard deviation is unknown — estimated instead from the data, which the heavier-tailed t accounts for.
The three forms#
A one-sample t-test compares a sample mean to a known value (is the class average different from 70?); an independent two-sample test compares two separate groups (male vs female scores); and a paired test compares the same units measured twice (weight before vs after a diet).
The statistic#
For the independent test,
the difference in means over its standard error. Compare \(t\) to a critical value from the t-distribution at the appropriate degrees of freedom (for the independent test, \(df = n_1 + n_2 - 2\)), or read a p-value.
Example#
A sample of 25 with mean 72, against a hypothesised population mean of 70 with \(s = 5\), gives \(t = (72 - 70)/(5/\sqrt{25}) = 2\). The critical value at \(df = 24, \alpha = 0.05\) is about 2.064, and since \(2 < 2.064\) we fail to reject \(H_0\) — no significant difference.
Assumptions#
The data should be roughly normal; the independent test also assumes independent groups and equal variances — if the variances differ, use Welch’s t-test. As \(n\) grows the t-distribution approaches the normal, and the t-test converges to the z-test.
Theme: Statistical Inference & Power · All terminology
Hint
Mind map — connected ideas
Z-Test · Sample Mean · Sample Standard Deviation · Critical Value · Hypothesis Testing · Effect Size (δ)
Hint
More in Statistical Inference & Power
A Priori Power Analysis · Chi-square (χ²) Test · Clopper–Pearson Interval · Compromise Power Analysis · Confidence Intervals (CIs) · Effect Size (δ) · Hypothesis Testing · Kolmogorov–Smirnov (KS) Test · Minimum Detectable Lift (MDL) · P-Value (probability value) · Post Hoc Power Analysis · Power (1 – β) · Power Analysis · Sample size
See also
Source article Adapted (context, re-expressed) in our own words from: T-Test (insightful-data-lab.com).