powconsistencytest: Power of Consistency Tests, Partial Stratification

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/consistency.R

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

1
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 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 10000.

Value

An object of class "recapr_consistencypow" with the following components:

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

consistencytest, NDarroch

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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)

mbtyers/recapr documentation built on Sept. 13, 2021, 11:54 a.m.