Skip to content

Chi-Square and Binary Outcome Tests

Test categorical goodness of fit or an independent 2×2 outcome table, with actual p-values, Fisher support and labeled proportion-difference intervals.

Use this result well

Inputs that matter
Observed category counts, Expected category counts, Fitted-parameter df adjustment, Two-sided significance level (%), and 5 more
Output to expect
Goodness-of-fit p-value, Selected test p-value
  • Check the units and required inputs before comparing results.
  • Keep the assumptions with a copied result so you can reproduce the calculation later.
Was this tool helpful?

Reference & details

How it works

Categorical goodness-of-fit test

χ² = Σ(O−E)²/E; df = categories−1−fitted parameters; p = upper chi-square tail Pearson multinomial goodness of fit. This is not a contingency-table independence test; use the separate binary-table mode for that design. Observed and expected totals must match within relative numerical tolerance 1e-8; neither list is silently rescaled. Small observed or expected counts are flagged. Fitted parameters do not always lead to the simple chi-square degrees-of-freedom adjustment.

Two independent binary outcome groups

Pearson expected counts = row total × column total / grand total, df=1; Fisher sums conditional tables no more probable than observed. Difference = rate B − rate A A fixed-design binary group comparison. Pearson uses no Yates correction and is flagged when observed/expected counts are below 5. Fisher conditions on the margins and enumerates at most 20,000 tables with at most 10,000,000 observations. The difference interval is Newcombe’s combination of Wilson intervals without continuity correction; it is not an inversion of the Fisher test. No clustering, pairing, covariate adjustment, repeated peeking, missing-data correction or multiple-testing control is applied.

Updated: September 2026

Example Scenarios

Compare independent categorical counts with explicit expected counts of the same total. Set the justified fitted-parameter degrees-of-freedom adjustment.

Compare a 2×2 table with Pearson chi-square or a two-sided Fisher exact test. Report both observed rates and a Newcombe interval for their absolute difference.

Common Mistakes to Avoid

Applying categorical goodness-of-fit test outside its stated assumptions

This is not a contingency-table independence test; use the separate binary-table mode for that design. Observed and expected totals must match within relative numerical tolerance 1e-8; neither list is silently rescaled. Small observed or expected counts are flagged. Fitted parameters do not always lead to the simple chi-square degrees-of-freedom adjustment.

Applying two independent binary outcome groups outside its stated assumptions

Pearson uses no Yates correction and is flagged when observed/expected counts are below 5. Fisher conditions on the margins and enumerates at most 20,000 tables with at most 10,000,000 observations. The difference interval is Newcombe’s combination of Wilson intervals without continuity correction; it is not an inversion of the Fisher test. No clustering, pairing, covariate adjustment, repeated peeking, missing-data correction or multiple-testing control is applied.

FAQ

No. A structural-zero category or impossible observed event needs a model-specific treatment.

No. It indicates that this statistic did not cross the selected threshold under the assumed test.

Only if that matches the study design. Repeated observations from one randomized user generally need a different analysis.

No. Consider effect size, uncertainty, guardrails, data quality and practical costs.

About Chi-Square and Binary Outcome Tests

Test categorical goodness of fit or an independent 2×2 outcome table, with actual p-values, Fisher support and labeled proportion-difference intervals. Choose the mode that matches your measurements or study design, enter the stated units and keep the method and limits with the result.