Pasek boczny


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:

\mathcal{H}_0: & O_{ij}=E_{ij} $ for all categories,$\\
\mathcal{H}_1: & O_{ij} \neq E_{ij} $ for at least one category,$


$O_{ij}$observed frequencies in a contingency table,

$E_{ij}$expected frequencies in a contingency table.

Hypotheses in the meaning of independence:

\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.$

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

$ 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. \\


  • In addition to the chi-square test, another related test may need to be determined. In the event that Cochran's condition is not satisfied, one can determine:
  • If we obtain a table of Rx2, and the R categories can be ordered, it is possible to determine the trend:
  • When significant relationships or differences are found based on a test performed on a table larger than 2×2, then multiple comparisons can be performed with appropriate correction of the multiple comparisons to locate the location of these relationships/differences. This correction can be done automatically when the table has many columns. In such case, in test option window you should select Multiple column comparisons (RxC).
  • In the case where we want to describe the strength of the relationship between feature X and feature Y, we can determine:
  • In the case when we want to describe for 2×2 tables the effect size showing the impact of a risk factor, we can determine:
Cochran W.G. (1952), The chi-square goodness-of-fit test. Annals of Mathematical Statistics, 23, 315-345
en/statpqpl/porown2grpl/nparpl/chikw.txt · ostatnio zmienione: 2022/02/11 21:20 przez admin

Narzędzia strony