One-Factor Within Groups and Between Groups Variation

Decomposing total variation in a one-way ANOVA setting into between-groups and within-groups sums of squares.

Step 1 of 157%

Tutorial

Setup and Between-Groups Variation

In a one-factor (one-way) analysis of variance, we collect samples from kk groups and want to measure how variation in the data splits into variation between the group means and variation within each group. We use the following notation:

  • nin_i = sample size of group ii
  • xˉi\bar{x}_i = sample mean of group ii
  • xijx_{ij} = the jj-th observation in group ii
  • N=n1+n2++nkN = n_1 + n_2 + \cdots + n_k = total sample size
  • xˉ\bar{x} = grand mean, the mean of all NN observations:
xˉ=1Ni=1kj=1nixij=1Ni=1knixˉi.\bar{x} = \dfrac{1}{N}\sum_{i=1}^k \sum_{j=1}^{n_i} x_{ij} = \dfrac{1}{N}\sum_{i=1}^k n_i\, \bar{x}_i.

To measure how much the group means differ from one another, we compute the between-groups sum of squares:

SSB=i=1kni(xˉixˉ)2.SS_B = \sum_{i=1}^k n_i (\bar{x}_i - \bar{x})^2.

Each group contributes a squared deviation of its mean from the grand mean, weighted by its sample size. A large SSBSS_B indicates that the group means are spread far apart.

For instance, suppose three groups of size n1=n2=n3=4n_1 = n_2 = n_3 = 4 have means xˉ1=2, xˉ2=5, xˉ3=8\bar{x}_1 = 2,\ \bar{x}_2 = 5,\ \bar{x}_3 = 8. The grand mean is

xˉ=42+45+4812=6012=5,\bar{x} = \dfrac{4 \cdot 2 + 4 \cdot 5 + 4 \cdot 8}{12} = \dfrac{60}{12} = 5,

so

SSB=4(25)2+4(55)2+4(85)2=36+0+36=72.SS_B = 4(2-5)^2 + 4(5-5)^2 + 4(8-5)^2 = 36 + 0 + 36 = 72.
navigate · Enter open · Esc close · ⌘K/Ctrl K toggle