How can effect size and power of the chi-square goodness-of-fit test be calculated such that:
Effect size is linear and standardized (given effect size $E_{x^2}$, $0 \le E_{x^2} \le 1$) so that tables are not required to determine if the effect size is small, medium, or large. This would be used to validate a significant effect size when the p-value of the test is less than a given $\alpha$.
the power can be used to calculate the required sample size given a desired false negative rate $\beta$.
The only restriction is that my test variable may have $2^{32}$ different levels. See chi-squared with too many degrees of freedom for more information.
What follows is the research I've done towards answering my question. Keep in mind it may be completely unfounded, but since it covers my knowledge on the topic I would appreciate if answers would take it into consideration.
I've found the following formula of power:
$$1 - \beta = F_{df,\lambda}(x_{crit})$$ where
- $\alpha$ is the false positive rate
- $\beta$ is the false negative rate
- $F_{df,\lambda}$ is the CDF of the non-central chi-square distribution $x^2_{df}$
$x_{crit}$ is the critical value for the given value of $\alpha$. I assume this means:
$1 - F_{df}(x_{crit}) = \alpha$
where
- $F_{df}$ is the CDF of the chi-square distribution $x^2_{df}$
$\lambda$ is the noncentrality parameter such that
$\lambda = \phi^2n$
where
- $\phi$ is the effect size
- $n$ is the sample size
I just don't know which effect size $\phi$ references:
The Phi Coefficient, $\sqrt{x^2/N}$
$\phi$ is only applicable to binomial variables, ie 2x2 contingency tables. Therefore, it probably isn't suited to goodness-of-fit tests.
Cramér's $\phi$, $\sqrt{\frac{x^2}{N(k-1)}}$
$\phi_c$ "may be used with variables having more than two levels", and is therefore suited to goodness-of-fit (1xk tables) tests. Unfortunately $\phi_c$ requires tables to determine the significance of the effect size (see this question), and may be meaningless for large $k$. Apparently it "functions as a measure of tendency towards a single outcome", ie between the variables Expected and Observed. Unfortunately I can't find any references that can confirm $\phi_c$ is meaningful for the goodness-of-fit test (see this question). In fact, the standard definition of Cramér's $\phi$:
$\phi = \sqrt{\frac{x^2}{n*min(c-1,r-1)}}$
leads to undefined behaviour:
$\phi = \sqrt{\frac{x^2}{0}}$
Cohen's w, $\sqrt{\sum_{i=1}^N \frac{(p_{0i} - p_{1i})^2}{p_{0i}}}$
This looks like $w = \sqrt{x^2}$, which implies it isn't standardized such that $0 \le w \le 1$. Other than that, I don't know much about it.
$E_{x^2}$ [1], $\frac{x^2q}{n(1-q)}$
This simply standardizes $x^2$ from the goodness-of-fit test against its maximum, ie:
$x^2 = n \sum_{i=1}^k \frac{p_i^2}{q_i} - 1$
where
- $k$ is the number of categories
- $n$ is the sample size
$p_i$ is the observed category proportion, I interpret this as:
$p_i = O_i / n$
where
- $O_i$ is the observed category frequency from the standard definition of $x^2$
$q_i$ is the expected category proportion, I interpret this as:
$q_i = E_i / n$
where
- $E_i$ is the expected category frequency from the standard definition of $x^2$
$x^2_{max} = n \left( \frac{1-q}{q} \right)$
$E_{x^2} = \frac{x^2}{x^2_{max}} = \frac{x^2q}{n(1-q)}$
Unfortunately, I can't reconcile the paper's definition of $x^2$ against the standard definition:
$x^2 = \sum_{i=1}^n \frac{(O_i - E_i)^2}{E_i} = N \sum_{i=1}^n q_i\frac{(p_i - q_i)^2}{q_i} = N \sum_{i=1}^n \frac{p_i^2}{q_i} - 2p_i + q_i$
In any case, I would assume that any definition of power would be tied to a particular measure of effect size.
[1] J. E. Johnston, Kenneth J Berry, Paul W Mielke. (2006) Measures of effect size for chi-squared and likelihood-ratio goodness-of-fit tests