Chi-squared test
Use the chi-squared test to determine whether there is a significant association between two categorical variables.
The chi-squared test is used to test whether the proportion of observations in one variable is independent of the proportion of observations in the other variable.
In this test, the null hypothesis is that there is no association between the two variables, while the alternative hypothesis is that there is a significant association between the two variables. To perform this test, we create a contingency table that summarizes the counts or frequencies of each combination of the two variables. The contingency table can be used to calculate the expected frequencies if the null hypothesis were true.
Chi-squared test formula |
---|
|
Variable | Description |
---|---|
chi^2 | The chi-squared test. |
OF | The observed frequency in cell (i, j) of the contingency table. |
EF | The expected frequency in cell (i, j) of the contingency table, calculated under the assumption of independence. |
sum | The sum is taken over all cells in the contingency table. |