model-utils: Model utility functions

Model utilitiesR Documentation

Model utility functions


These functions extract or calculate various values from provided fitted model objects(s). They are mainly meant for internal use.

coeffs extracts model coefficients;

getAllTerms extracts independent variable names from a model object;

coefTable extracts a table of coefficients, standard errors and associated degrees of freedom when possible;

get.response extracts response variable from fitted model object;

model.names generates shorthand (alpha)numeric names for one or several fitted models.



getAllTerms(x, ...)
## S3 method for class 'terms'
getAllTerms(x, intercept = FALSE, offset = TRUE, ...)

coefTable(model, ...)
## S3 method for class 'averaging'
coefTable(model, full = FALSE, = TRUE, ...)
## S3 method for class 'lme'
coefTable(model, adjustSigma, ...)
## S3 method for class 'gee'
coefTable(model, ..., type = c("naive", "robust"))

get.response(x, data = NULL, ...)

model.names(object, ..., labels = NULL, use.letters = FALSE)



a fitted model object.


a fitted model object or a list of such objects.


a fitted model object or a formula.


should ‘offset’ terms be included?


should terms names include the intercept?


logical, apply to "averaging" objects. If full is TRUE, the full model-averaged coefficients are returned, and subset-averaged ones otherwise. If is TRUE, inflated standard errors are returned. See ‘Details’ in par.avg.


See summary.lme.


for GEE models, the type of covariance estimator to calculate returned standard errors on. Either "naive" or "robust" (‘sandwich’).


optionally, a character vector with names of all the terms, e.g. from a global model. model.names enumerates the model terms in order of their appearance in the list and in the models. Therefore changing the order of the models leads to different names. Providing labels prevents that.


in model.names, more fitted model objects. In coefTable arguments that are passed to appropriate vcov or summary method (e.g. dispersion parameter for glm may be used here). In get.response, if data is given, arguments to be passed to model.frame. In other functions may be silently ignored.


a data.frame, list or environment (or object coercible to a data.frame), containing the variables in x. Required only if x is a formula, otherwise it can be used to get the response variable for a different data set.


logical, whether letters should be used instead of numeric codes.


The functions coeffs, getAllTerms and coefTable provide interface between the model object and model.avg (and dredge). Custom methods can be written to provide support for additional classes of models.


coeffs's value is in most cases identical to that returned by coef, the only difference being it returns fixed effects' coefficients for mixed models, and the value is always a named numeric vector.

Use of tTable is deprecated in favour of coefTable.


Kamil Bartoń

MuMIn documentation built on March 18, 2022, 5:28 p.m.