Degrees of Freedom

Degrees of freedom is one of the most common terms used in statistics. The blog describes the definition as well as two different examples one related to day to day life and another related to sample variance in order to explain the concept of degrees of freedom. (reading time 9 min)

Definition: 

  1. Degrees of freedom refers to the maximum number of logically independent values, which have the freedom to vary, in the data sample.
  2. Degrees of freedom is the total number of observations minus the numbers of mathematical constraints (don't worry we will see in an example to know what constraints meant).

Example 1

Suppose today is your birthday and you have 15 Amul dark chocolates and you want to distribute these chocolates among four of your friends Rumit, Mayur, Tarang and Rahul. 
You gave 5 to Rumit, 3 to Mayur, 4 to Tarang. While giving chocolates to your three friends you have the freedom to assign different numbers of chocolates but not with the case of Rahul.
You have to give 3 chocolates to Rahul, you don't have the freedom to assign the number of chocolates to Rahul. 
Here, the mathematical constraint is "total number of chocolates given to all four friends = 15".
So the degrees of freedom = total numbers of observations (4) - mathematical constraint (1) = 3


Please have a look at the visual 
Click on image to expand
Example 2
The second example is related to the sample variance. The formula of the sample variance is given below has n-1 in the denominator. In the formula of population variance the denominator is n instead of n-1.
In order to compute the sample variance, we need to calculate the deviations of individual observations from the mean. We also know that sum of deviations of all observations from the mean are zero.
Suppose we have 5 observations 1, 3, 8, 5 and 8. The mean of the observations is 5. See in the image below and try to figure out the deviation of fifth observation i.e. 8.
The fifth deviation would be 3 as the sum of all the deviations from mean must be 0.
i.e. -4 + -2 + 3 + 0 + unknown deviations = 0.
So only the first four deviations can vary but the fifth deviation can't. Therefore, the degree of freedom is 5-1 = 4.
In general, while calculating the sample variance we impose a restriction that the deviations are to be taken from the mean value. Therefore, if there are n observations the degrees of freedom would be n-1.


Hope you get the idea by these two examples about the degrees of freedom. If have any query or suggestions please do post it below.

References:
1) https://www.investopedia.com/terms/d/degrees-of-freedom.asp
2) Rangaswamy, R. (2010). A textbook of Agricultural Statistics (2nd Edn). New Age International Publishers, New Delhi. pg 84
To learn more about Agricultural Statistics follow my youtube channel

If you find this blog post and youtube video useful than please support my content. This will help me to bring more such content.

 
Topics you might be interested in:

Principles of designs of experiments-I: Randomization
Principles of designs of experiments-II: Replication
Principles of designs of experiments-III: Local Control
One sample t-test in R

Comments

Popular posts from this blog

RCBD analysis in R along with LSD and DNMRT test

Completely Randomized Design Analysis in R along with LSD