recapr (version 0.4.3)

powstrattest: Power of Consistency Tests, Complete Stratification

Description

Conducts power calculations of the chi-squared tests for the consistency of the Petersen-type abundance estimator, in a complete stratification setting.

Usage

powstrattest(N, n1, n2, alpha = 0.05, sim = TRUE, nsim = 1e+05)

Arguments

N

Vector of total abundance, with each element corresponding to one stratum.

n1

Vector of anticipated n1 counts (sample size in the first event), each element corresponding to one stratum.

n2

Vector of anticipated n2 counts (sample size in the second event), each element corresponding to one stratum.

alpha

Significance level for testing. Defaults to 0.05

sim

Whether to conduct power calculation by simulation as well as Cohen's method. Defaults to TRUE.

nsim

Number of simulations if sim is TRUE. Defaults to 100000.

Value

A list of three elements, each with class "recapr_stratpow" with the following components:

  • prob A vector of capture probabilities corresponding to the alternative hypothesis investigated

  • prob_null A vector of capture probabilities corresponding to the null hypothesis (all probabilities equal)

  • n The sample size used for the test

  • alpha The significance level used for testing

  • power The test power, calculated by Cohen's method

  • power_sim The test power, calculated via simulation

References

Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.

Code adapted from the 'pwr' package: Stephane Champely (2015). pwr: Basic Functions for Power Analysis. R package version 1.1-3. https://CRAN.R-project.org/package=pwr

See Also

strattest, Nstrat

Examples

Run this code
# NOT RUN {
powstrattest(N=c(10000,20000), n1=c(1000,2000), n2=c(200,200))
# }

Run the code above in your browser using DataLab