Learn R Programming

mra (version 2.3)

F.cr.model.avg: F.cr.model.avg - Model averaging of mark-recapture parameters.

Description

Computes model averaged estimates of survival, capture probability, population size estimates, or beta coefficients from a set of previously fitted MRA objects.

Usage

F.cr.model.avg( fits=ls(pat="^fit"), what="survival", fit.stat="qaicc" )

Arguments

fits
A character vector of MRA fitted object names to include in the model averaged estimates. The default value will use any object whose name starts with "fit" in the working directory (.GlobalEnv). An an example, if fitted objects are named
what
A text string naming the parameter of model fits to average. Choices are "survival" (the default), "capture", "n.hat", and "beta". 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), and "aicc".

Value

  • A data frame, sorted by fit.stat.to.use, with the following columns
  • model.numModel number assigned by this routine, equal to the position of the model in the input list of fits.
  • model.nameName of the fitted object.
  • convergedLogical values indicating whether this routine thinks the model converged or not. Value is TRUE if the this routine thinks the model converged, FALSE otherwise.
  • n.est.parametersNumber of estimable parameters in the model. This is MRA's guess at the number of estimable parameters in the model, not length of the coefficient vector.
  • n.coefficientsNumber of coefficients in the model. This is length of the coefficient vector without regard to estimability. If n.coefficients > n.est.parameters, the model is not full rank, and at least one coefficient is probably not estimable.
  • aiccAIC of the model including the small sample correction = AIC + (2*df*(df+1)) / (nan - df - 1)
  • delta.aiccDifference between AICc for the model and the minimum AICc in the table.
  • aicc.wgtAICc model weights. These weights equal exp(-.5*(delta.aicc)), scaled to sum to 1.0,
  • qaiccQAIC of the model including the small sample correction = QAIC + (2*df*(df+1))/(nan - df - 1)
  • delta.qaiccDifference between QAICc for the model and the minimum QAICc in the table.
  • qaicc.wgtQAICc model weights. These weights equal exp(-.5*(delta.qaicc)), scaled to sum to 1.0,

Details

A rudimentary check for convergence is done on each fitted model. If the routine determines that a model did not converge, the model is excluded from the model averaged estimates. 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. Conditional and unconditional variance estimates are computed following Burnham and Anderson 2002 (pages 150 and 162 and surrounding). The returned object is suitable for plotting using plot.cr.

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"), what="s", fit.stat="aicc" )

## Plot
plot.cjs( mod.avg.surv )

Run the code above in your browser using DataLab