Test statistic for chi square