Fundamentals 6 min read

How to Perform a 2×2 Chi‑Square Test in SPSS: Step‑by‑Step Guide

This guide explains how to conduct a 2 × 2 chi‑square test in SPSS, covering data entry, weighting, step‑by‑step menu selections, cell options, result interpretation, and decision rules for choosing the appropriate test based on sample size and expected frequencies.

Model Perspective
Model Perspective
Model Perspective
How to Perform a 2×2 Chi‑Square Test in SPSS: Step‑by‑Step Guide

Introduction

Chi‑square test (2x2) is a statistical method used to examine whether there is a significant association between two categorical variables, often to see if one variable can predict the other.

In SPSS the test can be performed via the “Crosstabs” module. Choose the two categorical variables, go to the “Statistics” tab, select “Chi‑square”, and click OK. SPSS will generate a cross‑tabulation and display the chi‑square results.

Example

Example: 198 patients with acute myocardial infarction were treated with drug A (11 deaths, 5.56% mortality) and 42 patients with drug B (6 deaths, 14.29% mortality). Question: Is there a difference in mortality between the two groups?

This is a typical binary outcome scenario. The 2 × 2 contingency table (four‑cell table) is used for the chi‑square test.

Data entry

(1) Variable view

(2) Data view

Weight cases: Choose Data → Weight Cases, check “Weight cases by”, place the frequency variable, and click OK. Because each row represents multiple observations, weighting is required.

If each row represents a single observation, weighting is unnecessary.

Analyze → Descriptive Statistics → Crosstabs

Options settings

(1) Main dialog: move the grouping variable (Drug) to the Row(s) box and the outcome variable (Outcome) to the Column(s) box. The variables can be swapped without affecting the result.

(2) Statistics: check “Chi‑square” to perform the chi‑square test for grouped count data.

(3) Cells: under Counts check “Observed” and “Expected”; under Percentages check “Row” to display row percentages.

Result interpretation:

Table 2 shows observed frequencies, percentages, and expected frequencies (row total × column total / grand total). The expected frequencies and total sample size determine which chi‑square result to use.

Conclusions:

If total N ≥ 40 and all expected frequencies ≥ 5, use Pearson Chi‑Square.

If total N ≥ 40 and one expected frequency is between 1 and 5, use Continuity Correction.

If total N ≥ 40 and at least two expected frequencies are between 1 and 5, use Fisher’s Exact Test.

If total N < 40 or any expected frequency < 1, use Fisher’s Exact Test.

In this example N = 240 > 40, with one expected frequency = 3.0 < 5, so the Continuity Correction result is considered: χ² = 2.796, P = 0.095 > 0.05. Therefore the mortality rates (5.6 % vs 14.3 %) differ but not statistically significant.

Reference: Li Yanlong, “Chi‑square test (2x2) – SPSS tutorial”.

statisticsSPSSmedical researchchi-square2x2 contingency table
Model Perspective
Written by

Model Perspective

Insights, knowledge, and enjoyment from a mathematical modeling researcher and educator. Hosted by Haihua Wang, a modeling instructor and author of "Clever Use of Chat for Mathematical Modeling", "Modeling: The Mathematics of Thinking", "Mathematical Modeling Practice: A Hands‑On Guide to Competitions", and co‑author of "Mathematical Modeling: Teaching Design and Cases".

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.