Degrees of freedom in chi square test