Extract model estimates. A mostly internal function with some potential uses outside.

get_estimates(model, conf_level = 0.95, vcov = NULL, ...)

Arguments

model

a single model object

conf_level

confidence level to use for confidence intervals

vcov

robust standard errors and other manual statistics. The vcov argument 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. Omitting or specifying vcov = NULL will return the model's default uncertainty estimates, e.g. IID errors for standard models. Alternatively, use the string "iid" (aliases: "classical" or "constant") to present IID errors explicitly. 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 sandwich package, or equivalent method. The behavior of those functions can (and sometimes must) be altered by passing arguments to sandwich directly from modelsummary through 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., stats::vcov, sandwich::vcovHC, 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, modelsummary cannot automatically calculate p values. The stars argument may thus use incorrect significance thresholds when vcov is a list of vectors.

...

all other arguments are passed through to the extractor and table-making functions. This allows users to pass arguments directly to modelsummary in order to affect the behavior of other functions behind the scenes. Examples include:

  • broom::tidy(exponentiate=TRUE) to exponentiate logistic regression. Please see the modelsummary vignette on the package website for important technical notes on this topic.

  • performance::model_performance(metrics="RMSE") to select goodness-of-fit statistics to extract using the performance package (must have set options(modelsummary_get="easystats") first).