When to use it
You have one categorical variable and want to know whether its category frequencies match an expected (e.g. uniform) distribution.
When not to: Expected counts fall well below 5 in multiple categories (combine sparse categories that belong together; an exact multinomial test is the textbook remedy, but KernelStats does not have one), or exactly two categories are involved and the sample is small (use the Proportion Test with one proportion, whose card gives the exact binomial p-value).
Step by step
Open it from the menu
Click Analyze in the menu bar; under Categorical choose Chi-Square Goodness-of-Fit Test.
Fill in the form
Choose the columns: Category column. The form lists only columns whose type fits each field. Then fill in Expected shares (optional).
Check the options
The options start at their defaults: How strict to be, Compare with. Change one only when your question needs it.
Run the analysis
Press Run analysis. The Result Card opens on its Results tab.
What to choose in the form
| Category column Category required | One categorical or ordered categorical column. A category column. The test compares how often each category appears with what you expected. |
|---|---|
| Expected shares (optional) Expected Proportions | A value you type or choose on the form. One share per category, such as 0.25, 0.25 and 0.5; ratios such as 1, 1, 2 also work. Blank means equal shares. Not sure? Leave it blank. Equal shares are the usual starting point without a theory or past data. |
| How strict to be Alpha | The cut-off for the p-value. Below it, the card reports evidence that the shares differ from those expected. Not sure? Keep 0.05. It is the usual convention in most fields. |
| Compare with Expected distribution | uniform: equal shares for every category, used when Expected shares is blank. Typed shares are always used when present. Not sure? Keep uniform unless a theory or past data gives you expected shares. |
How to read the card
The Results tab starts with what to know first (rows left out, checks that did not pass), then the interpretation in words and the Key Results; charts and assumption checks follow further down. Learn More explains the method in plain words. Read a Result Card covers all four tabs.
What it assumes
- Adequate expected counts (chi-square)
If it does not hold: When too many categories have an expected count below 5, the chi-square distribution is a poor approximation to the goodness-of-fit statistic's true sampling distribution, making the p-value unreliable.
How to check: Checked directly: the card computes the minimum expected count across categories and the count of categories below 5, flagging it as a warning and recommending combining sparse categories or an exact multinomial test (an exact multinomial test is not in KernelStats).
- Independence of observations
If it does not hold: The goodness-of-fit test assumes each observation is counted once and independently of the others; violating this invalidates the test regardless of the expected-count check.
How to check: Not checked by KernelStats; assumed by design: each observation is counted once.
A worked example
Testing whether the three penguin species are equally common (uniform hypothesis) in a sample of 344 birds (152 Adelie, 68 Chinstrap, 124 Gentoo).
Result: χ²(2) = 31.91, p < .001, Cohen's w = 0.305 (a medium effect by Cohen's benchmarks).
The species are clearly not equally represented in this sample: the significant p-value and the Cohen's w show a departure of medium size by Cohen's benchmarks; whether that matters depends on the question being asked.
From the Statistics Library.
The code tabs
Code gives this analysis as Python, R and MATLAB code (and SAS where the tab offers it), reading the data the way KernelStats did. Export sends the card to a report or to slides. See The Code tab.
Understand the statistics
Ask Oobi
Type one of these into Ask Oobi beside your data:
- Are the three penguin species equally common in the sample?
- Explain the chi-square goodness-of-fit test in plain words.
- What does chi-square distribution mean?
Last reviewed November 16, 2026.
