| predict.secr {secr} | R Documentation |
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.
## S3 method for class 'secr':
predict(object, newdata = NULL, se.fit = TRUE, alpha = 0.05,
savenew = FALSE, ...)
object |
secr object output from secr.fit |
newdata |
optional dataframe of values at which to evaluate model |
se.fit |
logical for whether output should include SE and confidence intervals |
alpha |
alpha level for confidence intervals |
savenew |
logical for whether newdata should be saved |
... |
other arguments |
The variables in the various linear predictors are described in secr models and listed for the particular model in the vars component of object.
Optional newdata should be a dataframe with a column for each of the variables in the model (see 'vars' component of object). If newdata is missing then a dataframe is constructed automatically. Default newdata are for a naive animal on the first occasion; numeric covariates are set to zero and factor covariates to their base (first) level.
Standard errors are by the delta method (Lebreton et al. 1992). Confidence intervals are backtransformed from the link scale.
The value of newdata is optionally saved as an attribute.
When 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
| link | link function |
| 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.
Murray Efford murray.efford@otago.ac.nz
Lebreton, J.-D., Burnham, K. P., Clobert, J., Anderson, D. R. (1992) Modeling survival and testing biological hypotheses using marked animals: a unified approach with case studies. Ecological Monographs 62, 67–118.
## 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
data(secrdemo)
predict (secrdemo.b, newdata = data.frame(b=0:1))
temp <- predict (secrdemo.b, newdata = data.frame(b=0:1),
save = TRUE)
attr(temp, 'newdata')