SPSS Tutorials


SPSS McNemar Test

McNemar Test - What Is It?

SPSS McNemar test is a procedure for testing if the proportions of two dichotomous variables are equal in some population. The two variables have been measured on the same cases.

SPSS McNemar Test Example

A marketeer wants to know whether two products are equally appealing. He asks 20 participants to try out both products and indicate whether they'd consider buying each products (“yes” or “no”). This results in product_appeal.sav. The proportion of respondents answering “yes, I'd consider buying this” indicates the level of appeal for each of the two products.
The null hypothesis is that both percentages are equal in the population.

1. Quick Data Check

Before jumping into statistical procedures, let's first just take a look at the data. A graph that basically tells the whole story for two dichotomous variables measured on the same respondents is a 3-d bar chart. The screenshots below walk you through.

SPSS McNemar Test Bar Chart Dialog

We'll first navigate to Graph SPSS Menu Arrow Legacy Dialogs SPSS Menu Arrow 3-D Bar Click Define.

SPSS McNemar Test Bar Chart Dialog

Select Number of cases and move product_a and product_b into the appropriate boxes. Clicking Paste results in the syntax below.

*1. Set default directory.

cd 'd:downloaded'. /*or wherever data file is located.

*2. Open data.

get file 'product_appeal.sav'.

*3.Quick data check.

XGRAPH CHART=([COUNT] [BAR]) BY product_a [c] BY product_b [c].
SPSS McNemar Test Bar Chart

The most important thing we learn from this chart is that both variables are indeed dichtomous. There could have been some “Don't know/no opinion” answer category but both variables only have “Yes” and “No” answers. There are no system missing values since the bars represent (6 + 7 + 7 + 0 =) 20 valid answers which equals the number of respondents.
Second, product_b is considered by (6 + 7 =) 13 respondents and thus seems more appealing than product_a (considered by 7 respondents). Third, all of the respondents who consider product_a consider product_b as well but not reversely. This causes the variables to be positively correlated and asks for a close look at the nature of both products.

2. Assumptions McNemar Test

The results from the McNemar test rely on just one assumption:

3. Run SPSS McNemar Test

SPSS McNemar Test Dialog

We'll navigate to Analyze SPSS Menu Arrow Nonparametric Tests SPSS Menu Arrow Legacy Dialogs SPSS Menu Arrow 2 Related Samples....

SPSS McNemar Test Dialog

We select both product variables and move them into the Test Pairs box.
Under Options, we'll select Descriptives.
We only select McNemar under Test Type
Clicking Paste results in the syntax below.

*Run McNemar Test.

/MCNEMAR=product_a WITH product_b (PAIRED)

4. SPSS McNemar Test Output

SPSS McNemar Test Output

The first table (Descriptive Statistics) confirms that there are no missing values. We already saw this in our chart as well.If there are missing values, these descriptives may be misleading. This is because they use pairwise deletion of missing values while the significance test (necessarily) uses listwise deletion of missing values. Therefore, the descriptives may use different data than the actual test. This deficiency can be circumvented by (manually) FILTERING out all incomplete cases before running the McNemar test.
Note that SPSS reports means rather than proportions. However, if your answer categories are coded 0 (for “absent”) and 1 (for “present”) the means coincide with the proportions.We suggest you RECODE your values if this is not the case. The proportions are (exactly) .35 and .65. The difference is thus -.3 where we expected 0 (equal proportions).

SPSS McNemar Test Output

The second table (Test Statistics) shows that the p-value is .031. If the two proportions are equal in the population, there's only a 3.1% chance of finding the difference we observed in our sample. Usually, if p < .05, we reject the null hypothesis. We therefore conclude that the appeal of both products is not equal.
Note that the p-value is two-sided. It consists of a .0155 chance of finding a difference smaller than (or equal to) -.3 and another .0155 chance of finding a difference larger than (or equal to) .3.

5. Reporting the McNemar Test Result

In any case, we report the two proportions and the sample size on which they were based, probably in the style of the descriptives table we saw earlier. For reporting the significance test we can write something like “A McNemar test showed that the two proportions were different, p = .031 (2 sided).”

Previous tutorial: SPSS Wilcoxon Signed-Ranks Test – Simple Example

Next tutorial: SPSS Sign Test for Two Medians – Simple Example

Let me know what you think!

*Required field. Your comment will show up after approval from a moderator.

This tutorial has 2 comments