How to Run an Independent Samples t Test in SPSS (Step by Step)

This guide walks you through running an independent samples t test in IBM SPSS Statistics, from setting up the data file to reading the output and writing the result in APA style. The steps apply to recent versions of SPSS; menu names have changed slightly over the years, and the differences are noted below. If you do not have SPSS to hand, or want to double-check your output, the free independent samples t test calculator produces the same Levene, Student and Welch results.

When to use an independent samples t test

Use it to compare the mean of a continuous dependent variable between two independent groups, for example exam scores of students taught online and in class. Each participant belongs to only one group. If the same people are measured twice, use a paired samples t test instead (Analyze → Compare Means → Paired-Samples T Test). If you have three or more groups, use one-way ANOVA.

Step 1: Set up your data in SPSS

SPSS needs the data in ‘long’ format: one row per participant, with one column for the grouping variable and one column for the outcome.

  • In Variable View, create a grouping variable (for example Group) with type Numeric. Click the Values cell and add value labels, such as 1 = Online and 2 = Classroom. Set Measure to Nominal.
  • Create the outcome variable (for example Score) and set Measure to Scale.
  • In Data View, enter 1 or 2 in the Group column and the score in the Score column for each participant.

A common mistake is to put the two groups’ scores in two separate columns, as you might in Excel. SPSS cannot run an independent t test from that layout. Restructure the data first so that all scores are in one column.

Step 2: Check the assumptions

Before the t test, look at the distribution of the outcome in each group. Use Analyze → Descriptive Statistics → Explore, move Score to the Dependent List and Group to the Factor List, click Plots and tick Histogram and Normality plots with tests. Check:

  • Histograms and Q–Q plots for strong skew or outliers.
  • Skewness and kurtosis values. A z-score for skewness or kurtosis (statistic divided by its standard error) beyond about ±1.96 suggests non-normality in small samples, while larger samples need more lenient criteria (Ghasemi & Zahediasl, 2012; Field, 2018).
  • The boxplot for extreme outliers (marked with asterisks).

The t test is reasonably robust to moderate departures from normality, particularly when groups are similar in size and contain about 30 or more participants. For small, clearly non-normal samples, use the Mann-Whitney U test (Analyze → Nonparametric Tests → Legacy Dialogs → 2 Independent Samples).

Step 3: Run the t test

  1. Go to Analyze → Compare Means → Independent-Samples T Test. In recent versions the menu is called Compare Means and Proportions.
  2. Move Score into the Test Variable(s) box. You can add several outcomes at once.
  3. Move Group into the Grouping Variable box. It will show Group(? ?).
  4. Click Define Groups and enter the codes you used: 1 for Group 1 and 2 for Group 2. Click Continue.
  5. If your version shows the option Estimate effect sizes (SPSS 27 and later), make sure it is ticked.
  6. Click Options to check the confidence interval (95% by default) and how missing values are handled, then click OK.

Step 4: Read the output

SPSS produces two main tables (three if effect sizes are requested).

Group Statistics

This table shows N, the mean, the standard deviation and the standard error of the mean for each group. Note which group has the higher mean. You will need these numbers for the write-up.

Independent Samples Test

This is the key table. It has two rows: Equal variances assumed and Equal variances not assumed.

  • Levene’s Test for Equality of Variances (F and Sig.) tests whether the two groups have similar variances. If Sig. is .05 or greater, variances can be treated as equal, so read the first row. If Sig. is below .05, read the second row, which is Welch’s t test. Many methodologists recommend using Welch’s row by default, because it is reliable either way (Delacre et al., 2017).
  • t and df: the test statistic and its degrees of freedom. Welch’s row has fractional df.
  • Sig. (2-tailed): the two-tailed p-value. In SPSS 27 and later you will see One-Sided p and Two-Sided p; use the two-sided value unless you pre-registered a directional hypothesis.
  • Mean Difference and 95% Confidence Interval of the Difference: the size of the difference between the group means and its plausible range.

If Sig. shows .000, report p < .001. It does not mean the probability is zero.

Independent Samples Effect Sizes

SPSS 27 and later report Cohen’s d, Hedges’ correction and Glass’s delta. Report Cohen’s d, or Hedges’ g for small samples. Older versions do not calculate d; you can compute it from the group means and SDs with the Cohen’s d calculator. Cohen (1988) described d ≈ 0.20 as small, 0.50 as medium and 0.80 as large.

Step 5: Write the result in APA style

Combine the descriptive statistics, the test result, the effect size and the confidence interval:

An independent samples t test was conducted to compare exam scores for online and classroom students. Classroom students (M = 74.20, SD = 8.10) scored significantly higher than online students (M = 68.90, SD = 8.60), t(60) = 2.50, p = .015, d = 0.64, 95% CI of the difference [1.06, 9.54].

If you used Welch’s row, mention it and report the fractional df, for example t(59.07) = 2.49. For more examples, including non-significant results and tables, see how to report a t test in APA.

Troubleshooting

  • ‘Define Groups’ is greyed out: select the grouping variable inside the Grouping Variable box first.
  • The output shows no cases or an error about groups: the codes in Define Groups do not match the values in your data (for example, you entered 1 and 2 but the data use 0 and 1).
  • The grouping variable is text: SPSS accepts string grouping variables, but you must type the exact text values in Define Groups. Numeric codes with value labels are easier.
  • You have more than two groups: Define Groups lets you compare two specific codes, but for an overall comparison use one-way ANOVA (Analyze → Compare Means → One-Way ANOVA).

Checklist

  1. Data in long format with a coded grouping variable.
  2. Assumptions checked with Explore.
  3. Levene’s test read and the correct row used.
  4. Two-sided p, mean difference and 95% CI noted.
  5. Cohen’s d reported with interpretation.
  6. APA sentence written with M, SD, t(df), p, d and CI.

Reporting several outcome variables

If you entered several test variables at once, SPSS produces one row per variable in each table. In your thesis, present them together in an APA-style table with the means and standard deviations of both groups, t, df, p and d for each outcome, and summarise the main pattern in the text. When you test many outcomes, consider whether a correction for multiple comparisons is needed, and be cautious about isolated significant results. Do not paste the SPSS tables directly into the chapter; rebuild them in APA format, as explained in how to write the data analysis chapter.

Roman Urdu mein khulasa

SPSS mein independent t test chalane ke liye data aik column (Score) aur aik grouping column (Group: 1 aur 2) mein rakhein. Phir Analyze → Compare Means → Independent-Samples T Test kholein, Score ko Test Variable aur Group ko Grouping Variable mein dalein, aur Define Groups mein 1 aur 2 likhein. Output mein Levene’s test dekhein: Sig. .05 se kam ho to ‘Equal variances not assumed’ (Welch) wali row parhein. SPSS .000 dikhaye to p < .001 likhein. SPSS 27 aur us ke baad wale versions Cohen's d bhi dete hain.

Frequently asked questions

Which row of the SPSS t test table should I report?

If Levene’s test is not significant (Sig. ≥ .05), report ‘Equal variances assumed’. If it is significant, report ‘Equal variances not assumed’ (Welch’s t test).

Why does SPSS show Sig. = .000?

The p-value is smaller than .0005 and is rounded. Report it as p < .001.

How do I get Cohen’s d in SPSS?

SPSS 27 and later report it in the Independent Samples Effect Sizes table. In older versions, calculate it from the group means and SDs.

Should I use the one-sided or two-sided p?

Use the two-sided p unless you stated a directional hypothesis before collecting your data.

My two groups are in separate columns. What should I do?

Restructure the data into long format: one column with all the scores and one column with the group code.

Related calculators

References

  • Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.
  • Delacre, M., Lakens, D., & Leys, C. (2017). Why psychologists should by default use Welch’s t-test instead of Student’s t-test. International Review of Social Psychology, 30(1), 92–101. https://doi.org/10.5334/irsp.82
  • Field, A. (2018). Discovering statistics using IBM SPSS Statistics (5th ed.). SAGE.
  • Ghasemi, A., & Zahediasl, S. (2012). Normality tests for statistical analysis: A guide for non-statisticians. International Journal of Endocrinology and Metabolism, 10(2), 486–489. https://doi.org/10.5812/ijem.3505
  • Pallant, J. (2020). SPSS survival manual: A step by step guide to data analysis using IBM SPSS (7th ed.). Routledge.

Written and maintained by the ScholarCalc team. Last reviewed: November 2026.