A goodness-of-fit test asks a simple question: do the counts I observed match the counts I expected? Magic Stat computes both the Pearson chi-square and the likelihood-ratio G, with the per-category residuals, and lets you supply the expectation in three different ways.
The test compares a single categorical variable's observed counts with expected counts under a hypothesis. Pearson's statistic is χ² = Σ (o−e)²/e; the likelihood-ratio G is G = 2·Σ o·ln(o/e), with 0·ln 0 taken as 0. Both have k−1 degrees of freedom. They usually agree; when they diverge, the divergence itself is informative, so Magic Stat reports both rather than choosing for you.
The expectation can be uniform (every category equally likely), a set of custom proportions, a set of expected counts, or — the case that saves the most time — an already-computed expected column in your spreadsheet, one row per cell, so you compare observed against a column you did not have to type in.
This is a one-variable test. If your question is whether two categorical variables are associated, that is a contingency table, and it lives elsewhere in the app. Using a goodness-of-fit test for that question would be a category error.
Input modes: From column · Manual entry (optional category labels) · Two columns (observed × expected).
Expected under H0: equal proportions · custom proportions · custom expected counts.
Statistics: Pearson χ² and likelihood-ratio G, both with df = k−1.
Parity note: the χ² follows R's chisq.test without a continuity correction (which does not apply to the one-variable test), and the G follows the uncorrected G = 2·Σ o·ln(o/e).
You do not always. It answers the same question with a different statistic, and with healthy counts the two agree closely. It is worth reporting when the counts are small or when a reviewer expects the likelihood-ratio version; having both is cheap.
Yes — that is the third input mode. Give an observed column and an expected column, one row per cell; if the expected counts do not sum to the observed total they are rescaled to it (as R's chisq.test does with p = e/Σe) and a note appears.
Then G is infinite for that category (you cannot compute o·ln(o/0)) and the standardized residual is undefined. The app reports that honestly instead of substituting a number.
Goodness-of-fit is for one categorical variable against an expectation. To test whether two categorical variables are associated, use the contingency table analysis — those are different questions and different tests.
No. The calculation runs locally; the only signal sent is an anonymous installation counter.
Contingency tables → Log-linear models → Multinomial logistic regression →