The independent t-test asks whether the average of a numeric outcome differs between two separate groups. This guide covers what the test does, when it is appropriate, how to read the result, and how to run it in AnalyZ Solutions.
Many questions come down to whether two groups differ on some measure. Do girls and boys score differently on a reading assessment? Do customers who joined a loyalty scheme spend more per visit than those who did not? The independent t-test answers this by comparing the two group averages while accounting for how much scores vary within each group and how many people are in each.
If the averages are far apart relative to that variation, the difference is unlikely to be a product of sampling luck. If they are close relative to the spread, the gap could easily appear by chance. The test condenses this into a t statistic and a significance level.
Use the independent t-test when the outcome is numeric, the data falls into exactly two groups, and each person appears in only one group. The groups must be unrelated: different respondents, not the same respondents measured twice. For measurements taken twice on the same people, use the paired t-test instead. For three or more groups, use a one-way ANOVA.
A worked example: a study records monthly income for 120 people who completed a course and 110 who did not. The average is 310 for those who completed it and 280 for those who did not. The t-test tells you whether that 30-unit gap is larger than you would expect from sampling variation alone.
Independence. Each observation should be unrelated to the others. Respondents from the same family, or the same person appearing twice, break this.
Roughly normal outcomes within each group. With more than about 30 people per group the test is forgiving. With very small groups or heavily skewed outcomes such as income, consider the Mann-Whitney U test.
Similar spread in both groups. The test works best when the two groups vary by a similar amount. AnalyZ Solutions runs Levene's test for equal variances alongside the t-test so you can check this. If Levene's test is significant and the groups are also very different in size, treat the t-test result with caution and look at the Mann-Whitney U test as a cross-check.
If the difference is significant, the interpretation names the group with the higher average and states the level at which the difference is significant: 5%, 1%, or 0.1%. If it is not, the interpretation says there is no significant difference. A non-significant result means the data did not provide enough evidence of a difference, and it does not prove the groups are identical.
Cohen's d expresses the difference in average as a number of standard deviations. Values below 0.2 are negligible, 0.2 to 0.5 small, 0.5 to 0.8 medium, and above 0.8 large. In the income example, if the pooled standard deviation is 100, a 30-unit gap gives a d of 0.3, a small effect. It may still matter for policy, but it is not dramatic.
Open Inferential Analysis, choose Compare Means, then Independent t-test.
Running an independent t-test in AnalyZ Solutions.
You can download the tables as CSV, Excel, or Word, send them to Sense Making, or add the finding to a Data Canvas slide.
A two-tailed test looks for a difference in either direction. A one-tailed test looks in one direction only, which makes it easier to reach significance but blind to an effect the other way. In AnalyZ Solutions it tests whether the first group is higher than the second, so a lower first group gives a large p-value however big the gap. Choosing one-tailed after seeing which group happened to score higher is a form of cheating. If in doubt, keep two-tailed.
The figures below are invented to show the steps, and they follow the results tables in AnalyZ Solutions, with a few columns left out to save space. Suppose students were taught one subject either online or in a classroom, and you compare their exam scores.
| Group | N | Mean | SD |
|---|---|---|---|
| Online | 42 | 71.6 | 10.4 |
| Classroom | 38 | 66.2 | 9.8 |
| t | df | p-value | Sig | Cohen's d | Levene p |
|---|---|---|---|---|---|
| 2.3834 | 78 | 0.0196 | * | 0.534 | 0.8653 |
Students in the online course scored 5.4 points higher on average than those in the classroom course (71.6 against 66.2). The difference is medium in size and significant at the 5% level, so it is unlikely to be a sampling accident. The test cannot say why the gap exists. If students chose their own format, the groups may have differed before the course began.
Using it on more than two groups. Running several t-tests across three or more groups inflates the chance of false findings. Use ANOVA and a post-hoc comparison instead.
Using it on paired data. If the same people appear in both columns, such as before and after scores, use the paired t-test.
Reading significance as importance. A large sample can make a trivial gap significant. Always check Cohen's d.
Ignoring outliers. A few extreme values can drag a group average and distort the result. Inspect the distribution with the Descriptive Analysis module first.
Open Compare Means in AnalyZ Solutions. Free to sign up, free to analyze.
Get started