In: Statistics and Probability
The Chi-Square test of independence is used to determine if there is a significant relationship between two nominal (categorical) variables. The frequency of each category for one nominal variable is compared across the categories of the second nominal variable. The data can be displayed in a contingency table where each row represents a category for one variable and each column represents a category for the other variable.
To find the expected frequency of cell do the following:
(Row total of cell * Column total of cell) / Grand total
Example:
This formula works because the expected value we got is the representative of observed value and is also close to observed value so that we can apply chi square test to find the independence.