Degrees of Freedom vs Chi-Square Test
Both terms below come up in the same part of the course, and students mix them up. Here is each one defined on its own, side by side, so you can see where they part company.
Degrees of freedom
Confidence intervals
Degrees of freedom are the number of values free to vary when computing a statistic, and they set the exact shape of a t or chi-square distribution.
Degrees of freedom count the independent pieces of information left after a statistic uses some up to estimate other quantities. For a one-sample procedure it is , because the sample mean has already been estimated from the values. For example, a sample of has degrees of freedom for the -distribution. For a chi-square test of a two-way table with rows and columns, the degrees of freedom are .
Chi-square test
Hypothesis testing
A chi-square test compares observed counts of categorical data to the counts expected under a hypothesis, gauging how far the data stray from that model.
A chi-square test works with counts in categories rather than means, checking goodness of fit, independence, or homogeneity. It adds up the squared gaps between observed and expected counts, each scaled by the expected count, into one statistic. The formula is , where is an observed count and an expected count. For example, rolling a die 60 times and comparing each face's tally to the expected 10 tests whether the die is fair, and a large gives a small p-value.