24.2 Nonparametric ANOVA

When assumptions of normality and equal variance are not satisfied, we use nonparametric ANOVA tests, which rank the data instead of using raw values.


24.2.1 Kruskal-Wallis Test (One-Way Nonparametric ANOVA)

The Kruskal-Wallis test is a generalization of the Wilcoxon rank-sum test to more than two independent samples. It is an alternative to one-way ANOVA when normality is not assumed.

Setup

  • a2 independent treatments.
  • ni is the sample size for the i-th treatment.
  • Yij is the j-th observation from the i-th treatment.
  • No assumption of normality.
  • Assume observations are independent random samples from continuous CDFs F1,F2,,Fa.

Hypotheses

H0:F1=F2==Fa(All distributions are identical)Ha:Fi<Fj for some ij If the data come from a location-scale family, the hypothesis simplifies to:

H0:θ1=θ2==θa


Procedure

  1. Rank all N=ai=1ni observations in ascending order.
    Let rij=rank(Yij)
    The sum of ranks must satisfy:

    ijrij=N(N+1)2

  2. Compute rank sums and averages: ri.=nij=1rij,ˉri.=ri.ni

  3. Calculate the test statistic:

    χ2KW=SSTRSSTON1

    where:

    • Treatment Sum of Squares: SSTR=ni(ˉri.ˉr..)2
    • Total Sum of Squares: SSTO=ij(rijˉr..)2
    • Overall Mean Rank: ˉr..=N+12
  4. Compare to a chi-square distribution:

    • For large ni (5), χ2KWχ2a1.
    • Reject H0 if: χ2KW>χ2(1α;a1)
  5. Exact Test for Small Samples:

    • Compute all possible rank assignments:
      N!n1!n2!na!
    • Evaluate each Kruskal-Wallis statistic and determine the empirical p-value.

24.2.2 Friedman Test (Nonparametric Two-Way ANOVA)

The Friedman test is a distribution-free alternative to two-way ANOVA when data are measured in a randomized complete block design and normality cannot be assumed.

Setup

  • Yij represents responses from n blocks and r treatments.
  • Assume no normality or homogeneity of variance.
  • Let Fij be the CDF of Yij, corresponding to observed values.

Hypotheses

H0:Fi1=Fi2==Firi(Identical distributions within each block)Ha:Fij<Fij for some jji

For location-scale families, the hypothesis simplifies to:

H0:τ1=τ2==τrHa:τj>τj for some jj


Procedure

  1. Rank observations within each block separately (ascending order).

    • If there are ties, assign average ranks.
  2. Compute test statistic:

    χ2F=SSTRSSTR+SSEn(r1)

    where:

    • Treatment Sum of Squares: SSTR=n(ˉr.jˉr..)2
    • Error Sum of Squares: SSE=ij(rijˉr.j)2
    • Mean Ranks: ˉr.j=irijn,ˉr..=r+12
  3. Alternative Formula for Large Samples (No Ties):

    If no ties, Friedman’s statistic simplifies to:

    χ2F=[12nr(n+1)jr2.j]3n(r+1)

  4. Compare to a chi-square distribution:

    • For large n, χ2Fχ2r1.
    • Reject H0 if: χ2F>χ2(1α;r1)
  5. Exact Test for Small Samples:

    • Compute all possible ranking permutations: (r!)n
    • Evaluate each Friedman statistic and determine the empirical p-value.