Breaking changes:
by
is deprecated in summary()
and
tidy()
. Use the same by
argument in the main
functions instead: comparisons()
,
marginaleffects()
, predictions()
variables
argument of the predictions()
function. Use newdata="fivenum"
or “grid”, “mean”, or
“median” instead.Critical bug fix:
New supported packages and models:
survival::clogit
biglm
: The main quantities can be computed, but not the
delta method standard errors. See
https://github.com/vincentarelbundock/marginaleffects/issues/387New vignette:
New features:
slope
argument in marginaleffects()
: eyex, dyex, eydxdatagrid()
accepts functions:
datagrid(newdata = mtcars, hp = range, mpg = fivenum, wt = sd)
datagridcf()
function to create counterfactual
datasets. This is a shortcut to the datagrid()
function
with default to grid_type = "counterfactual"
by
arguments in predictions()
,
comparisons()
, marginaleffects()
newdata
shortcuts: “tukey”, “grid”transform_pre
in
comparisons()
marginalmeans()
now back transforms confidence
intervals when possible.vcov
argument string shortcuts are now
case-insensitivecomparisons()
for binary
predictors is now a difference between 1 and 0, rather than +1 relative
to baseline.New supported packages and models:
tidymodels
objects of class tidy_model
are
supported if the fit engine is supported by
marginaleffects
.New function:
deltamethod()
: Hypothesis tests on functions of
parametersplot_cco()
: Plot conditional contrastsNew arguments:
hypothesis
for hypothesis tests and custom
contraststransform_post
in predictions()
wts
argument in predictions()
only affects
average predictions in tidy()
or
summary()
.New or improved vignettes:
Deprecated or renamed arguments:
contrast_factor
and contrast_numeric
arguments are deprecated in comparisons()
. Use a named list
in the variables
argument instead. Backward compatibility
is maintained.transform_post
argument in tidy()
and
summary()
is renamed to transform_avg
to
disambiguate against the argument of the same name in
comparisons()
. Backward compatibility is preserved.Misc:
tidy.predictions()
computes standard errors using the
delta method for average predictionsgam
models with matrix columns.eps
in marginaleffects()
is now “adaptive”
by default: it equals 0.0001 multiplied the range of the predictor
variablecomparisons()
now supports “log of marginal odds ratio”
in the transform_pre
argument. Thanks to Noah Greifer.transform_pre
shortcuts: dydx, expdydxtidy.predictions()
computes standard errors and
confidence intervals for linear models or GLM on the link scale.Breaking changes:
type
no longer accepts a character vector. Must be a
single string.conf.int
argument deprecated. Use
vcov = FALSE
instead.New supported packages and models:
mlogit
mhurdle
tobit1
glmmTMB
New features:
interaction
argument in comparisons()
to
compute interactions between contrasts (cross-contrasts).by
argument in tidy()
and
summary()
computes group-average marginal effects and
comparisons.transform_pre
argument can define custom contrasts
between adjusted predictions (e.g., log adjusted risk ratios). Available
in comparisons()
.transform_post
argument allows back transformation
before returning the final results. Available in
comparisons()
, marginalmeans()
,
summary()
, tidy()
.variables
argument of the
comparisons()
function accepts a named list to specify
variable-specific contrast types.vcov
argument. This
requires version 0.17.1 of the insight
package.
sandwich
package shortcuts: vcov = "HC3"
,
"HC2"
, "NeweyWest"
, and more.vcov = "satterthwaite"
or
"kenward-roger"
vcov = ~cluster_variable
marginalmeans()
allows interactionsbrms
models using
type = "average"
. See vignette on the
marginaleffects
website.eps
argument for step size of numerical derivativemarginaleffects
and comparisons
now report
confidence intervals by default.data.table
package yields
substantial performance improvements.New pages on the marginaleffects
website:
https://vincentarelbundock.github.io/marginaleffects/
Argument name changes (backward compatibility is preserved:
conf.level
-> conf_level
datagrid()
:
FUN.factor
-> FUN_factor
(same for
related arguments)grid.type
-> grid_type
New supported packages and models:
stats::loess
sampleSelection::selection
sampleSelection::heckit
Misc:
mgcv::bam
models allow exclude
argument.include_smooth
argument.New function:
comparisons()
computes contrastsMisc:
predictions()
and plot_cap()
include
confidence intervals for linear modelsggplot2::theme_set()
callNew supported models:
mclogit::mclogit
robust::lmRob
robustlmm::rlmer
fixest
confidence intervals in
predictions
Misc:
modelbased::visualisation_matrix
in
newdata
without having to specify x
explicitly.tidy.predictions()
and
summary.predictions()
methods.Support for new models and packages:
brglm2::bracl
mclogit::mblogit
scam::scam
lmerTest::lmer
Misc:
numDeriv
dependency, but make it available via a
global option: options(“marginaleffects_numDeriv” = list(method =
“Richardson”, method.args = list(eps = 1e-5, d = 0.0001)))documentation bugfix
Breaking changes:
predictions
returns predictions for every observation
in the original dataset instead of newdata=datagrid()
.marginalmeans
objects have new column names, as do the
corresponding tidy
and summary
outputs.New supported packages and models:
brms::brm
rstanarm::stanglm
brglm2::brmultinom
MASS::glmmPQL
aod::betabin
Misc:
datagrid
function supersedes typical
and
counterfactual
with the grid.type
argument.
The typical
and counterfactual
functions will
remain available and exported, but their use is not encouraged.posteriordraws
function can be applied to a
predictions
or a marginaleffects
object to
extract draws from the posterior distribution.marginalmeans
standard errors are now computed using
the delta method.predictions
standard errors are now computed using the
delta method when they are not available from
insight::get_predicted
.brms
lme4
data.table
package is installed,
marginaleffects
will automatically use it to speed things
up.marginaleffects
output.type
argument.emmeans
Breaking change:
data
argument becomes newdata
in all
functions.New supported packages and models:
lme4:glmer.nb
mgcv::gam
ordinal::clm
mgcv
marginalmeans
:
variables_grid
argumentpredictions
:
mgcv
plot_cap
type
argumentMisc:
First release. Bravo!
Thanks to Marco Avina Mendoza, Resul Umit, and all those who offered comments and suggestions.