# Analyzing dichotomous outcomes

Which test would I use to analyze the relationship between two dichotomous outcomes (Yes/No) where I have a reported event (Yes/No) and a Response to the event (Yes/No)?

Since you have two dichotomous outcomes your data can be represented in a $2 \times 2$ contingency table where the rows represent the status of "event" and the columns the status of "response," and the value within the cell being the total count within your sample falling into this category. The most straightforward way to analyze such data would be using either a $\chi^2$ test or a $z$ test (the two being almost equivalent).

The $\chi^2$ test is looking at whether or not the two factors are independent of one another (in your case, does the event have an effect on response?), which means the probability of belonging to cell $(i, j)$, which we'll call $p_{ij}$, is equal to $p_{i \cdot} p_{\cdot j}$, or the marginal probability of belonging to row $i$ multiplied by the marginal probability of belonging to column $j$. These marginal probabilities are not known so they're instead estimated from the data using the sample proportions $\hat{p}_{i \cdot}$ and $\hat{p}_{\cdot j}$. If $n$ is the total sample size we then estimate the expected count within cell $(i, j)$ when the null hypothesis of independence is true as $n \hat{p}_{i \cdot} \cdot \hat{p}_{\cdot j}$. This expected count gets compared to the actual observed count $c_{ij}$ using the following statistic

$$\chi^2 = \sum_{i=1}^{2} \sum_{j=1}^{2} \frac{(c_{ij} - n \hat{p}_{i \cdot} \cdot \hat{p}_{\cdot j})^2}{n \hat{p}_{i \cdot} \cdot \hat{p}_{\cdot j}} .$$

When the null hypothesis is true this follows a $\chi^2$ distribution with one degree of freedom, and so you can use this distribution to calculate $p$-values.

This test is equivalent to the two-sided $z$-test which looks directly at the proportions within one of the margins and tries to determine if they differ across the other (note that a standard normal random variable squared follows a $\chi^2_1$ distribution).

• I thought a simple chi-square would work but wasn't sure if it was appropriate in this case. – Jeff Feb 24 '16 at 15:51

You're probably looking for a chi-squared test. Check out this link.