calculateDf function

Degrees of freedom