ExamSaathi learning library · Government exams · SSC CGL quantitative foundations; published syllabus labelled 2024 · Quantitative aptitude
Student's t test: one mean, two means and paired small samples
Test claims about means from small samples with Student's t: the one-sample t test, the two-sample t test with a pooled variance, and the paired t test on differences, each read against the t table at the right degrees of freedom.
Status: original pilot lesson. Teacher review is pending. It is not a complete course or official exam material.
You will learn to
- Decide when Student's t test suits a small sample: a roughly normal population whose SD is unknown, with s found using divisor n - 1.
- Carry out a one-sample t test of a claimed mean on n - 1 degrees of freedom and compare the size of t with the t table value.
- Compare two small independent samples with the pooled variance and a two-sample t test on n1 + n2 - 2 degrees of freedom.
- Apply the paired t test to the differences in before-and-after or matched small samples, using n - 1 degrees of freedom.
Before you start
This lesson tests claims about means when only a handful of readings are available. It assumes you can find a mean, an SD and a square root, and that you know how a test is set up with H0, H1, a level of significance and a decision; those ideas, and z tests, are taught in another lesson. Here the samples are small (usually fewer than 30 values), they come from a population that is roughly normal, and the population SD sigma is unknown. So sigma is replaced by s, the sample SD with divisor n - 1: s^2 = (sum of squared deviations from the mean) / (n - 1). Notation: mu is the population mean, n the number of readings, and d the difference within a pair. The letter x is used only as a times sign, and all the data are made up for practice.
The core rule: the one-sample t statistic
To test H0: mu = mu0, where mu0 is the claimed mean, from n readings, work out t = (sample mean - mu0) / (s / sqrt(n)). It looks like a z statistic, but s is only an estimate of sigma, so the statistic does not follow the normal curve. When H0 is true it follows Student's t distribution with n - 1 degrees of freedom, which has fatter tails than the normal curve, so its critical values are larger. Read the critical value from the t table in the row for n - 1 degrees of freedom. A two-tailed test at 5 percent uses the upper 2.5 percent point, for example 2.571 for 5 degrees of freedom or 2.306 for 8. A one-tailed test at 5 percent uses the upper 5 percent point, for example 2.015 for 5 degrees of freedom. Two-tailed decision: if |t|, the size of t without its sign, is larger than the table value, reject H0; otherwise do not reject H0. One-tailed decision: reject only if t passes the table value on the side named in H1.
Two independent samples: the pooled t test
To compare the means of two separate groups, such as workers trained by two methods, with n1 and n2 readings, first merge the two sample variances into one pooled variance: s^2 = ((n1 - 1) x s1^2 + (n2 - 1) x s2^2) / (n1 + n2 - 2). The same number comes from adding the two sums of squared deviations and dividing by n1 + n2 - 2. Then t = (mean 1 - mean 2) / (s x sqrt(1 / n1 + 1 / n2)), on n1 + n2 - 2 degrees of freedom, testing H0: the two population means are equal. Pooling assumes that both populations are roughly normal with about the same spread, and that the two samples are independent of each other. With 5 readings in each group there are 5 + 5 - 2 = 8 degrees of freedom; with 6 and 6 there are 10, and the two-tailed 5 percent table value is then 2.228.
A further case: paired readings
Sometimes the readings come in natural pairs: the same students before and after extra classes, or two seed varieties sown side by side on the same plots. The two lists are then linked, so the pooled test is the wrong tool. Instead, find the difference d for every pair, always subtracting in the same order (for example after - before), and treat the d values as a single sample. Work out the mean of d and s_d, the SD of the d values with divisor n - 1, where n is now the number of pairs. Then t = (mean of d) / (s_d / sqrt(n)) on n - 1 degrees of freedom, testing H0: the mean difference in the population is 0. Pairing strips out the large differences between one student or plot and the next, so when the two readings in each pair rise and fall together, as they usually do, a real effect stands out more clearly than in a two-sample test on the same numbers.
Common mistakes
Using 1.96 or another normal value with a small sample instead of the t table. Reading the t table at n degrees of freedom in a one-sample or paired test, when it should be n - 1, or at n1 + n2 instead of n1 + n2 - 2 for two samples. Finding s with divisor n. Dividing s by n instead of sqrt(n). Taking the plain average of s1^2 and s2^2 when the groups differ in size; each variance should be weighted by its own degrees of freedom. Multiplying sqrt(1 / n1 + 1 / n2) by the pooled variance s^2 instead of the pooled SD s. Running a two-sample test on paired data, which usually hides the effect. Switching the order of subtraction in d partway through. Using the two-tailed column for a one-tailed question, or the reverse.
A routine for t tests
1. Check the setting: a small sample, a roughly normal population, sigma unknown. 2. Pick the test: one sample against a claimed mean, two independent groups, or pairs. 3. Write H0 and H1, and note whether the test is one-tailed or two-tailed. 4. Find the mean and s (divisor n - 1), the pooled s, or the mean and SD of d. 5. Work out t and its degrees of freedom: n - 1, n1 + n2 - 2, or number of pairs - 1. 6. Write down the t table value for that row and tail. 7. Compare, state the decision in words, reject H0 or do not reject H0, and say what it means for the scooters, the workers or the students.
Worked examples
A scooter maker claims a mileage of 50 km per litre. A delivery firm in Bengaluru picks 6 of these scooters at random from its fleet and records 46, 50, 43, 47, 49 and 47 km per litre. Assuming mileage is roughly normal, test the claim at the 5 percent level (two-tailed). Table value: t = 2.571 for 5 degrees of freedom, two-tailed 5 percent.
- H0: mu = 50 km per litre. H1: mu not equal to 50 km per litre.
- Sample mean = (46 + 50 + 43 + 47 + 49 + 47) / 6 = 282 / 6 = 47.
- Deviations from 47: -1, 3, -4, 0, 2, 0. Squares: 1, 9, 16, 0, 4, 0. Sum = 30.
- s^2 = 30 / (6 - 1) = 6, so s = sqrt(6) = 2.449, and s / sqrt(n) = sqrt(6) / sqrt(6) = 1.
- t = (47 - 50) / 1 = -3, on 6 - 1 = 5 degrees of freedom.
- |t| = 3 is larger than 2.571.
Answer: t = -3 on 5 degrees of freedom, so reject H0 at the 5 percent level: the mean mileage is not 50 km per litre, and the sample points to less.
A garment unit in Tiruppur trains two groups of 5 tailors, chosen at random, by different methods. Shirts stitched per day: method A: 25, 29, 30, 32, 34; method B: 21, 24, 25, 26, 29. Assuming normal populations with equal spread, test at the 5 percent level (two-tailed) whether the two methods give the same mean output. Table value: t = 2.306 for 8 degrees of freedom, two-tailed 5 percent.
- H0: the two population means are equal. H1: they differ.
- Method A: mean = 150 / 5 = 30. Deviations: -5, -1, 0, 2, 4. Squares: 25, 1, 0, 4, 16. Sum = 46.
- Method B: mean = 125 / 5 = 25. Deviations: -4, -1, 0, 1, 4. Squares: 16, 1, 0, 1, 16. Sum = 34.
- Pooled variance s^2 = (46 + 34) / (5 + 5 - 2) = 80 / 8 = 10, so s = sqrt(10) = 3.162.
- s x sqrt(1/5 + 1/5) = sqrt(10 x 0.4) = sqrt(4) = 2.
- t = (30 - 25) / 2 = 2.5 on 8 degrees of freedom, and 2.5 is larger than 2.306.
Answer: t = 2.5 on 8 degrees of freedom, so reject H0 at the 5 percent level: the methods differ, with method A giving more shirts per day.
A school in Patna runs extra classes for 8 students picked at random and wants to know whether the classes raise marks, so the test is one-tailed at 5 percent. Marks out of 50 (before, after): (32, 35), (28, 29), (35, 35), (30, 33), (26, 27), (33, 37), (29, 30), (31, 34). Table value: t = 1.895 for 7 degrees of freedom, one-tailed 5 percent.
- The same students are measured twice, so use the paired t test on d = after - before.
- d: 3, 1, 0, 3, 1, 4, 1, 3. Sum = 16, so the mean of d = 16 / 8 = 2.
- Deviations of d from 2: 1, -1, -2, 1, -1, 2, -1, 1. Squares: 1, 1, 4, 1, 1, 4, 1, 1. Sum = 14.
- s_d^2 = 14 / (8 - 1) = 2, so s_d = sqrt(2) = 1.414, and s_d / sqrt(8) = 1.414 / 2.828 = 0.5.
- H0: the mean difference is 0. H1: the mean difference is greater than 0. t = 2 / 0.5 = 4 on 8 - 1 = 7 degrees of freedom.
- t = 4 is positive, on the side named in H1, and larger than 1.895.
Answer: t = 4 on 7 degrees of freedom, so reject H0 at the 5 percent level: the marks rose significantly after the extra classes.
Practice checks
- Sugarcane plants on two fertilisers are measured at a Kolhapur farm. Sample 1 has 5 plants with variance s1^2 = 8 and sample 2 has 7 plants with variance s2^2 = 13, both found with divisor n - 1. What is the pooled variance for the two-sample t test?
- A sweet shop in Dharwad says its pedha pieces weigh 50 g on average. A customer weighs 9 pieces picked at random: mean 48.5 g, s = 1.8 g (divisor n - 1). Test the claim at the 5 percent level (two-tailed). Table values for 8 degrees of freedom: 2.306 (two-tailed 5 percent) and 3.355 (two-tailed 1 percent).
- Two groups of 6 trainee typists in Lucknow learn by different methods. Speeds in words per minute: group A mean 42, variance 9; group B mean 37.8, variance 15 (variances with divisor n - 1). Test at the 5 percent level (two-tailed) whether the methods differ. Table value: t = 2.228 for 10 degrees of freedom, two-tailed 5 percent.
- On 5 plots of a Ludhiana farm, each plot is split in two, with wheat variety A sown in one half and variety B in the other. Yields in quintals per acre (A, B): plot 1 (20, 18), plot 2 (24, 20), plot 3 (18, 17), plot 4 (22, 19), plot 5 (26, 21). Test at the 5 percent level (two-tailed) whether the varieties differ. Table values, two-tailed 5 percent: t = 2.776 for 4 degrees of freedom and t = 2.306 for 8.
- For which of these is Student's t test the right choice?
Sources checked
- SSC CGL Scheme and Syllabus, labelled 2024 — Tier-II Paper-II Statistics (Statistical Inference: small sample tests, tests based on t); not verified as the full 2026-cycle syllabus
- NIST/SEMATECH e-Handbook of Statistical Methods — Section 1.3.5.3, Two-Sample t-Test for Equal Means: the t statistic for comparing two means, with the pooled standard deviation and N1 + N2 - 2 degrees of freedom when the two variances are assumed equal; mathematical relationships only
- OpenStax, Introductory Statistics 2e — Section 8.2, the Student t distribution with n - 1 degrees of freedom, used for a mean when the population standard deviation is unknown and the sample standard deviation is used instead; mathematical relationships only
- OpenStax, Introductory Statistics 2e — Section 10.4, matched or paired samples analysed through the mean and standard deviation of the differences with a t test on n - 1 degrees of freedom; mathematical relationships only