The Chi-square tests
When to use these tests:
The Chi-square tests check whether there is a dependence between two features gathered in a contingency table (e.g. whether sex is related to exam passing). Depending on the size of the table, we speak of the \(2\times 2\) chi-square test (two categories per feature) or the \(R\times C\) chi-square test (more categories):
Assumptions
- measurement on a nominal scale – any ordering of categories is not taken into account,
- an independent model,
- large expected frequencies according to the Cochran interpretation (1952)[42].
Note! The \(p\) value of the test is always compared with the assumed significance level \(\alpha\): when \(p \le \alpha\), we conclude that the analysed features are related; when \(p > \alpha\), there is no reason to claim that such a dependence exists.
Additionally
- When Cochran's condition is not satisfied, instead of the chi-square test one can use:
Fisher's exact test for \(R\times C\) tables, Fisher's exact test for \(2\times 2\) tables, the chi-square test with Yates correction, the mid-p test for \(2\times 2\) tables. - When we obtain an \(R\times 2\) table and the \(R\) categories can be ordered, it is possible to check for a trend:
the chi-square test for trend. - When, for a table larger than \(2\times 2\), a significant dependence or difference is detected and we want to locate it, multiple comparisons with an appropriate correction can be performed – in the test option window, select Multiple column comparisons (RxC).
- To describe the strength of the relationship between the analysed features, one can determine: measures of dependence.
- To describe, for \(2\times 2\) tables, the size of a risk factor's impact, one can determine: Odds Ratio (OR) and Relative Risk (RR).
FOR THOSE INTERESTED
Hypotheses (general form):
\[
\begin{array}{cl}
\mathcal{H}_0: & O_{ij}=E_{ij} \text{ for all categories,}\\
\mathcal{H}_1: & O_{ij} \neq E_{ij} \text{ for at least one category,}
\end{array}
\]
where \(O_{ij}\) – observed frequencies in a contingency table, \(E_{ij}\) – expected frequencies in a contingency table.
Hypotheses (independence test form):
\[
\begin{array}{cl}
\mathcal{H}_0: & \text{there is no dependence between the analysed features of the population (both}\\
& \text{classifications, according to feature }X\text{ and feature }Y\text{, are statistically independent),}\\
\mathcal{H}_1: & \text{there is a dependence between the analysed features of the population.}
\end{array}
\]
PQStat