# How to Calculate Mcnemar Test for Paired Proportions Tutorial with Definition, Formula, Example

## How to Calculate Mcnemar Test for Paired Proportions - Tutorial

##### Definition

McNemar's test is an ordinary approximation test which evaluates the significance of the variation between two correlated proportions, where the two proportions are based on the same sample of subjects or on matched-pair samples.

#### Formula:

McNemar test statistic Χ2= (b - c)2 / (b + c) The statistic with Yates's correction for continuity Χ2= (|b - c| - 0.5)2 / (b + c) Difference Between Test DF= (a+b) / n - (a+c) / n Odds Ratio Odds Ratio=(a/c)/(b/d) Where a,b,c,d - are McNemar values. Χ2 - Chi Square.
##### Example:

A researcher tries to find out if a particular drug has an effect on a specific disease. Counts of individuals are given in the below table, with the diagnosis (disease: present or absent) before treatment given in the rows, and the diagnosis after treatment in the columns. The test needs same subjects to be added in the before-and-after measurements.

present
absent
Row total
present
a:50 b:60 110
##### Disease:
absent
c:40 d:30 70
Column total 90 90 180
##### Given,

a=50 b=60 c=40 d=30

##### To Find,

McNemar test statistic McNemar Chi Square test statistic(Χ2) Difference Between Test Odds Radio

##### Solution :
###### Step 1:

Substitute the given values in the formula of Χ2,

Χ2 = (b - c)2 / (b + c) Χ2 = (60 - 40)2 / (60 + 40) Χ2 = (20)2 / 100 Χ2 = 400 / 100 = 4

###### Step 2:

Statistic with Yates's correction for continuity calculation: Substitute the given values in the formula, Χ2= (|b - c| - 0.5)2 / (b + c) Χ2= (|60 - 40| - 0.5)2 / (60 + 40) Χ2= (20 - 0.5)2 / 100 Χ2= 380.25 / 100 Χ2= 3.8025

###### Step 3:

Difference Between Test calculation: Substitute the given values of a,b,c and n in the formula, DF= (a+b) / n - (a+c) / n n = a+b+c+d = 50+60+40+30 = 180 DF = 110 / 180 - 90 / 180 DF = 0.11

###### Step 4:

Odds Radio: Substitute the given values of b,c in the formula, Odds Radio= (a/c)/(b/d) Odds Radio= (50/40)/(60/30)=0.625 %

###### Step 5:

Confidence Interval: start range = e log(0.625) - (1.96 x √(1/50) + (1/60) + (1/40) + (1/30) ) start range = e log(0.625) - (1.96 x 0.3082207) start range = 0.4456 end range = e log(0.625) + (1.96 x √(1/50) + (1/60) + (1/40) + (1/30) ) end range = e log(0.625) + (1.96 x 0.3082207) end range = 1.4918 Confidence Interval value 0.4456 to 1.4918