Degrees of freedom in statistics means the number of independent values that can be varied without changing a given parameter value. Let us understand this by means of an example.
Suppose you are given 5 sample values along with their mean. We are assuming that the mean is required to remain constant. It is quite clear that if you vary all 5 values the mean will obviously change. But you can vary four out of 5 values. This is because if you change 4 values you can always subtract those changes from the fifth value without changing the mean.
Suppose we are given the values 1,3,5,7,9 whose mean is 5. Suppose we vary the first four values by adding one to each of them. Since we are adding 1 four times we shall subtract 1 four times from the fifth value. The new set of data becomes 2,3,4,5,1 whose mean is still clearly equal to 5.
How to determine degrees of freedom? (Some examples)
- Suppose you are given ‘n’ data values along with their mean. Then the degree of freedom is ‘n-1’ as we saw in the above example.
- Suppose we are given two sets of data of sizes n1 and n2 along with both of their means. Since here we have two fixed constants (the two sample means) we see that the degrees of freedom is n1+ n2 -2.
- In either one way ANOVA or ANCOVA procedure the degrees of freedom for treatment is ‘k-1’ and the degrees of freedom for error is ‘N-k’ where k is the total number of treatments and N is the total number of data values. Adding both degrees of freedom we see that the total degrees of freedom is ‘N-1’ as we saw in point number 1.
The advantage of degrees of freedom is that we use it in ANOVA procedure to calculate mean sum of squares. First we calculate the sum of squares and then on dividing by the respective degrees of freedom we obtain mean sum of squares due to treatment and mean sum of squares due to error respectively.
Degrees of freedom in Chi square Distribution
There is another sense in which the term degrees of freedom is used. It is a parameter in the Chi square probability distribution function.
It is known that adding up certain number of squares of standard normal variates gives us a chi square variate. The degrees of freedom ‘n’ in this case is equal to the number of standard normal variates squared which have been summed up to obtain the chi squared variate.