Skip to main content
v2026.11,610 entries · CC-BY 4.0

Independent-Samples t-Test in SPSS: Step by Step

How to run an independent-samples t-test in SPSS: data layout, the Define Groups dialog, which Levene’s-test row to report, reading the output table, and calculating the effect size SPSS doesn’t print by default.

Ask about Independent-Samples t-Test in SPSS: Step by Step

Answers are drawn from this guide and the rest of the CASRAI corpus, with a link to every source.

Answers are AI-generated from CASRAI’s own published pages and can be wrong, so check the linked sources before relying on one; your question is logged without personal data — never sold, never used to train a third-party model — to show us what CASRAI is missing, so please do not type personal or confidential details. How we use this

Written and maintained by CASRAI Editorial Board

Last updated

The independent-samples t-test compares the means of a continuous variable between two separate, unrelated groups — for example, test scores for students taught with two different methods, or reaction times for a treatment group versus a control group. In SPSS, one procedure runs it, but the output has two branches (equal variances assumed vs. not assumed) that trip up a lot of first-time users, and SPSS does not print an effect size by default. This walks the whole procedure end to end: data layout, the Define Groups step, which output row to report, and the effect-size calculation SPSS leaves out.

When the independent-samples t-test is the right test

Use it when you have one continuous dependent variable and one categorical independent variable with exactly two levels, measured on two different sets of cases — not the same people measured twice (that’s a paired-samples t-test) and not three or more groups (that’s a one-way ANOVA). The classic assumptions are independence of observations (satisfied by the design, not tested), a roughly normal distribution of the dependent variable within each group (or a large enough sample that the Central Limit Theorem covers you — check with SPSS’s normality tests if you’re unsure), and no extreme outliers driving the group means. Equality of variance is not an assumption you have to satisfy going in — SPSS tests it for you and gives you a valid result either way, which is exactly what the Levene’s test row in the output is for.

Step 1: Lay out your data correctly

SPSS’s Independent-Samples T Test needs your data in wide format: one row per case (participant, sample, subject), with two columns involved in the test — a test variable column holding the continuous score, and a grouping variable column holding a code that identifies which of the two groups that row belongs to (commonly 1/2, though any two distinct numeric or string values work). Every case’s group membership lives in that one column; you do not split the two groups into separate columns the way some other packages expect.

Step 2: Open the procedure

Go to Analyze > Compare Means (relabeled Compare Means and Proportions in newer SPSS Statistics releases — same location in the menu, just a renamed heading) > Independent-Samples T Test…. Move your continuous outcome into the Test Variable(s) box and your two-level categorical variable into the Grouping Variable box.

Step 3: Define Groups — the step people get stuck on

As soon as you drop a variable into Grouping Variable, SPSS shows it with two question marks, e.g. group(? ?), and grays out OK until you click Define Groups and tell it which two values represent the two groups. You have two options:

  • Use specified values — type the exact two codes your grouping variable uses (e.g. Group 1: 1, Group 2: 2). This is the right choice almost always, and the only option if your grouping variable is a string.
  • Cut point — give SPSS a numeric threshold and it splits a continuous or ordinal variable into “below” and “at-or-above” groups on the fly. Use this only when you’re deliberately dichotomizing a continuous variable (e.g. splitting age at a median); it is not the normal path for a variable that already codes two groups.

Click Continue, then OK (or Paste first if you want the equivalent syntax saved for a reproducible .sps file — the pasted command is T-TEST GROUPS=grpvar(1 2) /VARIABLES=outcome /CRITERIA=CI(.95).).

Step 4: Read the two output tables

SPSS produces two tables. Group Statistics is descriptive only — N, mean, standard deviation, and standard error of the mean for each group — and is worth a glance before you touch the inferential table, since a wildly different N between groups or an implausible mean is often the first sign of a coding error. Independent Samples Test is where the actual test lives, and it prints two full rows for the same test variable: “Equal variances assumed” and “Equal variances not assumed.” Only one of those rows is the one you report, and the Levene’s test columns on the left of the table are what decide which.

Step 5: The Levene’s test branch

Levene’s test for equality of variances is not the hypothesis test you asked for — it’s a diagnostic that decides which of the two t-test rows to trust:

  • If Levene’s Sig. value is greater than .05, variances are not significantly different — report the “Equal variances assumed” row (the pooled-variance t-test).
  • If Levene’s Sig. value is .05 or less, variances differ significantly — report the “Equal variances not assumed” row (the Welch-Satterthwaite t-test, which uses adjusted, often non-integer, degrees of freedom).

This single decision rule is the most common place people go wrong: reading the top row automatically, or reading both and picking whichever has the smaller p-value. Neither is correct — the Levene’s result determines the row before you even look at the t-test result itself.

Step 6: Read the t-test row itself

Once you know which row to use, it has six numbers worth reading together, not in isolation:

  • t — the test statistic itself.
  • df — degrees of freedom; an integer (N1 + N2 − 2) on the pooled row, a decimal on the Welch row.
  • Sig. (2-tailed) — the p-value. This is what you compare to your alpha level (conventionally .05), not the Levene Sig. column to its left — a mistake easy to make because the columns sit next to each other.
  • Mean Difference — Group 1’s mean minus Group 2’s mean, signed.
  • Std. Error Difference — the standard error of that mean difference, used to build the CI.
  • 95% Confidence Interval of the Difference (Lower/Upper) — report this alongside the p-value; if it excludes zero, that’s consistent with a significant result, and it tells you the plausible range of the true difference in a way a p-value alone doesn’t.

Step 7: Calculate the effect size

Sig. (2-tailed) tells you whether a difference exists; it says nothing about how large it is. In SPSS Statistics 27 and later, checking Estimate effect sizes in the T-Test dialog’s Options panel adds a small table with Cohen’s d, Hedges’ correction, and Glass’s delta directly to the output. If your version or dialog doesn’t offer it, Cohen’s d is straightforward to compute from numbers already on the Group Statistics table:

d = (M1 − M2) / spooled, where spooled = √[((n1−1)s1² + (n2−1)s2²) / (n1+n2−2)]

By convention (offered as a rough guide, not a rule) |d| around 0.2 is a small effect, 0.5 medium, and 0.8 large.

Worked example (illustrative synthetic data)

The numbers below are a synthetic, illustrative dataset generated for this guide — not a real study — used to show what the SPSS output looks like and how to read it. Two independent groups of 15 simulated exam scores each (Group A: an existing study method; Group B: a new study method), computed independently with a seeded random-number script rather than typed in by hand.

N Mean Std. Deviation
Group A 15 68.99 7.16
Group B 15 76.09 10.80

Levene’s Test for Equality of Variances: F(1, 28) = 2.55, Sig. = .121 — greater than .05, so variances are not significantly different and the “Equal variances assumed” row is the one to report.

t df Sig. (2-tailed) Mean Difference 95% CI
Equal variances assumed −2.12 28 .043 −7.10 [−13.95, −0.25]

Cohen’s d = (68.99 − 76.09) / 9.15 ≈ −0.78, a large effect by convention. Written up in APA style: “An independent-samples t-test found that exam scores were significantly higher for Group B (M = 76.09, SD = 10.80) than Group A (M = 68.99, SD = 7.16), t(28) = −2.12, p = .043, 95% CI [−13.95, −0.25], d = −0.78.”

Common mistakes

  • Entering data long instead of wide. If your two groups’ scores sit in two separate columns instead of one test-variable column plus one grouping column, SPSS can’t run this procedure until you restructure the data.
  • Forgetting Define Groups. Leaving the grouping variable as group(? ?) and hitting Paste anyway pastes a broken syntax command with empty group codes.
  • Reading the Levene Sig. column as the test result. The p-value that answers “is there a group difference” is Sig. (2-tailed) on the t-test side, not Levene’s Sig. on the left.
  • Using this test on paired or repeated data. If the same people were measured twice (pre/post, before/after), use the paired-samples t-test instead — running the independent-samples version on paired data ignores the correlation between the two measurements and gives the wrong standard error.
  • Skipping the effect size. A tiny mean difference can be statistically significant in a large sample; Cohen’s d (or the built-in effect-size table in newer SPSS versions) is what tells you whether that difference is practically meaningful.

FAQ

What do I do if Levene’s test is significant?

Report the “Equal variances not assumed” row instead of the “Equal variances assumed” row — SPSS has already recalculated the t-statistic, standard error, and (non-integer) degrees of freedom for you using the Welch-Satterthwaite correction. You don’t need to run a separate test.

What’s the difference between the independent-samples and paired-samples t-test in SPSS?

The independent-samples test compares two different groups of cases (different people, different samples). The paired-samples t-test compares two measurements taken on the same cases (before/after, or two matched conditions). Using the wrong one for your design produces an incorrect standard error even if SPSS runs without an error message.

Does SPSS report Cohen’s d automatically?

Only if you check “Estimate effect sizes” in the T-Test dialog’s Options panel, available in SPSS Statistics 27 and later. Otherwise it isn’t part of the default output, and you calculate it from the group means, standard deviations, and sample sizes already printed in the Group Statistics table.

Can I use the independent-samples t-test with more than two groups?

No — it’s built for exactly two groups. For three or more groups on one categorical factor, use a one-way ANOVA instead; running repeated pairwise t-tests across more than two groups inflates the Type I error rate.

What sample size do I need?

There’s no universal minimum enforced by SPSS itself. As a rough guide, larger samples make the test more robust to the normality assumption via the Central Limit Theorem; very small groups (rule-of-thumb under about 15 per group) are where checking normality directly, rather than assuming it, matters most.

Related reading

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Regulatory Radar

Stop finding out after the fact

$29/month, cancel anytime. Daily digest updates from our analysis, a dashboard holding the same items, and a cited assistant for everything they raise.

  • Federal Register, Federal Register+, Grants.gov, Regulations.gov, NSF News, UKRI, plus CASRAI’s own published content.
  • 44,322 indexed passages, and every answer cites the ones it drew on.