Tutorials › Introduction to Statistics › Degrees of Freedom as Remaining Independent Information

t, Chi-Square and F Distributions · Tutorial 475 of 996

Degrees of Freedom as Remaining Independent Information

Learn how a constraint on deviations reduces the number of independent values, and why estimating the sample mean leaves \(n-1\) degrees of freedom.

Intermediate 9 min read

What You'll Learn

  • Define degrees of freedom as the number of freely varying, independent pieces of information under stated constraints.
  • Derive why deviations from a sample mean must sum to zero.
  • Show why any \(n-1\) deviations determine the remaining deviation.
  • Distinguish algebraic independence from probabilistic independence.
  • Calculate sample variance and standard deviation using the \(n-1\) degrees of freedom.
  • Count the remaining information under two independent linear constraints.

Why Degrees of Freedom Matter

A list of \(n\) observations may look like it contains \(n\) separate pieces of information. But if the values must satisfy a constraint, not all \(n\) can vary freely. Once enough values are known, the constraint may determine the rest. Degrees of freedom describe how many independent pieces of information remain after such constraints are taken into account.

A familiar constraint appears when deviations are measured from the sample mean. The deviations cannot be arbitrary: they must add to zero. This means that, although there are \(n\) deviations, only \(n-1\) can be chosen freely. Understanding this count explains why the sample variance uses \(n-1\) in its denominator.

Definition: For a collection of quantities subject to constraints, the degrees of freedom are the number of independent quantities that can vary freely while the constraints remain satisfied. For \(n\) quantities subject to \(k\) independent linear constraints, the remaining degrees of freedom are \(n-k\). A constraint is independent if it rules out a condition not already imposed by the other constraints.

Here, “independent” refers to independent information in the algebraic sense: one value is not determined by the others and the constraints. It does not necessarily mean that the quantities are statistically independent random variables. In fact, deviations from a sample mean have a fixed sum, so knowing some of them restricts the possible values of the others.

Why Deviations From the Sample Mean Sum to Zero

Let \(x_1,x_2,\ldots,x_n\) be numerical observations, and let \(\bar{x}\) be their sample mean. The deviation of observation \(i\) from the sample mean is \(x_i-\bar{x}\). By the definition of the sample mean, the sum of these deviations is zero:

$$ \sum_{i=1}^{n}(x_i-\bar{x}) = \sum_{i=1}^{n}x_i-n\bar{x} = \sum_{i=1}^{n}x_i-n\left(\frac{\sum_{i=1}^{n}x_i}{n}\right) = 0. $$

This is one constraint on the \(n\) deviations. More directly, if the first \(n-1\) deviations are known, the last one must be the negative of their sum:

$$ x_n-\bar{x}=-\sum_{i=1}^{n-1}(x_i-\bar{x}). $$

Thus, there are \(n-1\) freely varying deviations and one deviation determined by the constraint. The constraint does not say that any particular deviation must equal zero; it says that the deviations as a group must balance.

Worked Examples

Worked Example: Finding the Remaining Deviation

Suppose five hypothetical measurements, in centimetres, are \(8, 9, 10, 12,\) and \(11\). Find their mean and deviations, then show how the zero-sum constraint determines the final deviation.

The sample mean is

$$ \bar{x}=\frac{8+9+10+12+11}{5}=\frac{50}{5}=10\text{ cm}. $$

The five deviations from this mean are \(-2,-1,0,2,\) and \(1\) cm. Their sum is

$$ -2+(-1)+0+2+1=0\text{ cm}. $$

If only the first four deviations were given, the constraint would require the fifth to be

$$ -( -2-1+0+2)=-(-1)=1\text{ cm}. $$

The five deviations therefore contain four freely varying pieces of information, not five. The fifth is fixed once the first four are known.

Worked Example: Computing Sample Variance With Four Degrees of Freedom

For the same five hypothetical measurements, calculate the sample variance and sample standard deviation. The observations are numerical measurements, and the calculation concerns their spread around the sample mean, so use the sample variance formula with \(n-1\) degrees of freedom.

The squared deviations are \(4,1,0,4,\) and \(1\) square centimetres. Their sum is \(10\text{ cm}^2\). There are five observations, but estimating their mean imposes the zero-sum constraint on the deviations, leaving \(5-1=4\) degrees of freedom. Thus,

$$ s^2=\frac{\sum_{i=1}^{n}(x_i-\bar{x})^2}{n-1} =\frac{10\text{ cm}^2}{5-1} =\frac{10}{4}\text{ cm}^2 =2.5\text{ cm}^2. $$

Taking the square root gives the sample standard deviation:

$$ s=\sqrt{2.5\text{ cm}^2} =\sqrt{2.5}\text{ cm} \approx 1.581\text{ cm}. $$

The denominator is \(4\), rather than \(5\), because only four deviations can vary freely after the sample mean has been estimated from these observations. This example illustrates the degrees-of-freedom count behind the sample variance formula; it is not a claim that the deviations are probabilistically independent.

Worked Example: Recovering a Missing Observation

Seven hypothetical readings have a sample mean of \(24\) units. The first six readings are \(21,23,25,24,26,\) and \(22\) units. Find the seventh reading, and verify the degrees-of-freedom count using the deviations.

Because the mean is \(24\), the total of all seven readings must be \(7(24)=168\) units. The first six sum to \(141\) units, so the missing reading is

$$ x_7=168-141=27\text{ units}. $$

The deviations from \(24\) are \(-3,-1,1,0,2,-2,\) and \(3\) units. The first six add to \(-3\) units, so the last deviation must be \(3\) units to make the total zero. This agrees with the recovered reading \(27\), since \(27-24=3\).

For completeness, the sum of squared deviations is

$$ (-3)^2+(-1)^2+1^2+0^2+2^2+(-2)^2+3^2 =9+1+1+0+4+4+9=28\text{ units}^2. $$

There are \(7-1=6\) degrees of freedom in the deviations. The corresponding sample variance and standard deviation are

$$ s^2=\frac{28}{6}=\frac{14}{3}\text{ units}^2, \qquad s=\sqrt{\frac{14}{3}}\text{ units}\approx 2.160\text{ units}. $$

The arithmetic shows both roles of the constraint: it determines the missing deviation, and it leaves six freely varying deviations out of seven.

A Geometric and Algebraic View

The zero-sum condition can also be viewed as a restriction on a vector. Write the deviations as \(d_1,d_2,\ldots,d_n\). Without a constraint, the vector \((d_1,d_2,\ldots,d_n)\) could be any point in \(n\)-dimensional space. Requiring \(d_1+d_2+\cdots+d_n=0\) restricts it to a flat set with one fewer dimension: choose \(d_1,\ldots,d_{n-1}\), and then \(d_n=-(d_1+\cdots+d_{n-1})\). This gives a direct justification for the count \(n-1\), rather than merely a rule to memorize.

In linear algebra terms, the zero-sum equation is one independent linear constraint. The set of allowed deviation vectors therefore has dimension \(n-1\). The same count follows by solving the constraint for one coordinate. Neither argument says that the deviation values are unrelated; their relationship is exactly what the constraint expresses.

Worked Example: Counting Degrees of Freedom With Two Constraints

Consider five hypothetical quantities \(r_1,r_2,r_3,r_4,r_5\), subject to two conditions:

$$ r_1+r_2+r_3+r_4+r_5=0, \qquad r_1-r_2=0. $$

These are two independent constraints: the second requires \(r_1=r_2\), while the first requires the total to be zero. Choose \(r_2,r_3,\) and \(r_4\) freely. The second constraint then sets \(r_1=r_2\), and the first sets

$$ r_5=-r_1-r_2-r_3-r_4=-2r_2-r_3-r_4. $$

Only three of the five quantities can be chosen freely, so the degrees of freedom are \(5-2=3\). For example, choosing \(r_2=1\), \(r_3=-1\), and \(r_4=2\) gives \(r_1=1\) and \(r_5=-3\). The resulting values \(1,1,-1,2,-3\) satisfy both constraints: their sum is \(0\), and \(r_1-r_2=0\).

This count depends on the constraints being independent. If one condition were already implied by another, it would not reduce the number of freely varying quantities a second time.

Degrees of Freedom Are Not a Count of Observations

The sample contains \(n\) observations, and all \(n\) are recorded. Degrees of freedom do not mean that one observation disappears or should be discarded. They count how many values can vary independently after a quantity—here, the sample mean—has been estimated and the resulting constraint is imposed. The full data still contribute to the mean and to the sum of squared deviations.

The count also depends on what is being considered. The original observations need not satisfy a zero-sum condition. It is the deviations from their own sample mean that do. In a different calculation, a different estimated quantity or constraint could lead to a different degrees-of-freedom count. Always identify the quantities and the actual independent constraints before applying a count.

Degrees of freedom are important in statistical methods that use sample variability, including methods involving the \(t\), chi-square, and \(F\) distributions. For now, the essential point is the constraint count: the sample mean imposes one independent restriction on the \(n\) deviations, leaving \(n-1\) degrees of freedom. The specific distributions and procedures that use this count are considered separately.

Common Mistake: Calling the Deviations Independent Random Variables

A common mistake is to say, “There are \(n-1\) degrees of freedom, so the deviations are \(n-1\) independent random variables.” That mixes two meanings of “independent.” The degrees-of-freedom statement is an algebraic count: \(n-1\) deviation coordinates can be chosen freely, and the final one is determined by their sum. It does not establish probabilistic independence. For example, if the first \(n-1\) deviations are known, the last is exactly determined, not free to take any value.

Key takeaway: Deviations from the sample mean sum to zero. That single independent constraint on \(n\) deviations leaves \(n-1\) degrees of freedom. In this setting, “independent” means freely variable information, not necessarily probabilistic independence.

Check Your Understanding

Answer each question by identifying the quantities and the constraints involved.

  1. There are eight deviations from a sample mean. How many degrees of freedom do they have, and what equation supplies the constraint?
  2. If four deviations from a mean are \(-2, 1, 0,\) and \(3\), what must the fifth deviation be if these are all five deviations?
  3. Why does the sample variance divide the sum of squared deviations by \(n-1\), rather than \(n\), in this degrees-of-freedom account?
  4. Does having \(n-1\) degrees of freedom mean the deviations are probabilistically independent? Explain the distinction.
  5. Six quantities satisfy two independent linear constraints. How many degrees of freedom remain?