Extract model estimates in a tidy format.Source:
This is a mostly internal function which could be useful to users who want
a unified approach to extract results from a wide variety of models. For
get_estimates attaches useful attributes to the output. You
can access this information by calling the
a single model object
numeric value between 0 and 1. confidence level to use for confidence intervals. Setting this argument to
NULLdoes not extract confidence intervals, which can be faster for some models.
robust standard errors and other manual statistics. The
vcovargument accepts six types of input (see the 'Details' and 'Examples' sections below):
NULL returns the default uncertainty estimates of the model object
string, vector, or (named) list of strings. "iid", "classical", and "constant" are aliases for
NULL, which returns the model's default uncertainty estimates. The strings "HC", "HC0", "HC1" (alias: "stata"), "HC2", "HC3" (alias: "robust"), "HC4", "HC4m", "HC5", "HAC", "NeweyWest", "Andrews", "panel-corrected", "outer-product", and "weave" use variance-covariance matrices computed using functions from the
sandwichpackage, or equivalent method. The behavior of those functions can (and sometimes must) be altered by passing arguments to
modelsummarythrough the ellipsis (
...), but it is safer to define your own custom functions as described in the next bullet.
function or (named) list of functions which return variance-covariance matrices with row and column names equal to the names of your coefficient estimates (e.g.,
function(x) vcovPC(x, cluster="country")).
formula or (named) list of formulas with the cluster variable(s) on the right-hand side (e.g., ~clusterid).
named list of
length(models)variance-covariance matrices with row and column names equal to the names of your coefficient estimates.
a named list of length(models) vectors with names equal to the names of your coefficient estimates. See 'Examples' section below. Warning: since this list of vectors can include arbitrary strings or numbers,
modelsummarycannot automatically calculate p values. The
starsargument may thus use incorrect significance thresholds when
vcovis a list of vectors.
formula which determines the shape of the table. The left side determines what appears on rows, and the right side determines what appears on columns. The formula can include a group identifier to display related terms together, which can be useful for models with multivariate outcomes or grouped coefficients (See examples section below). This identifier must be one of the column names produced by:
get_estimates(model). The group identifier can be combined with the term identifier in a single column by using the colon to represent an interaction. If an incomplete formula is supplied (e.g.,
modelsummarytries to complete it automatically. Potential
term + statistic ~ model: default
term ~ model + statistic: statistics in separate columns
model + statistic ~ term: models in rows and terms in columns
term + response + statistic ~ model: term and group id in separate columns
term : response + statistic ~ model: term and group id in a single column
term ~ response
all other arguments are passed through to three functions. See the documentation of these functions for lists of available arguments.