Implemented the computation of chi-square and p-value.