Chi-Square Goodness-of-Fit Test
How to compare one categorical variable against a specified expected distribution in Licklider, and how this differs from a chi-square test of independence.
The chi-square goodness-of-fit test evaluates whether one categorical variable follows a specified expected distribution. It is a different method from the chi-square test of independence, which compares two categorical variables in a contingency table.
When to use it
Use this method when:
- You have one categorical variable
- You want to compare the observed category frequencies against a prespecified null distribution
- Your null hypothesis is about proportions such as
50% / 30% / 20%, not about association between two variables
If your question is whether two categorical variables are associated, use Chi-Square Test instead.
How to request it
Describe the category column and the expected proportions in the Chat. For example:
- "Run a chi-square goodness-of-fit test on
responseagainst 50% responder, 30% non-responder, 20% unknown." - "Compare the observed genotype distribution to the expected 1:2:1 ratio."
Licklider treats this as a dedicated GOF method. It does not reuse the contingency-family chi-square association surface.
What the results include
Chi-square statistic, degrees of freedom, and p-value
The main result reports the chi-square goodness-of-fit statistic, the corresponding degrees of freedom, and the p-value for the specified expected distribution.
Observed versus expected counts by category
The result lists each category with its observed count and the expected count implied by the expected proportions and the total sample size.
Method audit
The audit block records that the requested and executed method is chi2_gof and that the expected distribution was interpreted as specified proportions.
What this method does not do
- It does not test independence between two variables.
- It does not choose Fisher's exact test or contingency-family recommendation states.
- It does not infer expected proportions from your data automatically.
Interpretation notes
The p-value answers whether the observed category counts deviate from the specified null distribution more than would be expected by chance under that null. A small p-value suggests the observed distribution is inconsistent with the expected proportions you supplied.
The expected proportions are part of the hypothesis. If those proportions change, the test question changes too.
Related
- For two-variable categorical association, use Chi-Square Test.
- For sparse contingency tables where an exact test is preferable, see Fisher's Exact Test.