# Initially created using usethis::use_vignette("Chilkat_Harvest_2000")
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

There are several functions that provide useful calculations of CWT estimates and variances.
The core function cwtEst() takes parameters from the fishery and sample recovery as arguments. These are: N (number of fish harvested), n (number of fish inspected for marks), m (number of marked fish in the sample), theta (proportion of marked fish in the sample population), and lambda (a vector of 4 tag recovery numbers).
Note that the argument for N and theta can be either a single number (estimate only) or a vector of both the estimate and the variance.

Chilkat Coho Example

The following example uses actual estimates of coho salmon marked in the Chilkat River, with tag recovery occurring during the troll fishery in stat week 28 for the NW Quadrant.

Calculate Estimate & Summary

The function cwtEst() uses the fishery and tag recovery parameters as arguments. This allows for output of the estimates:

library(cwtr)
cwtEst(N=c(33666, NA), n=7618, lambda=c(138, 140, 116, 116), m=1, theta=c(0.01886, 102.15))


Next, we can use the summary method to obtain the SE, CV, and CI for our estimate:

x <- cwtEst(N=c(33666, NA), n=7618, lambda=c(138, 140, 116, 116), m=1, theta=c(0.01886, 102.15))
summary(x)


Bootstrap Intervals

Because these are data from a non-normal distribution, we know that at small estimates using Gaussian confidence intervals are likely to be incorrect and/or result in negative harvest, tags, etc.
For this reason, a bootstrap interval function is provided:

xBoot <- cwtBoot(x, method="parametric", nreps=10000)
xBoot


As with before, we can obtain the summary of the bootstrap intervals:

summary(xBoot)


Last, using the plot() function on a cwt object can provide plots of the bootstrap simulation.

plot(xBoot)




justinpriest/cwtr documentation built on April 22, 2022, 12:51 a.m.