F.fit.table {mra} | R Documentation |
F.fit.table - Produce a summary table of model fit statistics.
Description
A utility function to compile 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, fit statistics (AICc or QAICc), and is ranked by (sorted by) one of these fit statistics.
Usage
F.fit.table( fits=ls(pattern="^fit"), rank.by= "qaicc", plausible.p=0.01 )
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).
An an example, if fitted objects are named
"fit1.01", "fit1.02", and "fit1.03", |
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". |
plausible.p |
A scalar specifying the cut-point in |
Details
A rudimentary check for convergence is done on each fitted model. If this routine believes
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. Currently, there is no way to pull fits from another environment, but
a savvy R programmer could modify the where
argument of the get
command embedded in
this routine.
Value
A data frame, sorted by rank.by
, with the following columns
model.num |
Model number assigned by this routine, equal to the position of the model in the input list of fits. |
model.name |
Name of the fitted object. |
converged |
Logical 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.parameters |
Number 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.coefficients |
Number of coefficients in the model. This is length of the coefficient
vector without regard to number of estimable parameters. If |
loglike |
value of the log likelihood evaluated at the maximum likelihood parameters. |
aicc |
AIC of the model including the small sample correction =
AIC + (2* |
delta.aicc |
Difference between AICc for the model and the minimum AICc in the table. |
aicc.wgt |
AICc model weights. These weights equal exp(-.5*(delta.aicc)), scaled to sum to 1.0, |
qaicc |
QAIC of the model including the small sample correction =
QAIC + (2* |
delta.qaicc |
Difference between QAICc for the model and the minimum QAICc in the table. |
qaicc.wgt |
QAICc model weights. These weights equal exp(-.5*(delta.qaicc)), scaled to sum to 1.0, |
plausible |
Indicates ‘plausible’ models as defined by Bromaghin et al. (2013). The value
in this column is TRUE if the model has |
Author(s)
Trent McDonald, WEST-INC, tmcdonald@west-inc.com
References
Bromaghin, J.F., McDonald, T. L., and Amstrup, S. C., (2013) "Plausible Combinations: An improved methods to evaluate the covariate structure of Cormack-Jolly-Seber mark-recapture models", Open Journal of Ecology, v.3, p. 11-22. (included in vignettes)
See Also
F.cjs.estim
, F.huggins.estim
, vignette("Bromaghin_etal_2013_OJE")
Examples
## 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)
dipr.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)
dipr.02 <- F.cjs.estim( ~tvar(ct,drop=c(1,2)), ~tvar(cT, nan=nrow(dipper.histories)),
dipper.histories )
## No trend in survival
dipr.03 <- F.cjs.estim( ~tvar(ct,drop=c(1,2)), ~1, dipper.histories )
## Summary table
F.fit.table( ls(pat="^dipr") )