
Estimate design-weighted size-limit compliance from a creel length distribution
Source:R/creel-estimates-length.R
est_compliance.Rdest_compliance() estimates the proportion of fish meeting a minimum size
limit from a est_length_distribution() object. Fish in bins whose lower
bound is at or above min_length are classified as legal (conservative:
bins straddling the limit are classified as illegal).
Arguments
- ld
A
creel_length_distributionobject fromest_length_distribution().- min_length
Positive numeric minimum legal length in the same units as the lengths used to build
ld.- conf_level
Numeric confidence level for confidence intervals. Defaults to the level stored in
ld(usually0.95).
Value
A data.frame with class c("creel_compliance", "data.frame") and
columns: grouping columns (if any), min_length, n_legal_est,
n_total_est, compliance_prop, compliance_se,
compliance_ci_lower, compliance_ci_upper. Rows where the total
estimated fish is zero or negative return NA for all numeric columns
with a warning.
Details
A bin is legal when bin_lower >= min_length. The compliance proportion
and its variance use the ratio estimator:
$$P = \frac{\sum_h I_h \hat{N}_h}{\hat{N}}$$
$$\widehat{\text{Var}}(P) =
\frac{1}{\hat{N}^2} w' \Sigma w, \quad w_h = I_h - P$$
where \(I_h = \mathbf{1}(\text{bin\_lower}_h \geq \text{min\_length})\)
and \(\Sigma\) is the bins' full covariance matrix, carried from the
single svytotal() that estimated them.
Earlier versions used \(\sum_h w_h^2 \widehat{\text{SE}}_h^2\) — the same
expression with every off-diagonal set to zero. The bins partition the same
fish and are rescaled onto one reported total, so they are strongly
dependent, and on the package's own example data that form reported a
standard error 32% below an independently computed
survey::svyratio() reference. If \(\Sigma\) is unavailable the
independence form is used and a warning says so.
Confidence interval bounds are clamped to \([0, 1]\).
Choose bin_width in est_length_distribution() smaller than the typical
variation near the legal limit to minimise classification error for bins
that straddle the threshold.
See also
Other "Estimation":
compare_cpue_estimators(),
est_age_distribution(),
est_biomass(),
est_effort_camera_mi(),
est_length_distribution(),
est_mean_age(),
est_mean_length(),
estimate_catch_rate(),
estimate_effort(),
estimate_effort_aerial_glmm(),
estimate_harvest_rate(),
estimate_release_rate(),
estimate_total_catch(),
estimate_total_harvest(),
estimate_total_release()
Examples
data(example_calendar)
data(example_interviews)
data(example_lengths)
data(example_catch)
design <- creel_design(example_calendar, date = date, strata = day_type)
design <- add_interviews(design, example_interviews,
catch = catch_total, effort = hours_fished, harvest = catch_kept,
trip_status = trip_status
)
#> Warning: ! No `n_anglers` provided — assuming 1 angler per interview.
#> ℹ Pass `n_anglers = <column>` to use actual party sizes for angler-hour
#> normalization.
#> ℹ If the interviews really are one angler each, pass `n_anglers = 1` to state
#> that and silence this warning.
#> ℹ Added 22 interviews: 17 complete (77%), 5 incomplete (23%)
# Species catch is required to group by species: the totals are scaled onto
# the reported catch, and only this table records it per species.
design <- add_catch(design, example_catch,
catch_uid = interview_id,
interview_uid = interview_id,
species = species,
count = count,
catch_type = catch_type
)
design <- add_lengths(design, example_lengths,
length_uid = interview_id,
interview_uid = interview_id,
species = species,
length = length,
length_type = length_type,
count = count,
release_format = "binned"
)
ld <- est_length_distribution(design, by = species, bin_width = 25)
#> Warning: ! Length totals were rescaled onto the reported catch.
#> ℹ Measured fish (weighted): 37; reported: 93 -- a factor of 2.51.
#> ℹ estimate, se and the confidence bounds describe the REPORTED catch, estimated
#> from the measured subsample. Shares (percent) are unaffected.
est_compliance(ld, min_length = 356) # 14-inch limit in mm
#> species min_length n_legal_est n_total_est compliance_prop compliance_se
#> 1 bass 356 0 25 0 0
#> 2 panfish 356 0 13 0 0
#> 3 walleye 356 55 55 1 0
#> compliance_ci_lower compliance_ci_upper
#> 1 0 0
#> 2 0 0
#> 3 1 1