Topics in calculate the chi square statistic