Coming back to degrees of freedom for chi squared, I have found a wonderful answer here: How to understand degrees of freedom?

However it is hard for me to apply it to my particular case. Let's say we observed counts of objects of 3 types:

 A  B   C
35 121 344

The model, which has only one parameter, p, says that we should observe these objects with frequencies 0.01, 0.3, 0.69, which are some non-linear functions of p, let's say f(p), h(p), t(p). Given these frequencies, calculated using our model parameter p, we calculate expected counts and chi square statistic.

Question: how many degrees of freedom for chi square distribution should we use in this case?

  • 3
    $\begingroup$ It depends on whether $p$ was estimated from these data or was determined in some other way. Perhaps you could clarify that point? (Fortunately, in this case you will get the same results no matter what: the count for $A$ is so obviously out of line with a frequency of $0.01$ (predicting a count of only $5$ instead of $35$) that it is extremely implausible that these data are consistent with $p$. You can use a Poisson or Binomial or even Normal approximation to get a sense of how extreme $35$ is; the calculations are easily carried out in your head.) $\endgroup$
    – whuber
    Commented Dec 12, 2013 at 20:10
  • $\begingroup$ Thank you whuber, yes we estimate p from data, but it isn't clear what does it mean. For example, if we have one parameter, one can decide that we have only 1 degree of freedom, and don't use the formula n - 1 - k, where n is a number of bins, and is k a number of independent parameters. For me it is hard to see how this simple formula for number of dfs can capture non-linearity of f(), h() and t(), how this test statistic completely hides underlied complexity of the model, and uses only number of free parameters. Maybe you can suggest how can I simulate it to see on my own eyes? $\endgroup$
    – Entsy
    Commented Dec 13, 2013 at 18:08
  • $\begingroup$ Or just drop a link or recommend a book where such maybe basic question answered. What I googled so far was just recipes, which, moreover, contradicted each other (this problem indeed corresponds to a real-life one, but I tried to hide unnecessary details) $\endgroup$
    – Entsy
    Commented Dec 13, 2013 at 18:14

1 Answer 1


We start with 3 d.f.

If the total observed count is used to calculate the $E_i$ from the expected proportions (the usual case), then the d.f. reduces by 1.

If the parameter, $p$, from which the expected proportions are calculated is estimated from discrete data (and, estimated efficiently), then this will reduce the d.f. by 1.

So in the usual case, this leaves 1 degree of freedom.

If the expected proportions are specified without reference to the data (e.g. specified in some null hypothesis), then you don't lose a d.f. for the parameter, leaving you with 2 d.f.

(These could always be verified by simulation, as long as the expected counts in the simulation aren't small.)

  • $\begingroup$ Thank you Glen, could you please clarify what does it mean "estimated efficiently"? Indeed, in this case we estimate p from our observed counts, just solving some quadratic equations. $\endgroup$
    – Entsy
    Commented Dec 13, 2013 at 17:59
  • $\begingroup$ In effect it means estimated using a method with lowest possible asymptotic variance, which means that here you'd likely need to use MLE or minimum chi-square or something equally efficient. Your description of how the estimation is done doesn't make it clear whether you're doing something efficient or not. If it's not efficient you won't have a chi=square distribution; you might need to simulate to get the distribution of the test statistic. $\endgroup$
    – Glen_b
    Commented Dec 13, 2013 at 23:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.