Chi-square test and confidence interval