---
title: "Macnemar"
author: "Unidade de Bioestatistica"
date: "15/02/2021"
output: 
  html_document: 
    df_print: kable
---


**Objective of the study:** compare two paired samples for the outcome of a dichotomous variable. It is widely used to analyze data from planning of the 'before' and 'after' type, where the same subject is evaluated regarding binary information before and after a certain interference. In this type of analysis, the data can be summarized in a contingency table of the 2X2 type, as shown below:


<!-- |**Antes/Depois**     |*Sim*   | *Não*| -->
<!-- |------ | ------ | ------- -->
<!-- |***Antes***  | $p_a$      | $p_c$| -->
<!-- |***Depois*** | $p_b$      | $p_d$| -->


&nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; **After**

**Before** &nbsp; &nbsp; &nbsp; &nbsp; ***Yes*** &nbsp; &nbsp; ***No***

***Yes*** &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp;  $p_a$ &nbsp; &nbsp; &nbsp; $p_b$
 
***No*** &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp;  $p_c$ &nbsp; &nbsp; &nbsp; $p_d$



where the cells $p_b$ and $p_c$ represent the percentage of total discordant pairs (those who obtained different answers). More details on using this tab in **[PSS Health: how to calculate the sample size to test variables relationships with a binary outcome](https://doi.org/10.22491/2357-9730.126843)**.




