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

  1. 01

    Load the data

    Open your file in the workspace and switch to Statistics mode.

  2. 02

    Choose Independent-Samples T Test

    In the Compare means group, pick Independent-Samples T Test (T-TEST).

  3. 03

    Set Test variables and the Grouping variable

    Tick the outcome variables under Test variables and choose the Grouping variable.

  4. 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.

  5. 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.

Try with example data

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.

Group Statistics
formatNMeanStd. DeviationStd. Error Mean
flipped2273.8610.3892.215
lecture1866.336.0201.419
Independent Samples Test
ItemLevene FLevene Sig.tdfTwo-Sided pMean DifferenceStd. Error Difference95% CI
Equal variances assumed4.438.0422.72038.0107.532.7681.93 to 13.13
Equal variances not assumed2.86334.58.0077.532.6302.19 to 12.87
Independent Samples Effect Sizes
ItemStandardizerPoint Estimate95% CI
Cohen's d8.7100.8650.207 to 1.512
Hedges' correction8.8860.8470.203 to 1.482
Glass's delta6.0201.2510.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.

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.

Open the workspace

SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.