Learning Objectives

By the end of this note, you will separate goodness of fit from independence, compute expected counts under a hypothesized share, compute $\chi^{2}=\sum(O-E)^{2}/E$ with $\text{df}=k-1$, and test fit with a BS 2081 Nepal example.

Why Fit Matters Before Assuming Equal Shares

A Palika assumes grievances arrive evenly across six working days, a province assumes applications split equally across four centers, a ward expects caseload shares of $30$ percent admin $45$ percent technical $25$ percent support. Each claim states a single categorical distribution. Goodness of fit compares the observed counts $O_{i}$ in $k$ categories to the counts $E_{i}$ implied by the claim. Large mismatch suggests the assumed shares mislead staffing or procurement in FY 2081/82, while a small mismatch may still hide a policy relevant spike on one day.

Grouped Framework: One Variable, Expected Shares, and $\chi^{2}$

Condition 1: One categorical variable against a claimed distribution. Use goodness of fit when one variable is classified into $k$ categories and $H_{0}$ supplies a full set of expected proportions $p_{i0}$ that sum to 1. Goodness of fit uses one row of data, independence uses a cross table. Keep them distinct. Independence has $\text{df}=(r-1)(c-1)$, goodness of fit has $\text{df}=k-1$.

Condition 2: Expected counts from the claim. Compute

\[E_{i}=n\times p_{i0}\]

where $n$ is total observations. For a uniform claim, $p_{i0}=1/k$ so $E_{i}=n/k$. For a ratio $4:3:2:1$, sum $10$, so $p=(0.4,0.3,0.2,0.1)$ and $E=n\times p$. For percentages, $E=n\times\text{percent}/100$. This step translates a policy claim into count benchmarks.

Condition 3: Adequate $E_{i}$ and random sampling. Require $E_{i}\ge 5$ for every category for the chi square approximation to hold. If a category fails, combine adjacent sensible categories and reduce $k$ accordingly. Data should be a random or fully enumerated set of cases, not a self selected sample that omits a category.

Hypotheses.

\[H_{0}: O\text{ follows the claimed distribution }p_{i0}\quad\text{vs}\quad H_{1}: O\text{ does not follow that distribution}\]

The alternative is always two sided in fit sense. Deviation in any category contributes to $\chi^{2}$.

Test statistic.

\[\chi^{2}=\sum_{i=1}^{k}\frac{(O_{i}-E_{i})^{2}}{E_{i}},\quad \text{df}=k-1\]

Large values indicate poor fit. Small values indicate consistency with the claim.

Decision. Reject $H_{0}$ when $\chi^{2}>\chi^{2*}_{\alpha,k-1}$ or $p<\alpha$. A non rejection does not prove the claimed distribution, it only shows insufficient evidence of mismatch at the chosen $n$ and $\alpha$.

Reporting fit. Show $O_{i}$, $E_{i}$, each $(O-E)^{2}/E$ contribution, $\chi^{2}$, df, and $p$, plus a bar chart of $O$ versus $E$ for managers who need a visual staffing cue.

Worked Example: Grievance Load Across Six Working Days in BS 2081

Context. In Falgun 2081, a municipal grievance desk staffed Sunday to Friday assumes workload is uniform across the six working days. Staffing for Chaitra 2081/82 depends on whether the data contradict that assumption, with overtime budgeted at NPR 80000 per reassigned day. Over several weeks, $n=240$ complaints are recorded:

Day Sun Mon Tue Wed Thu Fri Total
Observed $O$ 52 38 35 41 30 44 240
Expected $E$ under uniform 40 40 40 40 40 40 240

Test uniform fit at $\alpha=0.05$.

Step 1: Hypotheses.

\[H_{0}: p_{\text{Sun}}=\cdots=p_{\text{Fri}}=1/6\quad H_{1}: \text{at least one }p_{i}\neq 1/6\]

Step 2: Expected counts. $E=n/k=240/6=40$ for each day.

Step 3: $\chi^{2}$.

\[\chi^{2}=\frac{(52-40)^{2}}{40}+\frac{(38-40)^{2}}{40}+\frac{(35-40)^{2}}{40}+\frac{(41-40)^{2}}{40}+\frac{(30-40)^{2}}{40}+\frac{(44-40)^{2}}{40}\] \[=\frac{144}{40}+\frac{4}{40}+\frac{25}{40}+\frac{1}{40}+\frac{100}{40}+\frac{16}{40}=\frac{290}{40}=7.25,\quad \text{df}=5\]

Step 4: Critical value and decision. $\chi^{2*}{0.05,5}=11.070$. Since $7.25<11.070$, fail to reject $H{0}$. Software $p\approx0.203$.

Step 5: Policy reading. The sample does not contradict uniform workload at 5 percent significance. This does not prove equality, Sunday contributed the largest term $144/40=3.60$ and Fri $0.40$, so a longer record could reveal a weekend peak. Staffing keeps a provisional Sunday top up on practical grounds without claiming a statistical violation. No NPR reallocation is mandated by this test alone, but tracking continues into BS 2082.

Self-check

Try this (calculable): In Poush 2081, a province tests its claim that staff split across three departments is $30$ percent admin, $45$ percent technical, $25$ percent support. A random audit of $n=200$ staff finds Admin $70$, Technical $80$, Support $50$. Test fit at $\alpha=0.05$.

(a) Compute $E_{i}=n\times p_{i0}$ for each department. (b) Compute $\chi^{2}=\sum(O-E)^{2}/E$. (c) With $\text{df}=2$, critical $\chi^{2*}_{0.05,2}=5.991$, decide and interpret cost impact if technical posts cost NPR 500000 more per reassigned FTE than assumed.

Answer: (a) $E_{\text{Admin}}=200\times0.30=60$, $E_{\text{Tech}}=90$, $E_{\text{Supp}}=50$. (b) $\chi^{2}=(70-60)^{2}/60+(80-90)^{2}/90+(50-50)^{2}/50=100/60+100/90+0\approx1.667+1.111=2.78$. (c) $2.78<5.991$, fail to reject $H_{0}$, $p\approx0.25$. No evidence the true split differs from $30/45/25$, so the staffing model stands, though Technical looks 10 short and Admin 10 heavy, worth monitoring without immediate NPR reassignment.

Check: explain why merging Admin and Support would wrongly change $k$ and df to 1 and hide where the gap sits.

Summary

Goodness of fit tests one distribution against a claimed share vector. Translate the claim to $E_{i}=n\times p_{i0}$, verify $E_{i}\ge 5$, compute $\chi^{2}=\sum(O-E)^{2}/E$ with df $=k-1$, compare to $\chi^{2*}$ at $\alpha$, and report each category contribution so the largest mismatch guides staffing. Remember that fail to reject does not confirm the claim, it only finds no sufficient evidence of misfit at that $n$.

Key Takeaways

  • Match the question to fit when one variable faces a fixed expected distribution, and keep df $=k-1$ distinct from $(r-1)(c-1)$.
  • Form $E_{i}=n\times p_{i0}$ directly from the claim, uniform $n/k$, ratios via $p=\text{ratio}/\text{sum}$, percentages via $n\times\text{percent}/100$.
  • Compute $\chi^{2}=\sum(O-E)^{2}/E$ and read $\chi^{2*}$ at df $=k-1$, critical $5.991$ at df $2$, $7.815$ at df $3$, $11.070$ at df $5$ for $\alpha=0.05$.
  • Require $E_{i}\ge5$ and show $O$ versus $E$ bars, so a large Sunday or Technical gap remains visible even when the overall test does not reject.
  • State fail to reject as insufficient evidence, not proof of uniformity, and extend data collection when a single category already suggests a staffing risk for FY 2081/82.

Discussion

  • Your $n=30$ sample claims fit to $k=6$ uniform shares. Every $E=5$. Why is the chi square approximation fragile at that boundary, and what plain language caution belongs in a BS 2081 memo.
  • A report says $p=0.20$ proves workload is even. How would you restate to fail to reject and keep Sunday staffing on practical grounds without overstating evidence.
  • An analyst tests fit to $40,35,25$ percent with $n=100$ and finds $\chi^{2}=2.3$. How does doubling $n$ to $200$ with the same observed proportions change $\chi^{2}$, and why does larger $n$ detect smaller misfit.

Exercises

  1. Die rolled $n=120$: $O=25,17,22,15,19,22$. Uniform $E=20$ each, $\chi^{2}=3.40$, df $5$, critical $11.070$, decision at $0.05$.
  2. Product ratio $4:3:2:1$ with $n=200$: $O=90,55,35,20$, $E=80,60,40,20$, $\chi^{2}\approx2.29$, df $3$, critical $7.815$, fit.
  3. Emergency calls $n=500$ across seven days: $65,58,62,60,70,85,100$, uniform $E\approx71.43$, $\chi^{2}\approx20.21$, df $6$, critical $16.812$ at $0.01$, reject uniformity and explain weekend peak.
  4. Blood types $n=500$: $O=220,180,70,30$ versus $45,40,11,4$ percent, $E=225,200,55,20$, compute $\chi^{2}\approx10.68$, df $3$, critical $7.815$, decision at $0.05$.
  5. Explain why goodness of fit cannot answer whether location is associated with satisfaction, and which test and df formula applies to that $2\times3$ question instead.