Track 10 · Comparing Groups and Categorical Data · Lesson 3 of 11

Chi-square goodness of fit

Test whether the counts of one categorical variable are consistent with a claimed distribution, including a fitted model whose parameters are estimated from the data.

30 minIntermediate7 graded exercisesMembers

A retail chain plans staffing on the assumption that 20% of baskets come from new customers, 50% from returning customers and 30% from loyalty-card members. A month of till data has arrived. Is the planning mix still credible, or have the shares moved?

The goodness-of-fit (GOF) test uses one categorical variable with kk categories. A hypothesis specifies the probability of each category, p1,…,pkp_1, \dots, p_k (summing to 1). We compare the observed counts with the counts that hypothesis predicts.

  • H0H_0: the population proportions are p1,…,pkp_1, \dots, p_k.
  • H1H_1: at least one proportion differs.

Included with a Formula Quest membership

It has 7 graded exercises with feedback, hints and worked solutions. After it you will be able to:

  • Compute expected counts $N p_i$ and the goodness-of-fit statistic
  • Choose df = k − 1 − (number of estimated parameters)
  • Group sparse categories so expected counts are large enough
  • Read a non-significant fit as “compatible with”, never as proof