Block 2: Joint, marginal and conditional probability
Week 9 · Probability I · Imai §6.2.1 · about 4 min
NoteHow this works
Run each cell with Run Code, look at the output, then answer the question at the end of the block. Every cell is editable; Start Over resets it. Errors are information: read them.
Florida voter file: surname, county, VTD (precinct), age, gender, race. One row = one registered voter.
1. Load, clean and marginal probabilities
How many voters before and after na.omit()?
2. Conditional and joint probability
Conclusion: Does the race distribution among women differ from the marginal race distribution?
P(black | female) = 13.9% vs. P(black) = 13.1%: a small difference. The row and column sums of the joint table give back the marginals.