The power of the goodness of fit or chi-square independence test is given by
where F is the cumulative distribution function (cdf) for the noncentral chi-square distribution χ2(df), xcrit is the χ2(df) critical value for the given value of α and λ = w2n is the noncentrality parameter where w is the φ effect size (see Chi-square Effect Size), even for larger than 2 × 2 contingency tables.
Example 1: Calculate the power for Example 3 of Goodness of Fit.
The power of this test is 23%, as shown in Figure 1.
Figure 1 – Power of goodness of fit test
We can use the CHISQ_POWER function to achieve the same result, namely CHISQ_POWER(B9,B4,B5) = .230126.
Real Statistics Functions: The following function is provided in the Real Statistics Resource Pack:
CHISQ_POWER(w, n, df, α, iter, prec) = the power of a chi-square goodness of fit or independence test where w = Cohen’s effect size, n = the sample size, df = degrees of freedom and α = alpha (default = .05).
CHISQ_SIZE(w, df, 1−β, α, iter, prec) = the minimum sample size required to obtain power of at least 1−β (default .80) in a chi-square goodness of fit or independence test where w = Cohen’s effect size and α = alpha (default = .05).
Here iter = the maximum number of terms in the infinite sum that will be calculated (default 1000) and prec = desired level of accuracy of the power calculation (default 0.000000001).
Example 2: How big a sample is required to achieve power of 80% for a chi-square test of independence for a 3 × 3 contingency table with medium effect size (i.e. w = .3)?
We can use Excel’s Goal Seek capability as shown in Figure 2.
Figure 2 – Using Goal Seek to find the sample size
Upon pressing the OK button, the value in cell G10 changes to .80 and the value in cell G9 changes to 132.6031. Thus a sample size of 133 is required.
The sample size requirement can also be obtained using the Real Statistics formula