🧮  T-Test

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,

\[t = \frac{\bar{X}_1 - \bar{X}_2}{\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}},\]

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



See also

Source article Adapted (context, re-expressed) in our own words from: T-Test (insightful-data-lab.com).

Tags: purpose: reference topic: terminology level: beginner