Evaluate a spatially explicit capture–recapture model. That is, compute the ‘real’ parameters corresponding to the ‘beta’ parameters of a fitted model for arbitrary levels of any variables in the linear predictor.
1 2 3 4 5 6 7 8 9 10
## S3 method for class 'secr' predict(object, newdata = NULL, realnames = NULL, type = c("response", "link"), se.fit = TRUE, alpha = 0.05, savenew = FALSE, ...) ## S3 method for class 'secrlist' predict(object, newdata = NULL, realnames = NULL, type = c("response", "link"), se.fit = TRUE, alpha = 0.05, savenew = FALSE, ...) ## S3 method for class 'secr' detectpar(object, ..., byclass = FALSE)
optional dataframe of values at which to evaluate model
character vector of real parameter names
character; type of prediction required. The default ("response") provides estimates of the ‘real’ parameters.
logical for whether output should include SE and confidence intervals
alpha level for confidence intervals
logical for whether newdata should be saved
other arguments passed to
logical; if TRUE values are returned for each latent class in a mixture model, or class in a hybrid mixture (hcov) model
The variables in the various linear predictors are described in
secr-models.pdf and listed for the particular model in the
vars component of
newdata should be a dataframe with a column for each of
the variables in the model (see ‘vars’ component of
newdata is missing then a dataframe is constructed automatically.
newdata are for a naive animal on the first occasion;
numeric covariates are set to zero and factor covariates to their base
(first) level. From secr 3.1.4 the argument ‘all.levels’ may be passed
newdata; if TRUE then the default newdata includes
all factor levels.
realnames may be used to select a subset of parameters.
Standard errors for parameters on the response (real) scale are by the delta method (Lebreton et al. 1992), and confidence intervals are backtransformed from the link scale.
The value of
newdata is optionally saved as an attribute.
detectpar is used to extract the detection parameter estimates
from a simple model to pass to functions such as
will be evaluated by default at base levels of the covariates, although
this may be overcome by passing a one-line
predict via the ... argument. Groups and mixtures are a
detectpar: it merely returns the estimated detection
parameters of the first group or mixture.
If the ‘a0’ parameterization has been used in
object$details$param == 3) then
backtransforms (a0, sigma) to (g0, sigma) or (lambda0, sigma) depending
on the value of
se.fit = FALSE, a dataframe identical to
newdata except for the addition of one column for each ‘real’ parameter. Otherwise, a list with one component for each row in
newdata. Each component is a dataframe with one row for each ‘real’ parameter (density, g0, sigma, b) and columns as below
|estimate||estimate of real parameter|
|SE.estimate||standard error of the estimate|
|lcl||lower 100(1--alpha)% confidence limit|
|ucl||upper 100(1--alpha)% confidence limit|
newdata has only one row, the structure of the list is
‘dissolved’ and the return value is one data frame.
detectpar, a list with the estimated values of detection
parameters (e.g., g0 and sigma if detectfn = "halfnormal"). In the case
of multi-session data the result is a list of lists (one list per
predictDsurface should be used for predicting density at many
points from a model with spatial variation. This deals automatically
with scaling of x- and y-coordinates, and is much is faster than
predict.secr. The resulting Dsurface object has its own plot method.
The argument ‘scaled’ was removed from both predict methods in version 2.10 as the scaleg0 and scalesigma features had been superceded by other parameterisations.
Lebreton, J.-D., Burnham, K. P., Clobert, J. and Anderson, D. R. (1992) Modeling survival and testing biological hypotheses using marked animals: a unified approach with case studies. Ecological Monographs 62, 67–118.
1 2 3 4 5 6 7 8 9 10 11 12 13
## load previously fitted secr model with trap response ## and extract estimates of `real' parameters for both ## naive (b = 0) and previously captured (b = 1) animals predict (secrdemo.b, newdata = data.frame(b = 0:1)) ## OR from secr 3.1.4 predict (secrdemo.b, all.levels = TRUE) temp <- predict (secrdemo.b, all.levels = TRUE, save = TRUE) attr(temp, "newdata") detectpar(secrdemo.0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.