Learn R Programming

mra (version 2.3)

F.fit.table: F.fit.table - Produce a summary table of model fit statistics.

Description

Compiles a table of fit statistics from a list of MRA fitted objects contained in the .Globalenv (i.e., 'working') environment. The table produced by this routine contains model name and the choosen fit statistic (such as AIC or QAIC), and is sorted by that fit statistic.

Usage

F.fit.table( fits=ls(pat="^fit"), rank.by= "qaicc" )

Arguments

fits
A character vector of MRA fitted object names to include in the summary table. These names do not need to have a common root name. The default value will use any object whose name starts with "fit" in the working directory (.GlobalEnv).
rank.by
A string (scalar) naming the model fit statistic to include in the summary table. The resulting table is sorted by this statistic. 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 included in the table, but the model's fit statistics are set to Inf. 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. Fitted objects are pulled from the .GlobalEnv environment. Usually, this is the current working directory.

See Also

F.cjs.estim, F.huggins.estim

Examples

Run this code
## Fit several CJS model to dipper data. Summarize fits.

## 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 )

## Summary table
F.fit.table( ls(pat="^dipper") )

Run the code above in your browser using DataLab