Learning Objectives

By the end of this note, you will choose Kruskal Wallis when three or more groups need a rank based comparison, rank combined data and handle ties, compute $H=\frac{12}{N(N+1)}\sum R_{i}^{2}/n_{i}-3(N+1)$ with $\text{df}=k-1$, and decide with a BS 2081 Nepal example.

Why Ranks Replace Means Here

One way ANOVA compares means when scores are roughly normal with similar variances and adequate $n$. Municipal work often violates that: Likert satisfaction $1$ to $5$, skewed waiting times, or $n=3$ to $5$ per center that cannot support normality checks. Kruskal Wallis converts all observations to ranks and asks whether average ranks differ across groups. If one ward or center systematically sits higher in the ordered list, its rank sum pulls away and $H$ grows. The method needs only independent samples and ordinal or continuous data, not normality or equal variances.

Grouped Framework: Ranking, Rank Sums, and $H$

Condition 1: Three or more independent groups. Use when $k\ge3$. For $k=2$, Mann Whitney $U$ is the rank analogue. Groups must be independent, not paired before after on the same officers. That question belongs to paired $t$ or Wilcoxon signed rank.

Condition 2: Ordinal or non normal data where ANOVA is risky. Likert ratings, skewed timers, or small samples with outliers justify ranks. If data are roughly normal with similar variances and larger $n$, ANOVA is more powerful and preferred.

Condition 3: Ranking rule. Pool all $N=\sum n_{i}$ observations, order from smallest to largest, assign rank $1$ to smallest through $N$ to largest. For ties, assign the average of the tied positions. Verify

\[\sum_{i=1}^{k} R_{i}=N(N+1)/2\]

where $R_{i}$ is the rank sum for group $i$. This check catches ranking errors.

Test statistic. Under $H_{0}$ that all groups share the same distribution, expected average rank is $(N+1)/2$ for each group. Dispersion of $R_{i}/n_{i}$ around that center yields

\[H=\frac{12}{N(N+1)}\sum_{i=1}^{k}\frac{R_{i}^{2}}{n_{i}}-3(N+1)\]

For many ties, apply the tie correction

\[H_{c}=\frac{H}{1-\sum(t^{3}-t)/(N^{3}-N)}\]

where $t$ is the size of each tie group. Software applies this automatically. Report whether $H$ is tie corrected.

Distribution and decision. For moderate $N$, $H$ is approximated by chi square with

\[\text{df}=k-1\]

Reject $H_{0}$ when $H>\chi^{2*}_{\alpha,k-1}$ or $p<\alpha$. Rejection means at least one group differs in rank distribution, not that every pair differs. Pairwise follow up requires a post hoc test with correction for multiple testing.

Worked Example: Land Revenue Wait Times Across Three Centres in BS 2081

Context. In Jestha 2081, the District Administration Office pilots wait time monitoring at three service centres. Samples are only $5$ visits per centre, skewed, so a rank test is safer than ANOVA. Waiting times in minutes:

  • Centre A: $12,15,14,10,18$
  • Centre B: $20,25,22,19,24$
  • Centre C: $16,13,21,17,15$

Waiting of 20 minutes costs about NPR 150 in citizen time plus overtime risk. Test whether centres differ at $\alpha=0.05$.

Step 1: Hypotheses.

\[H_{0}: \text{three centres have the same waiting time distribution}\quad H_{1}: \text{at least one differs}\]

Step 2: Rank combined $N=15$ values.

Value 10 12 13 14 15 15 16 17 18 19 20 21 22 24 25
Group A A C A A C C C A B B C B B B
Rank 1 2 3 4 5.5 5.5 7 8 9 10 11 12 13 14 15

Note the tie at $15$, ranks $5$ and $6$ averaged to $5.5$.

Step 3: Rank sums.

  • $R_{A}=1+2+4+5.5+9=21.5$
  • $R_{B}=10+11+13+14+15=63.0$
  • $R_{C}=3+5.5+7+8+12=35.5$

Check $21.5+63+35.5=120=15\times16/2$.

Step 4: Compute $H$.

\[H=\frac{12}{15(16)}\left[\frac{21.5^{2}}{5}+\frac{63^{2}}{5}+\frac{35.5^{2}}{5}\right]-3(16)\] \[=\frac{12}{240}[92.45+793.80+252.05]-48=0.05\times1138.30-48\approx8.915\]

Tie correction for one pair $t=2$: denominator $1-(8-2)/(3375-15)=1-6/3360\approx0.9982$, so $H_{c}\approx8.93$. Software reports about $8.93$.

Step 5: Decision. $\text{df}=3-1=2$, $\chi^{2*}{0.05,2}=5.991$. Since $8.93>5.991$, reject $H{0}$, $p\approx0.012$. At least one centre differs. Average ranks point to Centre B highest, at about $12.6$ versus $4.3$ for A and $7.1$ for C. The NPR implication is to audit Centre B staffing and token flow before scaling the same roster to all centres in Shrawan 2081/82, then run post hoc pairwise comparisons.

Self-check

Try this (calculable): In Chaitra 2081, four ward counters log wait times with $n_{i}=3$ each:

  • Counter 1: $5,6,4$
  • Counter 2: $8,9,7$
  • Counter 3: $12,11,13$
  • Counter 4: $15,18,16$

Let $N=12$.

(a) Rank the 12 values, list $R_{i}$ for each counter, and verify $\sum R_{i}=78$. (b) Compute $H=12/(N(N+1))\sum R_{i}^{2}/n_{i}-3(N+1)$. (c) With $\text{df}=3$, critical $\chi^{2*}_{0.05,3}=7.815$, decide and name which counter looks highest by average rank.

Answer: (a) Ranks: $4\to1$, $5\to2$, $6\to3$, $7\to4$, $8\to5$, $9\to6$, $11\to7$, $12\to8$, $13\to9$, $15\to10$, $16\to11$, $18\to12$. So $R_{1}=1+2+3=6$, $R_{2}=4+5+6=15$, $R_{3}=7+8+9=24$, $R_{4}=10+11+12=33$, sum $78=12\times13/2$. (b) $H=12/(12\times13)[36/3+225/3+576/3+1089/3]-39=12/156\times642-39\approx49.38-39=10.38$. No ties, no correction. (c) $10.38>7.815$, reject $H_{0}$, $p\approx0.016$, at least one counter differs, Counter 4 has highest average rank $11$. For policy, investigate why Counter 4 waits cluster at the top and test staffing load before FY 2082/83 budgeting.

Check: explain why $df=3$ here and why Mann Whitney would apply if only two counters were compared.

Summary

Pool $N$ observations, rank them with ties averaged, sum ranks $R_{i}$ per group, compute $H=12/(N(N+1))\sum R_{i}^{2}/n_{i}-3(N+1)$ with tie correction when needed, compare $H$ to chi square on df $=k-1$, and interpret rejection as at least one group differs in rank distribution. In BS 2081 service data with small or skewed samples, Kruskal Wallis replaces ANOVA and guides targeted fixes rather than a blanket claim that every pairwise gap is significant.

Key Takeaways

  • Count groups and pick the right tool: $k\ge3$ independent groups with non normal or ordinal scores points to Kruskal Wallis, $k=2$ to Mann Whitney, paired data to Wilcoxon or paired $t$.
  • Rank the combined $N$ values, average ties, check $\sum R_{i}=N(N+1)/2$ before computing.
  • Compute $H=12/(N(N+1))\sum R_{i}^{2}/n_{i}-3(N+1)$ and apply tie correction $H_{c}=H/(1-\sum(t^{3}-t)/(N^{3}-N))$ when ties are common.
  • Use $\text{df}=k-1$ and chi square critical $5.991$ for df $2$ or $7.815$ for df $3$ at $0.05$, and interpret rejection as at least one distribution shift plus post hoc to locate it.
  • Report $H$, df, $p$, group $n_{i}$ and median or mean rank, and translate the rank gap to minutes or NPR service cost for the FY 2081/82 memo.

Discussion

  • With $n_{i}=4$ Likert ratings $4,5,4$ versus $3,2,3$ versus $5,4,5$, why does averaging tied ranks matter, and what happens to $H$ if you assign arbitrary ranks inside a tie.
  • An office reports $H=4.2$ with $k=3$ and claims proof of no difference because $p=0.12$. How would you restate as fail to reject and what sample size note belongs in the Chaitra 2081 report.
  • Why is a significant $H$ insufficient to claim Counter A differs from Counter B specifically, and which post hoc adjustment would you propose for three pairwise tests.

Exercises

  1. Satisfaction across Finance $7,6,8,5,6$, HR $5,4,6,3,5$, IT $9,8,7,10,8$: rank $N=15$, compute $R_{i}$ and $H\approx10.14$, df $2$, critical $5.991$, decision at $0.05$.
  2. Policy effectiveness $k=3$, $n_{i}=4$ with values $45,38,42,40$, $52,48,55,50$, $60,55,62,58$: show tie at $55$ with $8.5$, compute $H\approx9.55$, df $2$, decision.
  3. Four counters $3$ each as in Try This, replicate $H=10.38$, explain why $78$ verifies ranking and why one extreme value pulls $R_{i}$ more than it would pull a mean.
  4. Likert branches $n_{i}=3$ each: A $4,5,4$, B $3,2,3$, C $5,4,5$, D $2,3,2$: rank and test at $0.05$ with df $3$ and critical $7.815$, discuss practical branch training in NPR terms.
  5. State assumptions that Kruskal Wallis drops relative to ANOVA and one assumption it keeps, and explain why small $n$ and skewed waits in BS 2081 favour ranks.