Estimate trap rate
mm_traprate_estimate.RdComputes the estimated trap rate and uncertainty using bootstrapping, with optional support for stratified estimation based on area-weighted averaging.
Arguments
- data
A data frame as returned by
mm_traprate_data()with columnsnandeffort.- strata
Optional. A data frame defining strata, with columns
stratumIDandarea.- n_bootstrap
Number of bootstrap replicates to estimate uncertainty. Default is 1000.
Value
A data frame with the following columns:
estimate: Trap rate estimate (e.g., detections per day)se: Standard error of the estimatecv: Coefficient of variationlower_ci: Lower bound of the 95\upper_ci: Upper bound of the 95\n: Number of deployments or observation usedunit: Effort unit
Examples
data("camtrapdp")
deployments <- camtrapdp$data$deployments
observations <- camtrapdp$data$observations %>%
dplyr::filter(scientificName == "Vulpes vulpes")
trap_rate <- mm_traprate_data(observation_data = observations,
deployment_data = deployments,
use_deployment = FALSE,
deployment_column = deploymentID,
datetime_column = timestamp,
start = start, end = 'end'
)
mm_traprate_estimate(data = trap_rate, n_bootstrap = 1000)
#> estimate se cv lower_ci upper_ci n unit
#> trap_rate 0.6206041 0.1829947 0.2948655 0.2985075 1.020408 3 n/days