Degrees of freedom Genetics definition
As a first understanding, it could help to know that the idea of "degrees of freedom" is hardly unique to statistics; the idea behind "degrees of freedom" is exactly the same (sort of), be it in chemistry, physics or process engineering.
Looking at the definition in process engineering, it's essentially the number of independent variables that can be regulated to define a process (will come back to the statistical one in a minute).
Let's say you have a giant tank from which you obtain water to drink. Now, let's assume that only the amount of water you can get out of the tank is of interest. To know how much water you want to get out of this tank, you only need to know how much water you are putting into the tank. If you draw more water from the municipal supply than you take out, eventually the tank will overflow and cause a mess. If you take out more water than you put in, eventually the tank will run dry. Hence, the amount of water you can take out to drink is wholly determined by the amount of water you put in.
If you define the amount of water you put in, you essentially define how much water you can take out (and hence the process). Hence, the number of degrees of freedom in this single-input single-output system is one.
Physics: The number of parameters to define a state.
Only one parameter (the inflow of water) needs to be adjusted to define the state of the process.
Statistics: The number of values in the final calculation of a statistic that are free to vary .
Only one parameter (the inflow of water) can be freely varied (the independent variable).
Coming back to other applications of statistics, how many degrees of freedom are there in a particular data set?
Or, how many parameters can you adjust to define the dataset?
Let's say we have a dataset with 2 points. The simplest function fully defining these 2 points can be said to be any arbitrary straight line connecting these two points. Meaning, any line
y = ax + b
exists to define this data set. 2 parameters can be freely varied in this function. Hence, the number of degrees of freedom is 2.