SPSS command: SPSS T-TEST GROUPS
Compare two independent groups with a t test
The independent-samples t test compares the means of a scale variable between two separate groups, such as treatment and control or two customer segments.
Free · No account · Files stay on your device · Updated 18 October 2026
What it tells you
Crosstabs runs SPSS T-TEST GROUPS in your browser, giving Levene's test, the equal-variances and Welch rows with confidence intervals, and Cohen's d, Hedges' correction and Glass's delta with intervals.
- Whether the two group means differ, and by how much, with a confidence interval for the difference.
- Whether the groups have similar variances (Levene's test, centred on the means as in SPSS).
- The result without assuming equal variances (Welch's t with Welch–Satterthwaite df).
- The standardized effect size three ways: Cohen's d (pooled SD), Hedges' correction and Glass's delta (SD of group 2).
When to use it
Use it when
- An A/B test or experiment with two arms and a continuous outcome.
- Comparing two existing groups, such as men and women or two regions, on a score or amount.
- Splitting a numeric variable at a cut point (for example age ≥ 40 versus younger) and comparing the halves.
Use something else when
- The same people measured twice: use the paired-samples t test.
- Three or more groups: use One-Way ANOVA rather than several t tests.
- Ordinal ratings or small, skewed samples: use the Mann-Whitney U test.
How to run it in Crosstabs
- 01
Load the data
Open your file in the workspace and switch to Statistics mode.
- 02
Choose Independent-Samples T Test
In the Compare means group, pick Independent-Samples T Test (T-TEST).
- 03
Set Test variables and the Grouping variable
Tick the outcome variables under Test variables and choose the Grouping variable.
- 04
Define the two groups
Under Define groups, choose Use specified values and pick Group 1 and Group 2, or choose Cut point so values ≥ the cut point form group 1.
- 05
Options and run
Set Confidence interval (%) and Missing values, declare any workspace weight, then click Run.
Worked example
Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.
Data
Exam scores for 40 synthetic students: 18 taught by lecture (SD about 6) and 22 in a flipped classroom (SD about 11). Drawn from normal distributions with a fixed seed; group 1 = flipped, group 2 = lecture.
| format | N | Mean | Std. Deviation | Std. Error Mean |
|---|---|---|---|---|
| flipped | 22 | 73.86 | 10.389 | 2.215 |
| lecture | 18 | 66.33 | 6.020 | 1.419 |
| Item | Levene F | Levene Sig. | t | df | Two-Sided p | Mean Difference | Std. Error Difference | 95% CI |
|---|---|---|---|---|---|---|---|---|
| Equal variances assumed | 4.438 | .042 | 2.720 | 38 | .010 | 7.53 | 2.768 | 1.93 to 13.13 |
| Equal variances not assumed | 2.863 | 34.58 | .007 | 7.53 | 2.630 | 2.19 to 12.87 |
| Item | Standardizer | Point Estimate | 95% CI |
|---|---|---|---|
| Cohen's d | 8.710 | 0.865 | 0.207 to 1.512 |
| Hedges' correction | 8.886 | 0.847 | 0.203 to 1.482 |
| Glass's delta | 6.020 | 1.251 | 0.489 to 1.988 |
How to read it
The flipped class scores 7.53 points higher on average. Levene's test gives F = 4.44, p = .042, so the variances differ and the Equal variances not assumed (Welch) row is the one to report: t(34.58) = 2.86, p = .007, 95% CI 2.19 to 12.87. Cohen's d is 0.86; Glass's delta, which scales by the lecture group's SD only, is 1.25.
Output tables explained
- Group Statistics
- N, mean, standard deviation and standard error of the mean in each group.
- Independent Samples Test
- Levene F and Sig., then for Equal variances assumed and Equal variances not assumed: t, df, one- and two-sided p, mean difference, standard error of the difference and its confidence interval.
- Independent Samples Effect Sizes
- Cohen's d, Hedges' correction and Glass's delta with standardizer, point estimate and noncentral-t confidence interval.
Assumptions and notes
- Each case belongs to one group only and cases are independent.
- The outcome is roughly normal within each group, or both groups are reasonably large.
- The Equal variances assumed row needs similar variances; the Welch row does not, which makes it the safer default with unequal group sizes.
How the results are validated
On Python-generated reference data, Levene's F and p match SciPy 1.18 levene(center="mean"), and the pooled and Welch t, df, p and confidence intervals match SciPy ttest_ind, all to a relative tolerance of 1e-9, for unweighted and frequency-weighted data. Cohen's d also matches pingouin 0.7; effect-size confidence limits agree to 1e-8 with an independent noncentral-t inversion. Validation evidence
Questions
Which row should I report?
If Levene's test is significant or the group sizes differ noticeably, report Equal variances not assumed (Welch). Many methodologists recommend Welch by default; with equal variances it gives almost the same answer.
Why does Levene's p differ from SciPy's default?
SPSS centres Levene's test on the group means; SciPy's levene() defaults to the median. Crosstabs follows SPSS here and says so in a footnote.
What is Glass's delta for?
It scales the difference by the standard deviation of group 2 only, which suits a control group whose spread is the natural yardstick or groups with clearly unequal variances.
Can I define the groups with a cut point?
Yes. Choose Cut point under Define groups: values at or above it form group 1 and values below it form group 2, as in SPSS.
Is anything uploaded?
No. The test runs on the data in your browser; the file stays on your device.
Related procedures
- Mann-Whitney U TestNPAR TESTS /M-W
- One-Way ANOVAONEWAY
- Paired-Samples T TestT-TEST PAIRS
- Bayesian Independent SamplesBAYES INDEPENDENT
- ExploreEXAMINE
- Free SPSS alternative: full coverage list
Run Independent-Samples T Test on your own data
Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.
SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.