In the chi-squared test, the degrees of freedom is the number of rows in the contingency table subtract 1 multiplied by the number of columns in the contingency table subtract 1. We reject the null hypothesis if our observed chi-squared value exceeds the critical chi-squared value.