Course contentsShow
← Data Science
Lesson 442 of 2,14512. ANOVA and Multiple ComparisonsFree lesson

Degrees of Freedom in ANOVA

Calculating and understanding degrees of freedom for between-groups, within-groups, and total variance.

Degrees of Freedom in ANOVA

You'll learn how to calculate the degrees of freedom for each component of variance in ANOVA, which determines how you'll find critical values and assess significance.

What Are Degrees of Freedom in ANOVA?

Degrees of freedom (df) represent the number of independent pieces of information available to estimate variability. In ANOVA, you partition the total degrees of freedom into two components: between-groups and within-groups, just as you did with sum of squares.

Think of degrees of freedom like "slots" available for variation. If you have 30 observations total, that's 29 slots for variation (you lose one because the overall mean is fixed). ANOVA divides these slots between the variation among group means and the variation within each group.

The Three Degrees of Freedom

Total Degrees of Freedom

df_total = N - 1

Where N is the total number of observations across all groups. You subtract 1 because estimating the grand mean uses up one degree of freedom.

Between-Groups Degrees of Freedom

df_between = k - 1

Where k is the number of groups. You lose one degree of freedom because once you know (k-1) group means and the grand mean, the last group mean is determined.

Within-Groups Degrees of Freedom

df_within = N - k

This represents variation within groups. You lose k degrees of freedom (one per group) because each group's mean constrains its observations.

Why This Matters

These degrees of freedom are used to calculate mean squares (variance estimates) by dividing sum of squares by their respective df. The F-statistic then compares these mean squares to test your hypothesis.

Key Takeaway: In ANOVA, total degrees of freedom (N-1) split into between-groups (k-1) and within-groups (N-k), providing the denominators needed to convert sums of squares into variance estimates for the F-test.