Learn R Programming

recapr

Estimating, Testing, and Simulating Abundance in a Mark-Recapture Experiment

Tools are provided for estimating, testing, and simulating abundance in a two-event (Petersen) mark-recapture experiment. Functions are given to calculate the Petersen, Chapman, and Bailey estimators and associated variances. However, the principal utility is a set of functions to simulate random draws from these estimators, and use these to conduct hypothesis tests and power calculations. Additionally, a set of functions are provided for generating confidence intervals via bootstrapping. Functions are also provided to test abundance estimator consistency under complete or partial stratification, and to calculate stratified or Darroch estimators. Functions are also provided to calculate recommended sample sizes.

Commonly-used functions

  • NChapman(), NPetersen(), and NBailey() calculate the values of Chapman, Petersen, or Bailey abundance estimates, given values of sample sizes and number of recaptures

  • vChapman(), vPetersen(), and vBailey() calculate the estimated variance of Chapman, Petersen, or Bailey abundance estimates, given values of sample sizes and number of recaptures, and seChapman(), sePetersen(), and seBailey() give standard errors

  • rChapman(), rPetersen(), and rBailey() return vectors of random draws from the Chapman, Petersen, or Bailey abundance estimates, given values of true abundance and sample sizes

  • pChapman(), pPetersen(), and pBailey() use many random draws to calculate approximate p-values for hypothesis testing

  • powChapman(), powPetersen(), and powBailey() use simulation to calculate hypothesis testing power, given alternative abundance

  • ciChapman(), ciPetersen(), and ciBailey() calculate confidence intervals for abundance using bootstrapping and/or normal approximation

  • plotdiscdensity() produces an empirical pmf plot of a vector of discrete values, such as that returned from an abundance estimate simulation, that is more appropriate than a traditional kernel density plot and perhaps more illustrative than a histogram

  • consistencytest() and strattest() provide the typical chi-squared tests for the consistency of a Petersen-type estimator, and provide evidence of the necessity of a stratified or partially stratified (Darroch-type) estimator

  • powconsistencytest() and powstrattest() provide power estimates for the tests reported in consistencytest() and strattest()

  • Nstrat(), vstrat(), sestrat() and cistrat() provide estimation if a completely stratified estimator is used

  • NDarroch() provides estimation if a spatially or temporally stratified estimator is used, or if strata differs between sampling events

  • n2RR() provides recommended sample size using Robson-Regier, and plotn2sim() and plotn1n2simmatrix() provide graphical explorations of recommended sample sizes via simulation

Installation

The 'recapr' package is currently available on Github, and can be installed in R with the following code:

install.packages("devtools",dependencies=T")

devtools::install_github("mbtyers/recapr")

Issues

This package has no known issues.

Copy Link

Version

Install

install.packages('recapr')

Monthly Downloads

219

Version

0.4.4

License

GPL-2

Maintainer

Matt Tyers

Last Published

September 8th, 2021

Functions in recapr (0.4.4)

ciBailey

Confidence Intervals for the Bailey Estimator
NChapman

Chapman Estimator
NDarroch

Spatially or Temporally Stratified Abundance Est (Darroch)
ciPetersen

Confidence Intervals for the Petersen Estimator
ciChapman

Confidence Intervals for the Chapman Estimator
NBailey

Bailey Estimator
Nstrat

Stratified Abundance Estimator
cistrat

Confidence Intervals for the Stratified Estimator
consistencytest

Consistency Tests for the Abundance Estimator, Partial Stratification
n2RR

Mark-Recapture Sample Size, Robson-Regier
pBailey

Hypothesis Testing Using the Bailey Estimator
pChapman

Hypothesis Testing Using the Chapman Estimator
rChapman

Random Draws from the Chapman Estimator
powBailey

Power for Hypothesis Testing Using the Bailey Estimator
plotn2sim

Mark-Recapture Sample Size Via Simulation
rBailey

Random Draws from the Bailey Estimator
print.recapr_stratpow

Print method for stratification test power
print.recapr_strattest

Print method for stratification test
powPetersen

Power for Hypothesis Testing Using the Petersen Estimator
print.recapr_consistencypow

Print method for consistency test power
powChapman

Power for Hypothesis Testing Using the Chapman Estimator
pPetersen

Hypothesis Testing Using the Petersen Estimator
strattest

Consistency Tests for the Abundance Estimator, Complete Stratification
sestrat

Standard Error of Stratified Abundance Estimator
rstrat

Random Draws from the Stratified Estimator
seBailey

Standard Error of the Bailey Estimator
vChapman

Estimated Variance of the Chapman Estimator
vBailey

Estimated Variance of the Bailey Estimator
print.recapr_consistencytest

Print method for consistency test
powconsistencytest

Power of Consistency Tests, Partial Stratification
seChapman

Standard Error of the Chapman Estimator
plotdiscdensity

Plotting the Density of a Vector of Discrete Values
sePetersen

Standard Error of the Petersen Estimator
plotn1n2simmatrix

Mark-Recapture Sample Size Via Sim, Both Samples
powstrattest

Power of Consistency Tests, Complete Stratification
recapr-package

Estimating, Testing, and Simulating Abundance in a Mark-Recapture Experiment
vPetersen

Estimated Variance of the Petersen Estimator
rPetersen

Random Draws from the Petersen Estimator
vstrat

Estimated Variance of Stratified Abundance Estimator
NPetersen

Petersen Estimator