LP_IS_fit {Petersen} | R Documentation |
Fit a Lincoln-Petersen Model with incomplete stratification
Description
In some LP studies, stratification is only done on a random sample of unmarked fish, e.g., only a sample of fish is sexed. Is is known as incomplete stratification. This is a wrapper to the published code for the case of stratification by a discrete covariate. At the moment, no other covariates are allowed, but see the published code.
Usage
LP_IS_fit(
data,
p_model,
theta_model = ~-1 + ..time,
lambda_model = ~-1 + ..cat,
logit_p_offset = 0,
logit_theta_offset = 0,
logit_lambda_offset = 0,
cat.unknown = "U",
p_beta.start = NULL,
trace = FALSE,
control.optim = list(trace = 0, maxit = 1000)
)
Arguments
data |
Data frame containing the variables:
plus any other covariates (e.g. discrete strata and/or continuous covariates) to be used in the model fitting. At the moment, you are not allowed to use these covariates to used in the modeling process, but see the published code for more details. |
p_model |
Model for the captured probabilities. This can reference
other variables in the data frame, plus a special reserved term For some models (e.g., tag loss models), the |
theta_model |
Model for theta (sampling fraction). Usually, this is set to be different for the two sampling occasions, but you can constrain this to have equal sampling fractions at both occasions. |
lambda_model |
Model for lambda category proportions. Usually this is set to different for the categories
but you can constrain this with a null matrix and the |
logit_p_offset |
Used to fix capture probabilities at known values (seldom useful). Logit(p)=p_design %*% beta_p + logit_p_offset. |
logit_theta_offset |
Used to fix sampling fractions at known values (seldom useful). logit(theta) = theta_design %*% beta_theta + logit_theta_offset |
logit_lambda_offset |
Used to fix the sex ratio as a known value (e.g. .50) using logit(lambda) = lambda_design %*% beta_lambda + logit_lambda_offset. Set the design matrix to a matrix with all zeros. Notice that because the lambda proportions must sum to 1, only specify an offset matrix that is number of categories -1. |
cat.unknown |
Value of character used to indicate the unknown stratum in the capture histories. Currently, this is fixed to "U" regardless of what is specified. |
p_beta.start |
Initial values for call to optimization routine for the beta parameters (on the logit scale). The values will be replicated to match the number of initial beta parameters needed. Some care is needed here! |
trace |
If trace flag is set in call when estimating functions |
control.optim |
Control values passed to optim() optimizer. |
Details
The frequency variable (freq
in the data
argument) is the number of animals with the corresponding capture history.
Capture histories (cap_hist
in the data
argument) are character values of length 2.
The strata values are single character values with "U" typically representing a fish not measured
for the stratification variable. For example, consider the case where only a sample of unmarked fish
are examined for sex (M or F). Possible capture histories are:
-
M0 Animals tagged and sexed as male but never seen again.
-
MM Animals tagged and sexed as male and recaptured and tag present at event 2.
-
0M Animals captured at event 2 that appears to be untagged and was sexed as male.
-
F0 Animals tagged and sexed as female but never seen again.
-
FF Animals tagged and sexed as female and recaptured and tag present at event 2.
-
0F Animals captured at event 2 that appears to be untagged and was sexed as female.
-
U0 Animals tagged and not sexed but never seen again.
-
UU Animals tagged and not sexed and recaptured and tag present at event 2.
-
0U Animals captured at event 2 that appears to be untagged and was not sexed.
Capture histories such as UF or UM are not allowed since only UNTAGGED animals are examined and sexed. Similarly, capture histories such as FM or MF are not allowed.
Value
An list object of class LP_IS_fit with abundance estimates and other information with the following elements
-
summary A data frame with the model for the capture probabilities, the sampling fractions at each capture occasion, and the category proportions; the conditional log-likelihood; the number of parameters; the number of parameters, and method used to fit the model
-
data A data frame with the raw data used in the fit
-
fit Results of the fit including the estimates, SE, vcov, etc.
-
fit.call Arguments used in the fit
-
datetime Date and time the fit was done
Author(s)
Schwarz, C. J. cschwarz.stat.sfu.ca@gmail.com.
References
Premarathna, W.A.L., Schwarz, C.J., Jones, T.S. (2018) Partial stratification in two-sample capture–recapture experiments. Environmetrics, 29:e2498. doi:10.1002/env.2498
Examples
data(data_wae_is_short)
fit <- Petersen::LP_IS_fit(data=data_wae_is_short, p_model=~..time)
fit$summary
est <- LP_IS_est(fit, N_hat=~1)
est$summary