Pasek boczny

en:statpqpl:korelpl:nparpl:kontrpl

Contingency tables coefficients and their statistical significance

The contingency coefficients are calculated for the raw data or the data gathered in a contingency table.

The settings window with the measures of correlation can be opened in Statistics menu → NonParametric testsCh-square, Fisher, OR/RR option Measures of dependence… or in ''Wizard''.

The Yule's Q contingency coefficient

The Yule's $Q$ contingency coefficient (Yule, 19001)) is a measure of correlation, which can be calculated for $2\times2$ contingency tables.

\begin{displaymath}
Q=\frac{O_{11}O_{22}-O_{12}O_{21}}{O_{11}O_{22}+O_{12}O_{21}},
\end{displaymath}

where:

$O_{11}, O_{12}, O_{21}, O_{22}$ - observed frequencies in a contingency table.

The $Q$ coefficient value is included in a range of $<-1; 1>$. The closer to 0 the value of the $Q$ is, the weaker dependence joins the analysed features, and the closer to $-$1 or +1, the stronger dependence joins the analysed features. There is one disadvantage of this coefficient. It is not much resistant to small observed frequencies (if one of them is 0, the coefficient might wrongly indicate the total dependence of features).

The statistic significance of the Yule's $Q$ coefficient is defined by the $Z$ test.

Hypotheses:

$\begin{array}{cl}
\mathcal{H}_0: &Q=0,\\
\mathcal{H}_1: &Q\neq 0.
\end{array}$

The test statistic is defined by:

\begin{displaymath}
Z=\frac{Q}{\sqrt{\frac{1}{4}(1-Q^2)^2(\frac{1}{O_{11}}+\frac{1}{O_{12}}+\frac{1}{O_{21}}+\frac{1}{O_{22}})}}.
\end{displaymath}

The test statistic asymptotically (for a large sample size) has the normal distribution.

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}

The $\phi$ contingency coefficient

The Phi contingency coefficient is a measure of correlation, which can be calculated for $2\times2$ contingency tables.

\begin{displaymath}
\phi=\sqrt{\frac{\chi^2}{n}},
\end{displaymath}

where:

Chi-square – value of the $\chi^2$ test statistic,

$n$ – total frequency in a contingency table.

The $\phi$ coefficient value is included in a range of $<0; 1>$. The closer to 0 the value of $\phi$ is, the weaker dependence joins the analysed features, and the closer to 1, the stronger dependence joins the analysed features.

The $\phi$ contingency coefficient is considered as statistically significant, if the p-value calculated on the basis of the $\chi^2$ test (designated for this table) is equal to or less than the significance level $\alpha$.

The Cramer's V contingency coefficient

The Cramer's V contingency coefficient (Cramer, 19462)), is an extension of the $\phi$ coefficient on $r\times c$ contingency tables.

\begin{displaymath}
V=\sqrt{\frac{\chi^2}{n(w'-1)}},
\end{displaymath}

where:

Chi-square – value of the $\chi^2$ test statistic,

$n$ – total frequency in a contingency table,

$w'$ – the smaller the value out of $r$ and $c$.

The $V$ coefficient value is included in a range of $<0; 1>$. The closer to 0 the value of $V$ is, the weaker dependence joins the analysed features, and the closer to 1, the stronger dependence joins the analysed features. The $V$ coefficient value depends also on the table size, so you should not use this coefficient to compare different sizes of contingency tables.

The $V$ contingency coefficient is considered as statistically significant, if the p-value calculated on the basis of the $\chi^2$ test (designated for this table) is equal to or less than the significance level $\alpha$.

W-Cohen contingency coefficient

The $W$-Cohen contingency coefficient (Cohen (1988)3)), is a modification of the V-Cramer coefficient and is computable for $r\times c$ tables.

\begin{displaymath}
W=\sqrt{\frac{\chi^2}{n(w'-1)}}\sqrt{w'-1},
\end{displaymath}

where:

Chi-square – value of the $\chi^2$ test statistic,

$n$ – total frequency in a contingency table,

$w'$ – the smaller the value out of $r$ and $c$.

The $W$ coefficient value is included in a range of $<0; \max W>$, where $\max W=\sqrt{w'-1}$ (for tables where at least one variable contains only two categories, the value of the coefficient $W$ is in the range $<0; 1>$). The closer to 0 the value of $W$ is, the weaker dependence joins the analysed features, and the closer to $\max W$, the stronger dependence joins the analysed features. The $W$ coefficient value depends also on the table size, so you should not use this coefficient to compare different sizes of contingency tables.

The $W$ contingency coefficient is considered as statistically significant, if the p-value calculated on the basis of the $\chi^2$ test (designated for this table) is equal to or less than the significance level $\alpha$.

The Pearson's C contingency coefficient

The Pearson's $C$ contingency coefficient is a measure of correlation, which can be calculated for $r\times c$ contingency tables.

\begin{displaymath}
C=\sqrt{\frac{\chi^2}{\chi^2+n}},
\end{displaymath}

where:

Chi-square – value of the $\chi^2$ test statistic,

$n$ – total frequency in a contingency table.

The $C$ coefficient value is included in a range of $<0; 1)$. The closer to 0 the value of $C$ is, the weaker dependence joins the analysed features, and the farther from 0, the stronger dependence joins the analysed features. The $C$ coefficient value depends also on the table size (the bigger table, the closer to 1 $C$ value can be), that is why it should be calculated the top limit, which the $C$ coefficient may gain – for the particular table size:

\begin{displaymath}
C_{max}=\sqrt{\frac{w'-1}{w}},
\end{displaymath}

where:

$w'$ – the smaller value out of $r$ and $c$.

An uncomfortable consequence of dependence of $C$ value on a table size is the lack of possibility of comparison the $C$ coefficient value calculated for the various sizes of contingency tables. A little bit better measure is a contingency coefficient adjusted for the table size ($C_{adj}$):

\begin{displaymath}
C_{adj}=\frac{C}{C_{max}}.
\end{displaymath}

The $C$ contingency coefficient is considered as statistically significant, if the p-value calculated on the basis of the $\chi^2$ test (designated for this table) is equal to or less than significance level $\alpha$.

EXAMPLE (sex-exam.pqs file)

There is a sample of 170 persons ($n=170$), who have 2 features analysed ($X$=sex, $Y$=passing the exam). Each of these features occurs in 2 categories ($X_1$=f, $X_2$=m, $Y_1$=yes, $Y_2$=no). Basing on the sample, we would like to get to know, if there is any dependence between sex and passing the exam in an analysed population. The data distribution is presented in a contingency table:}

\begin{tabular}{|c|c||c|c|c|}
\hline
\multicolumn{2}{|c||}{Observed frequencies}& \multicolumn{3}{|c|}{passing the exam}\\\cline{3-5}
\multicolumn{2}{|c||}{$O_{ij}$} & yes & no & total \\\hline \hline
\multirow{3}{*}{sex}& f & 50 & 40 & 90 \\\cline{2-5}
& m & 20 & 60 & 80 \\\cline{2-5}
& total & 70 & 100 & 170\\\hline
\end{tabular}

The test statistic value is $\chi^2=16.33$ and the $p$ value calculated for it: p<0.0001. The result indicates that there is a statistically significant dependence between sex and passing the exam in the analysed population.

Coefficient values, which are based on the $\chi^2$ test, so the strength of the correlation between analysed features are:

$C_{adj}$-Pearson = 0.42.

$V$-Cramer = $\phi$ = $W$-Cohen = 0.31

The $Q$-Yule = 0.58, and the $p$ value of the $Z$ test (similarly to $\chi^2$ test) indicates the statistically significant dependence between the analysed features.

1)
Yule G. (1900), On the association of the attributes in statistics: With illustrations from the material ofthe childhood society, and c. Philosophical Transactions of the Royal Society, Series A, 194,257-3 19
2)
Cramkr H. (1946), Mathematical models of statistics. Princeton, NJ: Princeton University Press
3)
Cohen J. (1988), Statistical Power Analysis for the Behavioral Sciences, Lawrence Erlbaum Associates, Hillsdale, New Jersey
en/statpqpl/korelpl/nparpl/kontrpl.txt · ostatnio zmienione: 2022/02/13 20:48 przez admin

Narzędzia strony