Chi-square goodness-of-fit test