| powconsistencytest {recapr} | R Documentation |
Power of Consistency Tests, Partial Stratification
Description
Conducts power calculations of the chi-squared tests for the consistency of the Petersen-type abundance estimator, in a partial stratification setting, such as by time or geographic area. In the case of partial stratification, individuals may move from one stratum to another between the first and second sampling events, and strata do not need to be the same between events.
Usage
powconsistencytest(n1, n2, pmat, alpha = 0.05, sim = TRUE, nsim = 10000)
Arguments
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. |
pmat |
Matrix of assumed movement probabilities between strata, with rows corresponding to first-event strata and columns corresponding to second-event strata, and an additional column corresponding to the probability of NOT being recaptured in the second event. Values will be standardized by row, that is, by first-event strata. See note on usage below. |
alpha |
Significance level for testing. Defaults to |
sim |
Whether to conduct power calculation by simulation as well as
Cohen's method. Defaults to |
nsim |
Number of simulations if |
Value
An object of class "recapr_consistencypow" with the following
components:
pwr1_cPower of the first test, according to Cohen's methodpwr1_simPower of the first test, from simulationntest1The sample size used for the first testp0test1The null-hypothesis probabilities for the first testp1test1The alt-hypothesis probabilities for the first testpwr2_cPower of the second test, according to Cohen's methodpwr2_simPower of the second test, from simulationntest2The sample size used for the second testp0test2The null-hypothesis probabilities for the second testp1test2The alt-hypothesis probabilities for the second testpwr3_cPower of the third test, according to Cohen's methodpwr3_simPower of the third test, from simulationntest3The sample size used for the third testp0test3The null-hypothesis probabilities for the third testp1test3The alt-hypothesis probabilities for the third testalphaThe significance level used
Note
The movement probability matrix specified in pmat is considered
conditional on each row, that is, first-event strata, with columns
corresponding to second-event strata and the final column specifying the
probability of not being recaptured in the second event. Values do not
need to sum to one for each row, but will be standardized by the function
to sum to one.
A pmat with a first row equal to (0.05, 0.1, 0.15, 0.7) would
imply a 5 percent chance that individuals captured in the first-event
strata 1 will be recaptured in second-event strata 1, and a 70 percent
chance that individuals captured in the first-event strata 1 will not be
recaptured in event 2.
Because of the row-wise scaling, specifying a row equal to (0.05,
0.1, 0.15, 0.7) would be equivalent to that row having values (1, 2, 3, 14).
Author(s)
Matt Tyers
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
Examples
mat <- matrix(c(4,3,2,1,10,3,4,3,2,10,2,3,4,3,10,1,2,3,4,10),
nrow=4, ncol=5, byrow=TRUE)
powconsistencytest(n1=c(50,50,50,50), n2=c(50,50,50,50), pmat=mat)
mat <- matrix(c(4,3,2,1,10,4,3,2,1,10,4,3,2,1,10,4,3,2,1,10),
nrow=4, ncol=5, byrow=TRUE)
powconsistencytest(n1=c(50,50,50,50), n2=c(50,50,50,50), pmat=mat)
mat <- matrix(c(1,1,1,1,10,2,2,2,2,10,3,3,3,3,10,4,4,4,4,10),
nrow=4, ncol=5, byrow=TRUE)
powconsistencytest(n1=c(50,50,50,50), n2=c(50,50,50,50), pmat=mat)
mat <- matrix(c(1,1,1,1,10,1,1,1,1,10,1,1,1,1,10,1,1,1,1,10),
nrow=4, ncol=5, byrow=TRUE)
powconsistencytest(n1=c(50,50,50,50), n2=c(20,30,40,50), pmat=mat)
mat <- matrix(c(1,1,1,1,5,1,1,1,1,8,1,1,1,1,10,1,1,1,1,15),
nrow=4, ncol=5, byrow=TRUE)
powconsistencytest(n1=c(50,50,50,50), n2=c(50,50,50,50), pmat=mat)