# Comparing heteroscedastic groups with sample sizes from 1 to 24... No valid tests?

I'm comparing 1 continuous variable across 36 groups (nurses grouped into 36 hospital units). Several groups have only 1 observation, but most have more, ranging from 1-24 observations per group. Total observations across all groups are 120.

Here are the results and problems with each of the tests I've done (using SPSS 26):

One-way ANOVA: p = 0.002, but a Levene's test yields p=0.002 based on mean (p=0.121 based on median, not sure if that's relevant) indicates heteroscedasticity, which rules out ANOVA since my group sizes are so different.

Welch's ANOVA: Cannot produce results because some groups have only 1 observation. SPSS states, "Robust tests of equality of means cannot be performed because at least one group has the sum of case weights less than or equal to 1."

Kruskal-Wallis: p = 0.006, but some sources indicate that this test is not valid for data with unequal variances, and I've also read that this test should only be done for groups of sample size >=5.

Is there a test appropriate for comparing these groups? Or can I omit the groups with just 1 observation?

Thanks so much!

• Generally, Kruskal-Wallis makes no assumption about the dispersion, variances, etc between groups. It (and the rank sum test) only require that assumption (along with the distribution shape assumption) if you want to make inferences about differences in mean or median (i.e. location shift). Commented Jun 21, 2019 at 5:00
• Thanks for your help! Isn't location shift what Kruskal-Wallis is measuring? What other inferences can you make from that test that don't require assumption of equal variances?
– Jay
Commented Jun 21, 2019 at 5:18
• Location shift is a very specific use-case which requires extremely stringent assumptions. The KW (and rank sum) is a test for difference in stochastic size ("zeroth order stochastic dominance). The null of KW is "Randomly selected observations from no group are more likely to be larger than any other group", or $H_{0}$: $P(X_{i} > X_{j}) = 0.5$, $H_{A}$: $P(X_{i} > X_{j}) \ne 0.5$ for some $i \ne j$ and $i, j \in [1, 2,\dots ,k]$. Commented Jun 21, 2019 at 6:30
• That definition of stochastic dominance seems like as meaningful a measure of difference as any to my non-expert brain. Taking your and David's advice, I'll use the Kruskal-Wallis H test and omit the singleton groups. Doing this yields significance of p = 0.004.
– Jay
Commented Jun 22, 2019 at 5:48