Why the X2 Statistic Matters
The X2 statistic, also called chi-square, measures disagreement between observed counts and expected counts. It is useful when data are grouped into categories. A large value means the pattern is far from expectation. A small value means the pattern fits well.
Goodness of Fit Use
A goodness of fit test checks one categorical variable. You compare observed category counts with a claimed distribution. The expected counts may come from fixed counts, equal shares, or probabilities. This calculator also lets you subtract estimated parameters. That makes the degrees of freedom more realistic.
Independence and Homogeneity Use
A table test checks two categorical variables. It can test independence in one sample. It can also compare distributions across groups. Expected counts come from row totals, column totals, and the grand total. The calculator builds those expected counts automatically.
Reading the Output
The statistic is the sum of each cell contribution. Each contribution equals squared error divided by expected count. Standardized residuals show where the largest gaps occur. A positive residual means the observed count is higher than expected. A negative residual means it is lower.
P-Value and Alpha
The p-value is calculated from the chi-square distribution. It uses the statistic and degrees of freedom. If the p-value is less than alpha, reject the null hypothesis. If it is larger, the sample does not give enough evidence. This does not prove the null is true.
Practical Checks
Expected counts should not be too small. Many courses use five as a common guide. Very small expected counts can make the approximation weak. Combine categories when the design permits it. Use exact methods for tiny samples when required.
Effect Size
Significance does not show practical size. For goodness of fit, Cohen's w gives the size. For tables, Cramer's V summarizes association strength. Use it with context. A small effect can still matter in large studies. A large effect can appear uncertain in small studies.
Careful Reporting
Report the test type, degrees of freedom, statistic, p-value, and alpha. Include the decision in plain language. Mention any small expected counts. Also explain the data source and category definitions. Clear reporting makes the result easier to check. Always keep raw counts available for review.