Contingency Analysis Flashcards
(12 cards)
What is relative risk
compares the probability of an outcome in two groups. Common in cohort studies (prospective)
How do you calculate relative risk
RR = P(event|unexposed) / P(event|exposed)
Or in terms of a 2×2 table:
Event (Yes) Event (No) Total Exposed a b a + b Unexposed c d c + d
RR = a/(a+b) / c/(c+d)
What do the different values of RR mean
RR = 1 → no difference in risk
RR > 1 → increased risk in exposed group
RR < 1 → decreased risk in exposed group
What is an odds ratio
compares the odds of an event occurring in one group to another
common in case - control studies
Whats the formula for an OR from a 2x2 table
OR = a x d / b x c
What do the different values of OR mean
OR = 1 → no association
OR > 1 → higher odds in exposed group
OR < 1 → lower odds in exposed group
How do you calculate a confidence interval for OR
- Calculate the log OR:
log(OR) - Calculate the standard error of log(OR):
𝑆𝐸 log (𝑂𝑅) = √(1/a) + (1/b) + (1/c) + (1/d) - Construct the CI on the log scale:
log(OR) ± z∗ x SE log(OR)
- Exponentiate the endpoints to get the CI for OR:
(𝑒 lower, 𝑒 upper)
When do you use the Chi-Squared contingency test
To test whether two categorical variables are independent (no association)
How do you calculate a Chi-Squared contingency test
- Set up a 2×2 or r×c table of observed counts
- Calculate expected counts:
𝐸𝑖𝑗 = rowtotal x columntotal / grandtotal - Use test statistic:
𝜒² = ∑ ( 𝑂𝑖𝑗 - 𝐸𝑖𝑗)² / 𝐸𝑖𝑗
- Degrees of freedom:
df=(r−1)(c−1) - Compare to critical value or get p-value from χ² table.
When should you use the Chi-Squared contingency test
only if all expected counts ≥ 5
When do you use Fisher’s exact test
used instead of chi-squared when sample sizes are small (especially expected count < 5 in any cell
How do you carrying out Fisher’s exact test
- Use a 2×2 contingency table
- Calculate the exact probability of observing the data (or more extreme data) under the null hypothesis of no association
3.Done using software or online calculator (exact formula involves factorials)