Can McNemar’s Test be performed in SPSS for analyzing paired nominal data? 2

How to Perform McNemar’s Test in SPSS for Paired Nominal Data

Perform McNemar’s Test in SPSS


McNemar’s Test serves as a fundamental statistical procedure designed to assess the changes in proportions within paired nominal data. This test is particularly valuable when researchers are working with a dichotomous dependent variable that has been measured twice for the same subjects, typically in a “before-and-after” experimental design. By focusing on the marginal homogeneity of a contingency table, this test determines whether the initial state of a subject has significantly shifted following a specific intervention or over a set period of time.

Within the environment of IBM SPSS Statistics, performing this test is both streamlined and efficient, allowing for rigorous data analysis without the need for manual calculations. The primary objective is to evaluate whether the null hypothesis—which posits that the marginal probabilities for each outcome are the same—can be rejected in favor of an alternative hypothesis indicating a significant change. In professional research settings, this tool is indispensable for validating the efficacy of treatments, marketing campaigns, or educational interventions where the outcome is categorical.

This comprehensive tutorial provides an exhaustive walkthrough of how to execute McNemar’s Test using SPSS. We will cover everything from the conceptual framework of the test to the final interpretation of the p-value. By following these structured steps, researchers can ensure their statistical inference is accurate, reliable, and grounded in established mathematical principles.

The Significance of McNemar’s Test in Categorical Data Analysis

The McNemar’s test is uniquely tailored for situations where the data is not independent. Unlike the standard Chi-square test of independence, which assumes that the groups being compared are separate entities, this test is specifically intended for related samples. This distinction is crucial because using an independent test on paired data would violate the assumption of independence, leading to incorrect results and potentially flawed scientific conclusions.

In the realm of non-parametric statistics, this test stands out because it focuses exclusively on the “discordant pairs”—those subjects whose responses changed from the first measurement to the second. Those who remained consistent (e.g., supported the law both before and after) do not contribute to the test statistic itself, as they do not provide evidence of change. Consequently, the power of the test is derived from the individuals who shifted their opinions or statuses, making it a highly sensitive tool for detecting transitions within a population.

Furthermore, understanding nominal data is essential for the correct application of this test. Nominal variables are those that represent categories without any intrinsic ranking, such as “Yes/No,” “Support/Do Not Support,” or “Pass/Fail.” Because these categories lack numerical value, traditional parametric tests like the t-test cannot be applied. Therefore, this test provides a robust alternative for researchers seeking to quantify change in qualitative outcomes across two related time points.

Identifying the Ideal Scenarios for Paired Nominal Testing

To ensure the validity of your results, it is imperative to identify the correct experimental context. The most common scenario involves a pre-test/post-test design where a single group of participants is exposed to a treatment. For instance, a medical researcher might use this test to determine if a new drug changes the presence of a symptom (Present vs. Absent) before and after medication. The focus is always on the marginal distributions of the 2×2 table, comparing the total number of “Yes” responses at time A versus the total number of “Yes” responses at time B.

Another appropriate scenario is the matched-pairs design. In this setup, subjects are paired based on specific characteristics (like age or gender), and one member of the pair is assigned to a control group while the other is assigned to an experimental group. Since the pairs are matched, they are considered “related,” and their binary outcomes can be analyzed using the same mathematical framework. This allows for a controlled comparison while accounting for potential confounding variables that might otherwise skew the data.

Before proceeding, one must also consider the sample size and the distribution of the data. While the test is effective for many sample sizes, if the number of discordant pairs is very small, exact binomial tests might be preferred over the Chi-square approximation. However, for most standard social science and marketing research applications, the version of the test provided by software like SPSS is more than sufficient for drawing meaningful statistical conclusions.

Example: Applying McNemar’s Test in a Marketing Context

Suppose a group of political researchers wants to investigate the persuasive power of a specific marketing video regarding a newly proposed law. To do this, they recruit a sample of 25 individuals. Initially, these participants are surveyed to determine their current stance on the law: do they Support it or Do Not Support it? This establishes the baseline measurement for the study, capturing the initial proportions of the population’s opinion before any intervention occurs.

After the initial survey, the participants are shown a high-impact marketing video designed to highlight the benefits of the law. Immediately following the video, a second survey is conducted using the exact same question. This results in paired data, where each participant has an “Initial Stance” and a “Final Stance.” The goal is to see if the video caused a statistically significant shift in the overall proportion of support within the group.

The following table illustrates the distribution of these 25 participants, categorizing them based on their stances before and after the intervention:

Before Marketing Video
After Marketing VideoDo Not SupportSupport
Do Not Support75
Support310

To determine if there was a statistically significant difference in the proportion of people who supported the law before and after viewing the video, we can use the following steps to perform McNemar’s Test in SPSS. This will help us decide if the observed change is due to the video or simply due to random chance.

Step 1: Constructing the Data Framework within SPSS

The first requirement for performing the analysis is to input the raw data into the SPSS Data Editor. Unlike aggregated tables, SPSS typically requires each row to represent an individual observation or case. In this dataset, you will need at least three columns: one for a unique Participant ID, one for the Before status, and one for the After status. Proper data entry is the backbone of any successful statistical analysis.

When entering categorical data, it is best practice to use numeric codes (e.g., 0 for “Do Not Support” and 1 for “Support”) and define these in the Variable View using Value Labels. This allows the software to perform mathematical operations while still displaying the descriptive names in your final output tables. Consistency in coding across the “Before” and “After” variables is mandatory for the test to function correctly.

Refer to the image below for an example of how the Data View should appear once the 25 participants’ responses have been logged. Notice that each row correlates a single person’s change (or lack thereof) across the two measurements, creating the “paired” structure necessary for McNemar’s Test.

Each row shows an individual’s ID, their stance before watching the marketing video, and their stance after watching the marketing video. Ensuring that the data is structured this way is essential for the software to recognize the relationship between the two time points.

Step 2: Executing the Analysis Procedure

Once the data is correctly staged, you can initiate the calculation. Navigate to the top menu and click on the Analyze tab. From the dropdown menu, select Descriptive Statistics and then choose Crosstabs. This module is the primary location for analyzing the relationship between two categorical variables, providing a variety of tests for contingency tables.

In the Crosstabs dialog box, you must assign your variables to the appropriate fields. Drag the After variable into the box labeled Rows and the Before variable into the box labeled Columns. While the specific placement (Rows vs. Columns) does not change the resulting p-value, following this convention makes the resulting crosstabulation easier to read and interpret according to standard academic formats.

After assigning the variables, click the button labeled Statistics located on the right side of the dialog box. A new window will appear containing various statistical tests. Locate the checkbox next to McNemar and ensure it is selected. This tells SPSS to specifically calculate the test statistic for paired nominal data alongside the standard frequency counts. Click Continue and then OK to run the procedure.

McNemar's test in SPSS example

Step 3: Comprehensive Interpretation of the SPSS Output

The SPSS Output Viewer will generate several tables that require careful examination. The first table is the Case Processing Summary, which indicates the number of valid cases used in the analysis. It is vital to confirm that there are 0 missing cases, as a high number of missing values could bias the results and reduce the statistical power of your findings.

Output of McNemar's test in SPSS

The second table is the Crosstabulation table, which serves as a visual representation of the raw data. It displays the frequencies of participants who stayed the same (the concordant pairs in the diagonal) and those who changed (the discordant pairs). In our example, we see that 5 people moved from “Support” to “Do Not Support,” while 3 people moved from “Do Not Support” to “Support.” These numbers are the key drivers of the final result.

The third and most critical table is the Chi-Square Tests table, which displays the actual result of the McNemar’s Test. The value we are most interested in is the Asymptotic Significance (2-sided), which is the p-value. In this example, the p-value is .727. Since this value is significantly higher than the standard alpha level of 0.05, we fail to reject the null hypothesis. This suggests that the marketing video did not produce a statistically significant change in the proportion of supporters.

Theoretical Underpinnings of the Chi-Square Calculation

To truly master data analysis, it is helpful to understand the math that SPSS performs behind the scenes. For a 2×2 contingency table, the test focuses on the cells that represent change. Let’s label the cells for clarity: Cell A (No Change/No Support), Cell B (Changed from Support to No Support), Cell C (Changed from No Support to Support), and Cell D (No Change/Support).

Before Marketing Video
After Marketing VideoDo Not SupportSupport
Do Not SupportAB
SupportCD

The formula used by SPSS incorporates a Yates’s correction for continuity to ensure the Chi-square distribution accurately approximates the discrete data. The formula is: (|B – C| – 1)² / (B + C). This calculation yields the test statistic, which is then used to find the corresponding p-value based on one degree of freedom.

In our specific example, the calculation would be: (|5 – 3| – 1)² / (5 + 3) = (1)² / 8 = 1/8 = .125. By consulting a Chi-square distribution table or using the software’s internal algorithms, we find that a value of .125 with one degree of freedom results in a p-value of .727. This high p-value confirms that the difference between the 5 people who switched one way and the 3 who switched the other is likely due to sampling error rather than a real effect of the video.

Best Practices for Reporting Your Results

When documenting the results of McNemar’s Test in a research paper or professional report, it is important to provide more than just the p-value. You should report the frequencies of the discordant pairs to give the reader a clear sense of the direction of the change. Even if the result is not statistically significant, describing the raw numbers adds necessary context to your data interpretation.

A standard reporting sentence might look like this: “A McNemar’s test was conducted to determine if there was a change in support for the law after viewing a marketing video. Results indicated no significant difference in the proportion of supporters before and after the intervention (p = .727).” Including the sample size (n=25) and the specific test statistic (Chi-square = .125) further enhances the transparency and reproducibility of your statistical research.

Finally, always consider the limitations of your study. A non-significant result could be due to a true lack of effect, or it could be a Type II error caused by a small sample size. In our example, with only 25 participants, the study might be underpowered to detect a small but real change. Therefore, interpreting the results within the broader context of the study’s methodology is essential for a high-quality analysis.

Cite this article

stats writer (2026). How to Perform McNemar’s Test in SPSS for Paired Nominal Data. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/can-mcnemars-test-be-performed-in-spss-for-analyzing-paired-nominal-data/

stats writer. "How to Perform McNemar’s Test in SPSS for Paired Nominal Data." PSYCHOLOGICAL SCALES, 14 Mar. 2026, https://scales.arabpsychology.com/stats/can-mcnemars-test-be-performed-in-spss-for-analyzing-paired-nominal-data/.

stats writer. "How to Perform McNemar’s Test in SPSS for Paired Nominal Data." PSYCHOLOGICAL SCALES, 2026. https://scales.arabpsychology.com/stats/can-mcnemars-test-be-performed-in-spss-for-analyzing-paired-nominal-data/.

stats writer (2026) 'How to Perform McNemar’s Test in SPSS for Paired Nominal Data', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/can-mcnemars-test-be-performed-in-spss-for-analyzing-paired-nominal-data/.

[1] stats writer, "How to Perform McNemar’s Test in SPSS for Paired Nominal Data," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, March, 2026.

stats writer. How to Perform McNemar’s Test in SPSS for Paired Nominal Data. PSYCHOLOGICAL SCALES. 2026;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top