Chi-Squared Test of Independence
Tests if two Random Variables are independent.
- Partition both random variables into sets (already done for discrete random variables)
- Calculate Joint Class Probabilities
- Calculate Margin Class Probability
If are independent, then the Joint Class Probability is the same as the product of the Margin Class Probabilities. Thus the Null Hypothesis is:
Given the Test Statistic should be small.
We can simulate the test statistic by drawing with replacement from box with types of balls with Relative Frequencies . For large the distribution is actually independent on the probabilities.
The distribution converges to the Chi-Squared Distribution with Degrees of Freedom.
Hence the Acceptance Domain is asymptoically given by Without knowing the probabilities the Class Condition can be checked approximately with
Another test of independence is the so-called Exact Test of Fisher
Application
One can best perform this test using a Contingency Table.