# Power of the chi-squared test

Is there a known formula for the power of a $\chi^2$ test? Or a known method to calculate it? More precisely:

Take the simplest case of $\chi^2$ goodness of fit: a coin with unknown heads probability $\theta\in[0;1]$ is flipped $n$ times. You want to test $\theta=0.5$. Call $X_n$ the number of heads. Define as usual:

$$Y=4n\left(\frac{X_n}{n}-0.5\right)^2$$

Provided $\theta=0.5$ and $n$ is large enough, $Y$ has a $\chi^2$ distribution with 1 degree of freedom. Define $y_\alpha$ the right $\alpha$-quantile of this distribution. The test is "reject $\theta=0.5$" when $Y>y_\alpha$. By definition:

$$P(Y>y_\alpha|\theta=0.5)=\alpha$$

Is there a simple approximation for the power of the test, or an asymptotic formula ($n$ large...) for the power?

$$P(Y>y_\alpha|\theta)\quad\text{ (for \theta\neq 0.5)}$$

Everything is explained in this article with pedagogical examples.

For short, when $$\theta\neq \theta_0$$, $$Y$$ has a noncentral $$\chi^2$$ distribution. The noncentrality parameter $$\lambda$$ of this distribution depends on the distance from $$\theta$$ to $$\theta_0$$.

There is no simple closed form for the cumulative distribution. There are known approximations, tables, and it is available in several stat softwares.

Article referenced is :

Power and Sample Size for Approximate Chi-Square Tests

Author(s): William C. Guenther

Source: The American Statistician

• See this Q & A for P-value and power. – BruceET Jun 15 at 1:08