What the calculator computes
Degrees of freedom
\[
df = (R-1)(C-1)
\]
Expected counts
\[
E_{ij}=\frac{(\text{row total}_i)\cdot(\text{column total}_j)}{n}
\]
Chi-square test statistic
\[
\chi^2=\sum_{i=1}^{R}\sum_{j=1}^{C}\frac{(O_{ij}-E_{ij})^2}{E_{ij}}
\]
Right-tail p-value
\[
p=P\!\left(\chi^2_{df}\ge \chi^2_{\text{obs}}\right)
\]
Hypotheses and decision rule
\[
\begin{aligned}
H_0&:\ \text{The two categorical variables are independent.}\\
H_1&:\ \text{The two categorical variables are dependent.}
\end{aligned}
\]
The chi-square test of independence is right-tailed. At significance level α:
reject \(H_0\) if the p-value is \(\le \alpha\), equivalently if
\(\chi^2_{\text{obs}} \ge \chi^2_{1-\alpha,df}\).
\[
\text{Reject }H_0\ \text{if}\ \chi^2_{\text{obs}}\ge \chi^2_{1-\alpha,df}
\]
Validity guideline
A common guideline for using the chi-square approximation is that all expected counts should be at least
5. If some expected counts are smaller, consider combining categories or increasing the sample size.