The Chi-square tests

These tests are based on data collected in the form of a contingency table of 2 traits, trait X and trait Y, the former having $r$ and the latter $c$ categories, so the resulting table has $r$ rows and $c$ columns. Therefore, we can speak of the 2×2 chi-square test (for tables with two rows and two columns) or the RxC chi-square test (with multiple rows and columns)).

We can read the details of the chi-square test of the two features here:

chi-square test 2x2

chi-square test RxC.

Basic assumptions:

The additional assumption for the $\chi^2$ :

General hypotheses:

$\begin{array}{cl}
\mathcal{H}_0: & O_{ij}=E_{ij} $ for all categories,$\\
\mathcal{H}_1: & O_{ij} \neq E_{ij} $ 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 in the meaning of independence:

$\begin{array}{cl}
\mathcal{H}_0: & $there is no dependence between the analysed features of the population (both$\\
& $classifications are statistically independent according to $X$ and $Y$ feature),$\\
\mathcal{H}_1: & $there is a dependence between the analysed features of the population.$
\end{array}$

The p-value, designated on the basis of the test statistic, is compared with the significance level $\alpha$:

\begin{array}{ccl}
$ if $ p \le \alpha & \Longrightarrow & $ reject $ \mathcal{H}_0 $ and accept $ 	\mathcal{H}_1, \\
$ if $ p > \alpha & \Longrightarrow & $ there is no reason to reject $ \mathcal{H}_0. \\
\end{array}

Additionally

1)
Cochran W.G. (1952), The chi-square goodness-of-fit test. Annals of Mathematical Statistics, 23, 315-345