Select the Test
Choose goodness of fit to compare a sample with an expected distribution, or independence to analyze two variables.
Calculate chi-square statistics, degrees of freedom, expected frequencies, p-values, and hypothesis-test conclusions for goodness-of-fit and independence tests.
Compare observed category counts with expected counts from a proposed distribution.
| Category | Observed | Expected | Difference | Contribution |
|---|
Determine whether two categorical variables have a statistically significant association.
| Cell | Observed | Expected | Difference | Contribution |
|---|
Run a complete categorical-data hypothesis test in three straightforward steps.
Choose goodness of fit to compare a sample with an expected distribution, or independence to analyze two variables.
Add observed and expected category counts, or build a contingency table containing your observed frequencies.
Review the chi-square statistic, degrees of freedom, p-value, expected frequencies, and test conclusion.
A chi-square test is a nonparametric statistical method used to analyze frequency or count data. It evaluates whether differences between observed and expected frequencies are large enough to be considered statistically significant.
The test works with categories rather than continuous measurements. Common applications include surveys, marketing research, genetics, education, product testing, medical studies, and social science research.
A goodness-of-fit test determines whether observed frequencies follow a specified theoretical distribution. For example, it can test whether a six-sided die produces each result equally often.
A test of independence evaluates whether two categorical variables are associated. For example, it can test whether product preference is related to a customer's age group.
Check these conditions before relying on the result of a chi-square analysis.
Enter actual counts of cases or observations. Do not enter percentages, averages, proportions, or measured values.
Each observation should belong to only one category or contingency-table cell and should not be counted repeatedly.
Expected frequencies should generally be at least 5. Sparse tables may require categories to be combined or a different statistical test.
Helpful answers about chi-square statistics, p-values, expected counts, and interpretation.
A high chi-square statistic indicates a relatively large difference between observed and expected frequencies. Whether that difference is statistically significant depends on the degrees of freedom and resulting p-value.
At a 5% significance level, a p-value below 0.05 indicates statistically significant evidence against the null hypothesis. The null hypothesis is therefore rejected.
In a contingency table, each expected frequency equals the row total multiplied by the column total, divided by the overall sample size. In a goodness-of-fit test, expected counts come from the proposed distribution.
The chi-square test should use frequency counts. Convert percentages into actual counts using the sample size before entering your data.
Very small expected frequencies can make the chi-square approximation unreliable. Consider combining appropriate categories, collecting more data, or using an exact test such as Fisher's exact test for a small 2 × 2 table.
For a goodness-of-fit test, degrees of freedom usually equal the number of categories minus 1 minus the number of estimated parameters. For an independence test, they equal rows minus 1 multiplied by columns minus 1.
No. A significant test of independence suggests an association between variables, but it does not establish that one variable causes the other.