F.cr.model.avg {mra} | R Documentation |
F.cr.model.avg - Model averaging of mark-recapture parameters.
Description
Computes model averaged estimates of survival, capture probability, or population size estimates from a set of previously fitted MRA objects.
Usage
F.cr.model.avg( fits=ls(pattern="^fit"), what="survival", fit.stat="qaicc" )
Arguments
fits |
A character vector of MRA fitted object names. Each will be retrieved from the global environment
(i.e., .GlobalEnv) using |
what |
A text string naming the parameter to average. Choices are "survival" (the default), "capture", and "n.hat". Only the first character is inspected (e.g., "c" is equivalent to "capture"). |
fit.stat |
A string (scalar) naming the model fit statistic to use when computing model weights. Possible values are: "qaicc" (the default), "qaic", "aicc", and "aic". |
Details
Each model is checked for convergence prior to including in the model averaging process.
The test for whether a model converged is
(fit$exit.code == 1) & (fit$cov.code == 0) & (fit$df > 0)
, where fit
is
the fitted object. If the model did not converge,
it is excluded from model averaging.
Conditional and unconditional variance estimates are computed following Burnham and Anderson 2002 (pages 150 and 162 and surrounding).
If what
= "n.hat", the returned object is suitable for printing using print.nhat
and plotting using plot.cjs
.
If what
= "survival" or "capture", the returned object is unclassed and the user is responsible for printing and plotting.
Value
If what
= "survival" or "capture", the return is a list object containing the following components:
fit.table |
A data frame, sorted by |
s.hat or p.hat |
A matrix of size |
se.s.hat or se.p.hat |
A matrix of size |
se.s.hat.conditional or se.p.hat.conditional |
A matrix of size |
mod.selection.proportion |
A matrix of size |
If what
= "n.hat", the return is a list of class "n.hat" containing the following components:
fit.table |
A data frame, sorted by |
n.hat |
A vector of length |
se.n.hat |
A vector of length |
se.n.hat.conditional |
A vector of length |
mod.selection.proportion |
A vector of length |
n.hat.lower |
A vector of length |
n.hat.upper |
A vector of length |
nhat.v.meth |
Scalar indicating the type of variance estimate used. Values are: |
Author(s)
Original routine by Eric Regehr, US Fish and Wildlife. Modified for MRA by Trent McDonald, WEST-INC, tmcdonald@west-inc.com
References
Burnham, K. and D. Anderson (2002) "Model Selection: A practical guide". Cambridge University Press.
See Also
F.cjs.estim
, F.huggins.estim
, F.fit.table
,
plot.cjs
Examples
## Fit several CJS model to dipper data. Model average survival
## Time varying survival and capture (true CJS model)
data(dipper.histories)
ct <- as.factor( paste("T",1:ncol(dipper.histories), sep=""))
attr(ct,"nan")<-nrow(dipper.histories)
dipper.01 <- F.cjs.estim( ~tvar(ct,drop=c(1,2)), ~tvar(ct,drop=c(1,6,7)), dipper.histories )
## Linear trend in survival
cT <- 1:ncol(dipper.histories)
dipper.02 <- F.cjs.estim( ~tvar(ct,drop=c(1,2)), ~tvar(cT, nan=nrow(dipper.histories)),
dipper.histories )
## No trend in survival
dipper.03 <- F.cjs.estim( ~tvar(ct,drop=c(1,2)), ~1, dipper.histories )
## Model average
mod.avg.surv <- F.cr.model.avg( ls(pat="^dipper.[0-9]"), what="s", fit.stat="aicc" )
mod.avg.n <- F.cr.model.avg( ls(pat="^dipper.[0-9]"), what="n", fit.stat="aicc" )
## Plot
plot(mod.avg.n)