The main idea in this function is to compute all possible data
outcomes and then compute the p-value for the chosen significance test
for each of these outcomes. This gives the exact distribution of
p-values from which the exact power can be computed. This is basically
what happens if tol = 0
.
There is, however, a problem with this approach if size
is
large, since the the number of possible outcomes increases very fast
with the size
; the order is O(n^2
). The solution to this
problem is to ignore those outcomes which will occur with very small
probability. Often, a large proportion of the outcomes, say 90% will
occur so rarely that they account for, say 1e-4
percent of the
probability mass; it is therefore safe to ignore those outcomes
without compromising the accuracy of the computed power by any
relevant amount. For more information see the referenced paper and the
package vignette Statistical Methodology.
The Wald statistic is not available here. The reason is that the Wald
statistic is not always defined and the problem is therefore what to
do with those cases where it is not defined?
On the other hand the likelihood root statistic
is defined in all cases, so theres is no problem here, and since the
likelihood root statistic is more accurate than the Wald statistic,
there is not much reason to use the Wald statistic after all.
For the record; the Wald statistic is not defined, when the standard
error of d-prime is not defined. This happens when the
variance-covariance matrix of tau and d-prime is not defined, which
occurs in a number of boundary cases, i.e., when one or more cells
contain zero frequencies. Since these outcomes occur with positive
probability, the algorithm used by twoACpwr
will always
encounter those cases and have to deal with them. This would be
cumbersome to implement.