Approximates the power of a hypothesis test of the Bailey estimator by means of many simulated draws from a specified alternative distribution, conditioned on sample sizes.
powBailey(
nullN,
trueN,
n1,
n2,
alpha = 0.05,
nsim = 10000,
alternative = "less"
)
The abundance given by the null hypothesis
The assumed abundance for the power calculation
Number of individuals captured and marked in the first sample
Number of individuals captured in the second sample
The alpha level for the test
Number of simulated values to draw. Defaults to 10000.
Direction of the alternative hypothesis. Allowed values
are "less"
, "greater"
, or "2-sided"
. Defaults to "less"
.
The approximate power of the specified hypothesis test, for the specified alternative value.
# NOT RUN {
powBailey(nullN=500, trueN=400, n1=100, n2=100, nsim=1000)
Ntotry <- seq(from=250, to=450, by=25)
pows <- sapply(Ntotry, function(x)
powBailey(nullN=500, trueN=x, n1=100, n2=100, nsim=1000))
plot(Ntotry, pows)
# }
Run the code above in your browser using DataLab