# McNemar's test using SPSS Statistics

## Introduction

The McNemar test is used to determine if there are differences on a dichotomous dependent variable between two related groups. It can be considered to be similar to the paired-samples t-test, but for a dichotomous rather than a continuous dependent variable. However, unlike the paired-samples t-test, it can be conceptualized to be testing two different properties of a repeated measure dichotomous variable, as is explained below. The McNemar test is used to analyze pretest-posttest study designs, as well as being commonly employed in analyzing matched pairs and case-control studies. If you have more than two repeated measurements, you could use Cochran's *Q* test.

For example, you could use the McNemar test to determine whether the proportion of participants who had low self-esteem (as opposed to high self-esteem) before a series of counselling sessions (i.e., an intervention) decreased after the intervention (i.e., your dependent variable would be "level of self-esteem", which has two categories: "low" and "high"). Alternately, you could use the McNemar's test to determine whether the proportion of participants who felt safe (yes or no) differed when wearing a cycling helmet as opposed to wearing no cycling helmet (i.e., the dependent variable would be "sense of safety", which has two categories: "safe" and "not safe").

This "quick start" guide shows you how to carry out a McNemar's test using SPSS Statistics, as well as interpret and report the results from this test. However, before we introduce you to this procedure, you need to understand the different assumptions that your study design must meet in order for a McNemar's test to be an appropriate choice of test. We discuss these assumptions next.

###### SPSS Statistics

## Assumptions

The McNemar's test has three assumptions that must be met. If these assumptions are not met, you cannot use a McNemar's test, but may be able to use another statistical test instead. Therefore, in order to run a McNemar's test, you need to check that your study design meets the following three assumptions:

**Assumption #1:**You have**one categorical dependent variable with two categories**(i.e.,a**dichotomous**variable) and one**categorical independent variable with two related groups**. Examples of dichotomous variables include perceived safety (two groups: "safe" and "unsafe"), exam performance (two groups: "pass" and "fail"), preferred choice of cereal brand (two groups: "brand A" and "brand B"), feeling of seasickness (two groups: "yes" and "no"), level of exhaustion (two groups: "low" and "high"), use of safety equipment (two groups: "uses safety helmet" and "doesn't use safety helmet), skin cream effectiveness (two groups: "rash" and "no rash"), and so forth. You can learn more about dichotomous variables in our article: Types of Variable. Having an independent variable with two related groups indicates that you have a pretest-posttest, matched pairs or case-control study design.**Assumption #2:**The two groups of your dependent variable must be**mutually exclusive**. This means that no groups can overlap. In other words, a participant can only be in one of the two groups; they cannot be in both groups at the same time. For example, imagine you were using a McNemar's test to determine whether the proportion of participants who passed an exam (as opposed to failing the exam) before a two week revision period (i.e., an intervention) increased after the intervention (i.e., your dependent variable would be "exam performance", which has two categories: "pass" and "fail"). When a participant took the exam before the two week revision period, they could have only "passed" it or "failed" it. They could not pass and fail at the same time (e.g., they either got 60 out of 100 marks and above, which was a "pass", or 59 marks and below, which was a "fail"). Similarly, after the two week revision period, the participant could still only either pass or fail the exam.**Assumption #3:**The cases (e.g., participants) are a random sample from the population of interest. However, in practice, this is not always how sampling took place.

If your study design does not meet these three assumptions, you cannot use a McNemar's test, but you may be able to use another statistical test instead (learn more about our Statistical Test Selector if this is the case). However, assuming that you are using the correct test, we show you how to analyze your data using McNemar's test later in the Test Procedure in SPSS Statistics section. First, we introduce you to the example we use in this guide.