Degree of freedom chi square test