as.modelsummary_list_custom: Create a custom 'modelsummary_list'

View source: R/modelsummary.R

as.modelsummary_list_customR Documentation

Create a custom modelsummary_list

Description

Create a customized modelsummary_list from a model object.

Usage

as.modelsummary_list_custom(x, ...)

## Default S3 method:
as.modelsummary_list_custom(x, ...)

## S3 method for class 'fixest'
as.modelsummary_list_custom(x, conf.int = TRUE, ...)

Arguments

x

A model object

...

Passed on to broom::tidy() and broom::tidy()

conf.int

Logical indicating whether or not to include a confidence interval in the tidied output. Defaults to TRUE.

Details

Motivation for this generic comes from the need to save fixest models. Saving models even with lean = TRUE can result in hard to serialize objects, as fixest stores calls and environments which are difficult to serialise.

A modelsummary_list object made with modelsummary(models, output = "modelsummary_list") does most of what we want, except for adding confindence intervals. modelsummary can add confidence intervals to tables but want to store it here, so that it is available for any other use, including plotting. Therefore we use broom::tidy() to obtain information on parameters. For the "glance" part we use broom::tidy() in the default method but we use data obtained from modelsummary's custom internal glance implementation, as it provides useful additions for fixest models (like adding fixed effects, which we also extend via modelsummary's customization interface, see glance_custom.fixest(), or proper information on the types of standard errors).

The drawback of this approach is that we can't use some modelsummary features, like reference categories and some computations are run twice. This shouldn't be a major issue for most models and the extra features can be easily replicated by modifying the modelsummary_list object.

Value

A modelsummary_list object, see modelsummary's Extension and Customization vignette.


svraka/asmisc documentation built on June 12, 2025, 12:04 p.m.