Introduction The chi-squared test of independence is one of the most basic and common hypothesis tests in the statistical analysis of categorical data. Given 2 categorical random variables, and , the chi-squared test of independence determines whether or not there exists a statistical dependence between them. Formally, it is a hypothesis test with the following null and