Table of Contents
The McNemar’s Test is a powerful non-parametric statistical procedure specifically designed to analyze changes in proportions when dealing with matched or paired data. This test is crucial in situations where the same subjects are measured twice, often before and after an intervention, making it ideal for experimental designs that assess the effectiveness of a program or intervention. Essentially, it determines whether the observed differences between the two related samples are statistically significant, focusing exclusively on the discordant pairs—those subjects whose outcome changed between the two measurements.
Mastering the implementation of this test within statistical software is essential for rigorous research. This comprehensive tutorial provides a step-by-step guide on how to accurately perform the McNemar’s Test using SPSS (Statistical Package for the Social Sciences), ensuring accurate interpretation of the results for your research conclusions.
Designing the Study: A Practical Example
To illustrate the application of the McNemar’s Test, consider a common research scenario in marketing or social science. Researchers are attempting to assess the impact of a targeted marketing video on public opinion regarding a specific legislative proposal. The goal is to determine if viewing the video causes a statistically significant shift in support or opposition among the participants. This design necessitates a pre-test/post-test approach on the same cohort of subjects, fulfilling the requirements of paired categorical data analysis.
A sample of 25 participants is first surveyed to establish their initial stance (Support or Do Not Support) on the law. Following this baseline measurement, all 25 individuals are exposed to the marketing video. Immediately after viewing the content, they are surveyed a second time to record their post-intervention opinion. This robust design creates the necessary paired structure for the analysis, where each individual serves as their own control across the two time points. The test will specifically examine if the number of people switching from “Do Not Support” to “Support” is significantly different from those switching from “Support” to “Do Not Support.”
The results of this study are typically summarized in a 2×2 contingency table, which cross-classifies the responses before and after the intervention. The critical data points are the counts of individuals who changed their stance. The following table presents the aggregated frequency data for this example, which will be the basis for the SPSS analysis:
| Before Marketing Video | ||
|---|---|---|
| After Marketing Video | Do Not Support | Support |
| Do Not Support | 7 | 5 |
| Support | 3 | 10 |
Preparing Data for Analysis in SPSS
Before running any statistical analysis, the data must be correctly structured in the SPSS Data View. For paired tests like McNemar’s Test, it is absolutely essential that each row represents a single statistical unit—in this case, an individual participant. This structure ensures that the software can correctly identify the linked pairs of measurements (Before and After). If the data were entered as frequencies (using the summary table above), SPSS would require weighting the cases, which complicates the process unnecessarily.
The dataset should contain at least three key variables: an identifier (ID), the measurement taken before the intervention (Before), and the measurement taken after the intervention (After). Since the data is categorical (Support/Do Not Support), ensure that appropriate numerical coding (e.g., 1 for Support, 0 for Do Not Support) is used in the Data View, and corresponding value labels have been assigned in the Variable View for clarity during output interpretation.
Step 1: Enter the data.
The data should be meticulously entered into the SPSS data sheet as illustrated below, where each row uniquely maps an individual’s ID to their stance both prior to and subsequent to viewing the marketing video. This setup is crucial for maintaining the integrity of the paired observations required by the test.

Executing McNemar’s Test via Crosstabs
Unlike some other paired tests that have dedicated menu options, the McNemar’s Test is accessed in SPSS through the non-parametric procedures housed within the Crosstabs dialog box. This pathway is utilized because the test fundamentally relies on analyzing the cell counts of a 2×2 contingency table derived from the paired categorical outcomes, specifically comparing the off-diagonal cells.
Step 2: Perform McNemar’s Test.
To initiate the analysis, navigate through the main menu bar: Click the Analyze tab, hover over Descriptive Statistics, and then select Crosstabs. This action opens the primary dialog window necessary for defining the variables and selecting the required statistical test parameters.

Within the Crosstabs window, correctly assign the variables to their respective positions. It is conventional, although not strictly mandatory for the calculation, to drag the variable representing the post-intervention measurement (After) into the box labeled Rows and place the pre-intervention measurement (Before) into the box labeled Columns. Crucially, click the button labeled Statistics, where you must ensure that the checkbox adjacent to McNemar is selected. This instructs SPSS to calculate the specific statistic required for the paired analysis. After confirmation, click Continue to close the Statistics sub-dialog, and finally, click OK in the main Crosstabs window to generate the statistical output.

Interpreting the Statistical Output
Once the analysis is complete, SPSS produces a series of tables summarizing the data and providing the test results. Careful examination of these tables is essential for drawing accurate conclusions regarding the effectiveness of the intervention or the significance of the shift in proportions.
Step 3: Interpret the results.

The output begins with the Case Processing Summary, which verifies data integrity. Here, the first table displays the number of valid and missing cases; we confirm 0 missing cases, meaning all 25 participants were included. The subsequent table is the Crosstabulation itself, which visually confirms the frequency counts used in the calculation, matching the 2×2 table we initially reviewed (7, 5, 3, 10). This table should always be checked to ensure the data was entered and processed correctly.
The most critical table is the “Chi-Square Tests” table, which reports the results of the McNemar’s Test. We focus on the asymptotic significance value, commonly known as the p-value. In this specific analysis, the p-value is reported as .727. To determine statistical significance, we compare this value to our predetermined alpha level (level of significance), typically set at 0.05. Since 0.727 is considerably greater than 0.05, we must fail to reject the null hypothesis. Therefore, there is insufficient statistical evidence to conclude that the proportion of people supporting the law significantly changed after viewing the marketing video.
Deep Dive into the Chi-Square Calculation
While SPSS handles the computations automatically, understanding the underlying mathematics provides deeper insight into how the McNemar’s Test functions. The test is specifically designed to assess symmetry in the discordant cells (B and C) of the 2×2 table, which represent subjects who changed their opinion.
The standard notation for the 2×2 contingency table derived from paired samples is defined as follows:
| Before Marketing Video | ||
|---|---|---|
| After Marketing Video | Do Not Support | Support |
| Do Not Support | A | B |
| Support | C | D |
SPSS calculates the Chi-square test statistic using the formula (with continuity correction applied): X² = (|B – C| – 1)² / (B + C). This formula tests whether the count of subjects who switched from the column variable to the row variable (B) is significantly different from the count of subjects who switched from the row variable to the column variable (C).
Applying the observed cell counts from our example (B=5, C=3), the calculation yields: X² = (|5 – 3| – 1)² / (5 + 3) = (2 – 1)² / 8 = 1² / 8 = 0.125.
The resulting Chi-square test statistic of 0.125 is then compared against the theoretical Chi-square distribution with 1 degree of freedom. This comparison allows us to derive the asymptotic significance (p-value). Using the appropriate statistical tables or software, we confirm that a Chi-square test statistic value of 0.125 with 1 degree of freedom corresponds to a p-value of .727, precisely validating the output generated by SPSS.
Cite this article
Mohammed looti (2025). Learn How to Perform McNemar’s Test in SPSS: A Step-by-Step Tutorial. PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/perform-mcnemars-test-in-spss/
Mohammed looti. "Learn How to Perform McNemar’s Test in SPSS: A Step-by-Step Tutorial." PSYCHOLOGICAL STATISTICS, 8 Nov. 2025, https://statistics.arabpsychology.com/perform-mcnemars-test-in-spss/.
Mohammed looti. "Learn How to Perform McNemar’s Test in SPSS: A Step-by-Step Tutorial." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/perform-mcnemars-test-in-spss/.
Mohammed looti (2025) 'Learn How to Perform McNemar’s Test in SPSS: A Step-by-Step Tutorial', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/perform-mcnemars-test-in-spss/.
[1] Mohammed looti, "Learn How to Perform McNemar’s Test in SPSS: A Step-by-Step Tutorial," PSYCHOLOGICAL STATISTICS, vol. X, no. Y, ص Z-Z, November, 2025.
Mohammed looti. Learn How to Perform McNemar’s Test in SPSS: A Step-by-Step Tutorial. PSYCHOLOGICAL STATISTICS. 2025;vol(issue):pages.