I have taken an introductory course in statistics. But I cant understand the degree of freedom. I understand that it is the number of dimensions of free components of the final random variable. But I couldn't get why it is sometimes $n-1$ or $n-2$ rather than simply $n$?(where $n$ is the number of observations in the experiment)
Can someone kindly explain to me in simple language or redirect me to a straightforward material, why/when is the degree of freedom not $n$?