I am learning about chi tests and I've understood everything so far except how to calculate critical values. I don't want to take number of degrees of freedom and probability of exceeding the critical value(alpha) and look it up in the table. I want to learn how to calculate the critical value.
|
|
The chi-square distribution with $\nu$ degrees of freedom has cumulative distribution function $$F(x) = 1 - \frac{\Gamma(\nu/2,x/2)}{\Gamma(\nu/2)}\ \text{for} \ x > 0$$ For each positive integer $\nu$ this can be written in terms of powers of $x$, $e^{-x/2}$, and (if $\nu$ is odd) $\text{erf}(\sqrt{x/2})$. The upper-tail critical value at level $\alpha$ is the solution of $F(x) = 1 - \alpha$, while the lower-tail critical value at level $\alpha$ is the solution of $F(x) = \alpha$. This can't generally be done in closed form, but you can use numerical methods. EDIT: In the case $\nu = 1$, $F(x) = \text{erf}(\sqrt{x/2})$, so the solution of $F(x) = \alpha$ is $x = 2\; (\text{erf}^{-1}(\alpha))^2$. In the case $\nu = 2$, $F(x) = 1 - e^{-x/2}$ for $x>0$, so the solution of $F(x) = \alpha$ is $x = - 2 \ln(1-\alpha)$. In the case $\nu = 4$, $F(x) = 1 - (1 + x/2) e^{-x/2}$ for $x > 0$, and the solution of $F(x) = \alpha$ is $x = -2\; \text{LambertW}(-1,-(1-\alpha)/e) - 2$. Those are the only cases, as far as I know, where the solution can be done in any sort of "closed form". |
||||
|