Skip to contents

est_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).

Usage

est_compliance(ld, min_length, conf_level = NULL)

Arguments

ld

A creel_length_distribution object from est_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 (usually 0.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.

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