Learn R Programming

mra (version 2.1)

F.cr.model.avg: 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 get and tested to make sure they are MRA fitted objects. If not, a warning is issued and the object is ign
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".

Value

  • If what = "survival" or "capture", the return is a list object containing the following components:
  • fit.tableA data frame, sorted by fit.stat, containing model names, fit statistics, delta fit statistics, and model averaging weights.
  • s.hat or p.hatA matrix of size nan X ns containing model averaged estimates of survival or capture probability.
  • se.s.hat or se.p.hatA matrix of size nan X ns containing the unconditional (on model selection) estimate of standard error for the corresponding model averaged statistic in s.hat or p.hat. Unconditional variances are computed using formulas in Burnham and Anderson (2002, pages 150 and 162)
  • se.s.hat.conditional or se.p.hat.conditionalA matrix of size nan X ns containing the conditional estimate of standard error for the corresponding model averaged statistic in s.hat or p.hat. These estimates of variance are conditional on model selection.
  • mod.selection.proportionA matrix of size nan X ns containing the proportion of variance due to model selection uncertainty. Values in this matrix are simply the difference between unconditional variance and conditional variance, divided by the unconditional variance.
  • If what = "n.hat", the return is a list of class "n.hat" containing the following components:
  • fit.tableA data frame, sorted by fit.stat, containing model names, fit statistics, delta fit statistics, and model averaging weights.
  • n.hatA vector of length ns containing model averaged estimates of population size.
  • se.n.hatA vector of length ns containing the unconditional (on model selection) estimate of standard error for the corresponding model averaged population size.
  • se.n.hat.conditionalA vector of length ns containing the conditional estimate of standard error for the corresponding model averaged population size.
  • mod.selection.proportionA vector of lengthns containing the proportion of variance due to model selection uncertainty. Values in this matrix are simply the difference between unconditional variance and conditional variance, divided by the unconditional variance.
  • n.hat.lowerA vector of length ns containing lower 95% confidence limits for the corresponding population size estimate.
  • n.hat.upperA vector of length ns containing upper 95% confidence limits for the corresponding population size estimate.
  • nhat.v.methScalar indicating the type of variance estimate used. Values are: 4 = "(Model averaged Huggins variance)", 5 = "(Model averaged Huggins variance + higher terms)", or 6 = "(Model averaged McDonald and Amstrup)". See help for F.cjs.estim for more explanation.

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.

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

Run this code
## 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"), what="n", fit.stat="aicc" )

## Plot
plot(mod.avg.n)

Run the code above in your browser using DataLab