Pearson's Chi-Square Test for Independence is a statistical method used to determine whether there is a significant association between two categorical variables. Named after Karl Pearson, this test is widely employed in various fields including medicine, social sciences, and market research to analyze relationships between categorical data.
The chi-square test for independence is appropriate when you have:
For example, you might use this test to determine if there's a relationship between:
The chi-square test for independence evaluates two competing hypotheses:
Null Hypothesis (H): The two variables are independent (not related). There is no association between them.
Alternative Hypothesis (H): The two variables are not independent (they are related). There is an association between them.
The test aims to determine whether the observed data provides sufficient evidence to reject the null hypothesis of independence.
The chi-square test compares the observed frequencies in each cell of the contingency table with the frequencies we would expect to find if there were no relationship between the variables (expected frequencies).
For each cell in the contingency table, the expected frequency is calculated as:
Where E represents the expected frequency for cell in row i and column j.
The chi-square statistic () is calculated as:
Where:
This statistic measures how much the observed data deviates from what we would expect under the null hypothesis of independence.
The degrees of freedom for the chi-square test for independence is calculated as:
Where:
The degrees of freedom determine the specific chi-square distribution to which our calculated statistic will be compared.
Let's consider an example where we want to test if there's an association between gender (male/female) and preference for public transportation (yes/no). We survey 200 people and obtain the following results:
| Prefers PT | Doesn't Prefer PT | Total | |
|---|---|---|---|
| Male | 45 | 55 | 100 |
| Female | 65 | 35 | 100 |
| Total | 110 | 90 | 200 |
For Male-Prefers PT: E = (100 110) / 200 = 55
For Male-Doesn't Prefer PT: E = (100 90) / 200 = 45
For Female-Prefers PT: E = (100 110) / 200 = 55
For Female-Doesn't Prefer PT: E = (100 90) / 200 = 45
= (45-55)/55 + (55-45)/45 + (65-55)/55 + (35-45)/45
= 100/55 + 100/45 + 100/55 + 100/45
= 1.818 + 2.222 + 1.818 + 2.222 = 8.08
df = (2 - 1) (2 - 1) = 1
With = 8.08 and df = 1, we can consult a chi-square distribution table or use statistical software to find the p-value. For = 8.08 with df = 1, the p-value is approximately 0.0045.
Since the p-value (0.0045) is less than the conventional significance level of 0.05, we reject the null hypothesis. There is evidence to suggest that gender and preference for public transportation are not independent; there appears to be an association between these variables.
When interpreting chi-square test results, consider:
The chi-square test for independence has several assumptions and limitations:
Pearson's Chi-Square Test for Independence is a fundamental statistical tool for examining relationships between categorical variables. By comparing observed and expected frequencies, researchers can determine whether significant associations exist between different categorical variables. While the test has its limitations, its simplicity and versatility make it a valuable analytical method across numerous disciplines.
For complex analyses or when dealing with violations of assumptions, researchers might consider alternative methods such as Fisher's exact test for small sample sizes or regression techniques for more nuanced analyses of categorical data.
