9. Contingency Analysis Flashcards
contingency analysis
tests the independence of 2 categorical variables
With independence, relationship between Pr[X AND Y ] and Pr[X] and Pr[Y]
Pr[X AND ] = Pr[X] * Pr[Y]
Process of Contingency analysis
- Determine EXPECTED probability of each combined category
(ex. Pr[X AND Y] Pr[X AND y] etc) by calculating Pr[X], Pr[Y]. Pr[x], Pr[y], and multiplying those probabilities to give probability of both. - multiply proportions by total number of individuals to give expected count
- Calculate the chi squared value, (Observed - exp)^2/exp for each category
- Calculate degrees of freedom df = (# columns - 1) * (# rows - 1)
- determine critical value, and compare chi squared to that value
How to calculate degrees of freedom for contingency analysis test
df = (# columns - 1) * (# rows - 1)
Assumptions of contingency test
same assumptions of chi squared
No expectations less than 1, and no more than 20% less than 5
Fisher’s exact test
used in a 2 X 2 contingency analysis, makes no assumptions about size of expectations
hard to do by hand, but can do through R
Odds
The probability of success divided by the probability of failure
when p = probability of success
O = p / (1 - p)
Odds ratio
the odds of success in one group divided by odds in another
OR = (odds in treatment group) / (odds in control group)