shape
argument accepts interactions with the colon “:”
character. This combines two columns into one, which can be useful to
display terms and group names in a single column.parallel::mclapply
. See
?modelsummary
modelsummary
no longer computes confidence intervals
when not necessary, which can save some time. Also see:
conf_level=NULL
This first major release accompanies the publication of an article in the Journal of Statistical Software:
Arel-Bundock, Vincent (2022). “modelsummary: Data and Model Summaries in R.” Journal of Statistical Software, 103(1), 1-23. doi:10.18637/jss.v103.i01 https://doi.org/10.18637/jss.v103.i01.’
If you like modelsummary
, please cite the JSS article
and tell your friends about it.
Minor changes:
gof_map="all"
includes all available statistics.
gof_map="none"
excludes all statistics.diagnostic=NULL
and test=NULL
by default for
speed.Breaking changes:
modelsummary_wide
is no longer available. Use the
shape
argument of modelsummary
instead.modelsummary
now uses the easystats
packages (performance
and parameters
) to
extract estimates and goodness-of-fit statistics instead of
broom
. This can be reverted by setting a global option:
options(modelsummary_get="broom")
. This change aims to (1)
increase consistency across models, (2) improve the developers’ ability
to push bug fixes upstream when necessary, and (3) improve support for
mixed effects, bayesian, and GAM models. The two main drawbacks are: (a)
The set of printed statistics may be slightly different from previous
versions of modelsummary
(b) The group identifiers used in
the shape
formula will also be different for certain models
(e.g., in nnet::multinom
, y.level
becomes
response
).New features:
shape
argument accepts a formula and can reshape
information in myriad ways. Deprecates the group
argument.
Examples:
~ statistic
: statistics are shown horizontally in
distinct columns.model ~ term
: models in rows and terms in columns.term + y.level + statistic ~ model
: grouped
coefficients for multivariate outcome in
nnet::multinom
y.level ~ model
: partial match is the same as the
previous formulafmt
:
modelsummary(mod, fmt = list(estimate = 2, std.error = 1, rmse = 4))
glue
to apply functions to numeric values by
setting fmt = NULL
. Example:
modelsummary(model, fmt = NULL, estimate = "{log(estimate)}")
Bug fixes:
group_map
rename issuelm
models.datasummary_skim
output to jpg should now worksescape
fixesexponentiate
argument for
modelsummary()
and modelplot()
gof_map
accepts a vector such as
c("rmse", "nobs", "r.squared")
rlang
dependencydatasummary_balance
:
~ 1
as a formula to summarize all data.Misc:
lm
modelsummary
:
vcov
strings like HC1
and
Robust
are now case-insensitivegof_map
now accepts a data.frame or tibble with a
fmt
list-column which includes functions (see Examples in
docs)R2
is no longer computed by default for bayesian and
mixed effects models. An informative one-time warning is printed about
the metrics
argument.datasummary_skim
:
kableExtra
factory:
col.names
argument can now be passed to
kableExtra::kbl
through the … ellipsis.Misc:
output = "github_document"
is now supportedmodelsummary
:
vcov
argumentdatasummary_balance
:
Misc:
modelsummary
:
vcov
argument handling for fixest
models (#357 by @grantmcdermott)fixest::i()
variables and interactions
(#361 by @grantmcdermott)datasummary_correlation
:
add_rows
and add_columns
arguments are now
available here.Misc:
modelsummary_factory_default
,
modelsummary_factory_html
, etc.intersect
Bug fixes:
datasummary_balance
: escape variable names when
escape=TRUE
Breaking change:
dcolumn
for dot-aligned columns is
deprecated. Use “d” in the align
argument instead.Other changes:
\num{}
function from the siunitx
package by default. This produces
much nicer formatting. This can be disabled with a global option. See
?modelsummary
align
argument accepts a “d” column for
dot-alignment using the siunitx
LaTeX package:
align="ldd"
.escape
argument in most table-building
functions.threeparttable=TRUE
argument
through ...
tidyr
modelsummary
:
group
: The order of terms in the formula determines the
order of rows/columnsmodelsummary_wide
:
modelplot
:
datasummary_crosstab
:
statistic=NULL
produces a very basic crosstabdatasummary_crosstab
:
modelsummary
:
options("modelsummary_stars_note" = FALSE)
longtable=TRUE
works for LaTeX outputcoef_map
or coef_rename
are used.group = model ~ term + group
is now supported.datasummary_skim
:
datasummary_skim("categorical")
keeps NA
by default. Users can convert variables to factors before calling
datasummary_skim
to exclude NA
.Other:
modelsummary(model1, model2)
gt
titles use the new caption
argument in
the gt 0.3.0
functionBreaking change:
stars=TRUE
have been
updated to be consistent with the default output from base R (e.g., in
summary.lm). The new significance thresholds are: “+” p < 0.1, “”
p < 0.05, ”” p < 0.01, ”” p < 0.001datasummary_crosstab
:
datasummary
:
N
is smart enough to return either the number of
elements in a subset or the number of non-missing observations in a
variabledatasummary_balance
:
NA
s in factor variables by default. Users can
convert their variables with the factor()
function to omit
NA
s automatically.modelsummary
:
get_gof
(glance
) is now
optional.sandwich
, which allows things
like:
modelsummary(model, vcov = "bootstrap", R = 1000, cluster = "firm")
Other:
output="jupyter"
modelsummary
:
modelsummary
: group
and
group_map
for grouped parameters (e.g., outcome levels in
multinomial logit or components of gamlss model).dvnames()
makes it easy to get dependent variable
column titles (thanks to @NickCH-K)output="modelsummary_list"
to save a lightweight
list-based representation of the table which can be saved and fed to
modelsummary
once more to get a full table.vcov
adds a row to note the type of standard
errors.modelsummary
accepts a single model with multiple
vcov
s.get_gof
forwards … to
model_performance
coef_map
accepts unnamed vectors for easy
subsettingfixest::fixest_multi
supportoptions(modelsummary_get)
to set the order of
extraction functions to use under the hood (broom vs. easystats
vs. all)metrics
argument of
performance::model_performance
is available via
modelsummary
’s … ellipsis to limit the GOF statistics in
Bayesian models.estimate="{estimate}{stars}"
gt
by setting
options(modelsummary_factory_html="gt")
datasummary_correlation
:
...
forwarddatasummary_correlation_format
datasummary_correlation
’s method
argument
accepts functions and “pearspear” (thanks to @joachim-gassen)datasummary
:
datasummary
functions and rounding
accept
…, big.mark, etc.datasummary_skim
:
Bug fixes and lints
tidy_custom
allows partial term matchesmodelsummary(coef_rename)
accepts functionscoef_rename
for use in
modelsummary(coef_rename=coef_rename)
modelplot
accepts add_rows
to add
reference categoriesstatistic_override
becomes vcov
estimate
and
statistic
extract
is no longer
documented.threeparttable
, colors, and many other
LaTeX optionspkgdown
website and doc improvementsmitools
tidiers