Degrees of freedom are the number of values that remain free to vary once the parameters estimated from the data are fixed. For many tests they equal the number of observations minus the number of estimated parameters, for example n − 1 for a one-sample t-test.
Formula
df = n − p