Degrees of Freedom in ANOVA

For one-way ANOVA with $k$ treatments and total sample size $N$,

$$ \text{df}_{\text{total}} = N - 1, \quad \text{df}_{\text{treat}} = k - 1, \quad \text{df}_{\text{error}} = N - k. $$

These degrees of freedom match the decomposition

$$ N - 1 = (k - 1) + (N - k). $$