When to use it
You have one measurement variable and one grouping variable with exactly 2 levels.
When not to: When the two columns are repeated measures on the same units (use the paired t), when there are three or more groups (use one-way ANOVA rather than several t-tests), when the response is ordinal or heavily skewed at small n (use Mann-Whitney), or when observations are clustered or repeated (use a mixed model).
Step by step
Open it from the menu
Click Analyze in the menu bar; under Means choose Two-Sample t-Test.
Fill in the form
Choose the columns: What you measured, The two groups. The form lists only columns whose type fits each field.
Check the options
The options start at their defaults: How strict to be, What you expect, Assume equal spreads?, Difference to test against, How sure the range is. Change one only when your question needs it.
Run the analysis
Press Run analysis. The Result Card opens on its Results tab.
What to choose in the form
| What you measured Numeric Var required | One numeric column. A number column. The test compares its average between the two groups. |
|---|---|
| The two groups Group Var required | One categorical column. A column with exactly two kinds. With more, filter to two, or use One-Way ANOVA. |
| How strict to be Alpha | The cut-off for the p-value. Below it, the card reports evidence of a difference; a smaller cut-off is stricter. Not sure? Keep 0.05. It is the usual convention in most fields. |
| What you expect Alternative | two-sided: different in either direction. less: group 1 (first alphabetically) lower. greater: group 1 higher. Choose a direction only if decided beforehand. Not sure? Keep two-sided. It is the usual choice because it does not assume a direction. |
| Assume equal spreads? Assume equal variances (Student's t) | On: the classic pooled (Student's) t-test. Off: Welch's t-test, which does not need the spreads to be equal. Not sure? Keep it off (Welch's test). It works whether or not the spreads are equal. |
| Difference to test against Hypothesized difference | The difference in averages (group 1 minus group 2) the test starts from. 0 asks whether the averages differ at all. Not sure? Keep 0. It asks the usual question: do the two averages differ? |
| How sure the range is Confidence level | The confidence level of the range for the difference: 0.95 gives a 95% confidence interval. Not sure? Keep 0.95. It is the usual choice and matches a 0.05 cut-off. |
How to read the card
The Results tab starts with what to know first (rows left out, checks that did not pass), then the interpretation in words and the Key Results; charts and assumption checks follow further down. Learn More explains the method in plain words. Read a Result Card covers all four tabs.
What it assumes
- Independence of observations
If it does not hold: Standard errors are too small, so p-values are too small and intervals too narrow. This cannot be fixed by a different two-sample test; the design must be modeled (paired t, mixed model).
How to check: Not checkable from the data alone: it is a property of how the data were collected.
- Normality (of residuals, not of the raw data)
If it does not hold: At small n, p-values and interval coverage drift, especially with strong skew or outliers. At moderate to large n the CLT makes the test robust.
How to check: Shapiro-Wilk and Anderson-Darling per group, reported as assumption checks on the card.
- Homogeneity of variance (homoscedasticity)
If it does not hold: Only relevant to the equal_var = true option, where unequal variances with unequal group sizes distort the Type I error rate. The default Welch test does not require it.
How to check: Levene's / Brown-Forsythe via Equal Variances Test; not required for the default path.
A worked example
Comparing body mass (g) between 151 Adelie and 123 Gentoo penguins, using species as the grouping column.
Result: Welch's t = -23.39 on 249.64 degrees of freedom, p < .001, mean difference -1375 g, 95% CI [-1491, -1260], Cohen's d = -2.87.
Gentoo penguins are heavier than Adelie by roughly 1.4 kg, and the interval places that difference between about 1.26 and 1.49 kg. The effect is very large by any conventional benchmark, so the conclusion here rests on the size of the difference, not on the p-value.
From the Statistics Library.
The code tabs
Code gives this analysis as Python, R and MATLAB code (and SAS where the tab offers it), reading the data the way KernelStats did. Export sends the card to a report or to slides. See The Code tab.
Understand the statistics
Ask Oobi
Type one of these into Ask Oobi beside your data:
- Is average salary different between male and female employees?
- Explain the two-sample t-test in plain words.
- What does p-value mean?
Last reviewed November 16, 2026.
