Tutorials › Introduction to Statistics › Recognizing One-Way Goodness-of-Fit Questions

Chi-Square Goodness of Fit · Tutorial 798 of 996

Recognizing One-Way Goodness-of-Fit Questions

Learn to identify the data structure and research question that call for a one-way goodness-of-fit approach, rather than an analysis of association between two categorical variables.

Intermediate 9 min read

What You'll Learn

  • Identify the observational unit, the single categorical outcome, and its categories.
  • Recognize a reference distribution given as probabilities for those categories.
  • Distinguish comparing one outcome’s counts with a reference from comparing outcomes across groups.
  • Use a two-way table to spot questions involving two categorical variables.
  • Avoid choosing a method from the table’s appearance alone; focus on the question being asked.

What Makes a Question One-Way?

A data table can contain many numbers, but the number of columns does not by itself determine the statistical question. The key is to identify what is recorded for each observational unit and what the researcher wants to compare. A one-way goodness-of-fit question concerns one categorical outcome and asks whether its observed category counts are consistent with a specified probability distribution.

For example, a manufacturer might state that its packets contain candies in four colors in specified proportions. A quality-control sample records one color for each candy. The question is whether the observed color counts fit the stated proportions. This is different from asking whether color is associated with the production line on which each candy was made: that question involves two categorical variables.

Definition: A one-way goodness-of-fit question compares the observed counts for the categories of one categorical variable with a single specified probability distribution over those categories. The categories must be mutually exclusive and collectively exhaustive, so each observational unit contributes to exactly one category.

The specified distribution assigns a probability to each category. Those probabilities describe the reference pattern the observed counts are to be compared with; they sum to 1. The data supply counts, while the reference distribution supplies the target pattern. Recognizing this structure does not yet calculate a test statistic or decide whether the data fit well. Those are later steps.

Read the Data Structure Before Choosing an Approach

Suppose the categorical outcome has \(k\) categories. For a sample of \(n\) observational units, let \(n_j\) be the observed count in category \(j\). Each unit contributes to one category, so the counts add to the sample size:

$$ n_1+n_2+\cdots+n_k=n $$

A useful descriptive check is the observed proportion in each category, calculated by dividing that category’s count by the total number of units:

$$ \hat{p}_j=\frac{n_j}{n} $$

These observed proportions summarize the sample’s distribution. In a one-way goodness-of-fit question, the comparison is between this one distribution across categories and one specified reference distribution. There is no second grouping variable whose levels are being compared.

A compact checklist helps identify the structure:

1
Name the observational unit.
What single person, object, event, or other unit does each recorded outcome describe?
2
Name the categorical outcome.
What one category does each unit belong to, and what are the possible categories?
3
Locate the reference distribution.
Are specified probabilities given for those same categories?
4
Check the question’s comparison.
Is the aim to compare one outcome’s counts with that reference, or to compare category patterns across groups?

The category labels must refer to the same outcome in both the data and the reference. If the data classify candies by color, for instance, probabilities for candy flavor do not define the relevant reference distribution. The categories must also cover all possible recorded outcomes: otherwise, a unit cannot be assigned consistently to one of the categories being counted.

Worked Examples: Recognizing the One-Way Structure

Worked Example: Candy Colors and a Stated Recipe

A candy company states that a packet’s candies are 40% red, 30% blue, 20% yellow, and 10% green. An inspector takes a hypothetical sample of 100 candies and records 46 red, 27 blue, 18 yellow, and 9 green. Is the question one-way goodness of fit?

Observational unit: one candy. One categorical variable: candy color, with the four mutually exclusive categories red, blue, yellow, and green. The company supplies a single probability distribution over those same categories: 0.40, 0.30, 0.20, and 0.10. The probabilities sum to 1:

$$ 0.40+0.30+0.20+0.10=1.00 $$

The observed counts also total 100. Their observed proportions are 46/100 = 0.46 red, 27/100 = 0.27 blue, 18/100 = 0.18 yellow, and 9/100 = 0.09 green. The question compares this one sample distribution with the company’s stated distribution, so it has the one-way goodness-of-fit structure. These calculations describe the sample; they do not establish whether the difference from the stated pattern is statistically meaningful.

Worked Example: A Specified Distribution of Call Outcomes

A hypothetical service center expects calls to end in one of three recorded outcomes: resolved during the call with probability 0.70, referred to a specialist with probability 0.20, or abandoned before resolution with probability 0.10. A manager records the outcome for 80 calls and obtains counts of 54, 18, and 8, respectively. What kind of question would compare these counts with the stated pattern?

Each observational unit is a call, and each call receives exactly one category for the variable “call outcome.” The stated probabilities apply to these same three categories and form a distribution because:

$$ 0.70+0.20+0.10=1.00 $$

The observed counts total 80:

$$ 54+18+8=80 $$

The sample proportions are 54/80 = 0.675 for resolved, 18/80 = 0.225 for referred, and 8/80 = 0.100 for abandoned. Since the question is whether the distribution of one categorical variable matches one specified pattern, it is a one-way goodness-of-fit question. If instead the manager asked whether call outcome differs by weekday versus weekend, the recording would include a second categorical variable, and the question would no longer be one-way.

When Two Categorical Variables Change the Question

A question about association asks whether two categorical variables are related. For example, a researcher might record both a patient’s clinic type and whether a follow-up appointment was attended. Each variable has categories, and the data can be arranged in a two-way table. The goal is to assess whether attendance patterns differ by clinic type, not whether attendance alone matches one externally specified probability distribution.

A two-way table often contains counts for combinations of categories. Its rows might be clinic types and its columns might be attendance outcomes. Although the table contains counts for a categorical outcome, the second variable matters: the question compares outcome patterns across clinic types. That makes it a question involving two categorical variables.

Worked Example: Attendance by Clinic Type

In a hypothetical sample, 40 patients attend Clinic A and 50 attend Clinic B. At Clinic A, 30 attend a follow-up appointment and 10 do not. At Clinic B, 30 attend and 20 do not. Is this a one-way goodness-of-fit question?

There are two recorded categorical variables: clinic type (A or B) and follow-up attendance (attended or did not attend). The counts can be displayed as follows:

Clinic typeAttendedDid not attendTotal
A301040
B302050
Total603090

The attendance proportions are 30/40 = 0.75 for Clinic A and 30/50 = 0.60 for Clinic B. The question “Is attendance associated with clinic type?” compares attendance across the two clinic categories. It is therefore a two-variable association question, not a one-way goodness-of-fit question. The fact that the response variable has only two categories does not erase the clinic-type variable from the question.

This contrast is about the question being asked, not merely about how the table is printed. The same records could be summarized as one overall attendance count—60 attended and 30 did not—but that summary would no longer retain the clinic information. Whether that summary is appropriate depends on the aim of the analysis.

A Short Justification: Why the Number of Variables Matters

The distinction follows directly from what each count represents. In a one-way setup, every unit is classified by one categorical outcome, and the observed counts describe one distribution. In an association setup, a unit is classified on two categorical variables, and the table records how their categories occur together. The second variable permits comparisons across its categories that a single overall count cannot show.

For example, totals of 60 attended and 30 did not attend tell us the overall attendance distribution in the clinic example. They do not tell us whether attendance is the same at Clinics A and B. The row totals preserve the group information: the observed attendance proportions are 0.75 and 0.60, respectively. Thus the association question cannot be answered from the overall one-way counts alone.

This is why a goodness-of-fit question requires both a single categorical outcome and a reference distribution for that outcome, while an association question is organized around two categorical variables. The format of the data table is a clue, but the research question determines which structure is relevant.

Common Mistakes

  • Calling every table of category counts one-way. Wrong reasoning: “The data are counts, so this is goodness of fit.” Correction: identify how many categorical variables the question compares. Counts arranged by two variables may represent an association question.
  • Confusing an observed sample pattern with a specified reference. Wrong reasoning: “The sample’s own proportions are the target distribution.” Correction: a goodness-of-fit question compares observed counts with a reference distribution that has been specified for the comparison; the observed data are not themselves that reference.
  • Ignoring a grouping variable. Wrong reasoning: “Attendance is one categorical variable, so the question is one-way,” even though outcomes are compared by clinic type. Correction: if the question asks whether the outcome pattern differs across groups, there are two categorical variables in the comparison.
  • Using categories that do not match. Wrong reasoning: “Any set of probabilities provides a reference.” Correction: the probabilities must apply to the same outcome categories being counted, with categories that cover the possible outcomes.
Key takeaway: A one-way goodness-of-fit question has one categorical outcome, observed counts across its categories, and one specified probability distribution for those same categories. If the question asks whether two categorical variables are related or whether a category pattern varies across groups, it is an association question instead.

Check Your Understanding

For each situation, identify whether the main question has a one-way goodness-of-fit structure or involves association between two categorical variables. Explain briefly.

  1. A bakery specifies the proportions of three bread types it expects to sell. A manager records the type purchased in a sample of transactions and asks whether the observed mix matches the specified proportions.
  2. A survey records each respondent’s preferred news source and age group. The question is whether preferred source differs across age groups.
  3. A wildlife observer records the species of each bird seen and compares the counts with a stated distribution of species probabilities.
  4. A school records each student’s transportation mode and whether the student arrives late. It asks whether lateness is associated with transportation mode.
  5. A report gives the total number of patients who returned for follow-up and the total who did not, but asks whether those outcomes differ by hospital. What information would you need to answer that question?