modelbased 0.13.0
CRAN release: 2025-08-30
Changes
Methods for the tinyplot package were added.
estimate_slopes()now also gets theestimateargument, to specify how to estimate / marginalize over non-focal terms.-
Improvements to
estimate_contrasts():comparison = "inequality"now also works when contrasting slopes for a numeric predictor.New option
comparison = "inequality_ratio"forestimate_contrast(), which computes the ratio of marginal effects inequality measures across groups.For contrasts, the message about the units of contrasts (“in %-points”) has been removed, because this was slightly misleading. The units were in %-points if multiplied by 100, but this multiplication was not done in the output.
estimate_contrasts()for slopes now allows additional grouping of contrasts using thebyargument together with thecomparisonargument by specifying the grouping variable in the formula, e.g.contrast = c("x", "group")and~ pairwise | group.
estimate_expectation()andestimate_relation()now support objects of classhtest.estimate_grouplevel()now supports models from package coxme.New function
residualize_over_grid(), which residualizes a model over a grid of predictors. This is useful to visualize the residuals of a model over a grid of predictors.visualisation_recipe()andplot()get ashow_residualsargument, to show the residuals of the model, related to the data grid, in the plot.Documentation of the
display()method for modelbased objects has been added.Improved documentation and improved informative messages.
Message about unreliable standard errors (for certain models, when predicting random effects) was removed for now, as it is uncertain whether the standard errors were unreliable.
Modified code base to address changes in the marginaleffects package from version 0.29.0 onwards.
Bug fixes
Fixed issue with
byinestimate_contrasts()whencomparisonwas"inequality".Some comparison options, like
"helmert"or"poly", could not be specified as string-value, only as formula. This has been fixed, so they can now be specified as string-value, too.In-formula transformations of predictors in
bycould not be handled whenbywas not specified. This has been fixed, and automatic detection ofbyvariables now also works with in-formula transformations.
modelbased 0.12.0
CRAN release: 2025-07-10
Changes
The
comparisonargument gets two new option,"inequality"and"inequality_pairwise", to compute the marginal effects inequality measure, which summarizes the the overall effect of categorical predictors or the comprehensive effect of a predictor across all outcome categories of a nominal or ordinal dependent variable.Added docs to show how to use modelbased with finite mixture models from package brms.
Improved support for finite mixture models (currently only the
mixture()family for model from package brms are supported).Improved printing for joint-tests with
backend = "emmeans".Improved handling when p-adjustment methods that are only available in the emmeans package were used for the marginaleffects backend.
The column header for the predicted values in
estimate_means()for multinomial models from packages nnet and brglm2 has been changed toProbability, to better reflect the scale of the predictions.New vignettes (Case Studies) about using modelbased with finite mixture models and interrupted time series analysis.
The
p_adjustargument gets a new option,"sup-t", to calculate simultaneous confidence intervals.Added a
display()method for modelbased objects.
Bug fixes
Fixed printing and plotting for models from packages nnet and brglm2.
Fixed issues with object of class
aov.Fixed issue with the
plot()method forestimate_slopes()for Bayesian models.
modelbased 0.11.2
CRAN release: 2025-05-30
Changes
estimate_contrasts()for results fromestimate_relation()and alike is now more efficient for larger number of contrasts.Updated information of
citation(). If you want to cite themodelbasedpackage, please use the JOSS publication as reference (https://joss.theoj.org/papers/10.21105/joss.07969).
Bug fixes
- Fixed issue with formatted labels in
estimate_contrasts()for results fromestimate_relation().
modelbased 0.11.1
Changes
The
comparisonargument can now also be a custom function, or a matrix (e.g., to define contrasts).The
comparisonargument can now also be"joint", to jointly test hypotheses (i.e. conducting a joint test) in factorial designs.New vignette about user-defined contrasts and joint tests in
estimate_contrasts().
modelbased 0.11.0
CRAN release: 2025-05-02
New functions
- Added
pool_slopes(), to pool results fromestimate_slopes()applied to imputed data.
Breaking Changes
-
reshape_grouplevel()now takes the correct number of specified random effects groups into account when reshaping results.
Changes
In general, it is now possible to make estimate means, contrasts and slopes for distributional parameters for models from package brms using the
predictargument.estimate_grouplevel()gets argumentstest,dispersionanddiagnostic, that are internally passed toparameters::model_parameters(), but with different defaults.estimate_prediction()andestimate_relation()now support Wiener-models (Drift Diffusion Models) from package brms.estimate_prediction(),estimate_relation()and similar functions now include theRowcolumn for models with ordinal or categorical response variables when thedataargument was provided.estimate_slopes()can now also calculate average marginal effects of a predictor, just for the trend of that predictor within a certain range of values.estimate_slopes()gets apredictargument, to either select the scale of the estimates slopes, or to estimate slopes (marginal effects) for distributional parameters of brms models.estimate_contrasts()gives an informative error message when argumentsbyandcontrasthave identical variables (which does not work).Column names of predicted values for
backend = "emmeans"has changed for models like logistic regression, or beta regression. Formerly, name wasMean, now it isProbabilityorProportion, depending on the model.Exposed
iterationsargument inestimate_prediction()andestimate_relation().Option
estimate = "averageno longer prints information on averaged predictors in the footer, because strictly, the predictions are averaged over, and not the non-focal variables.Better handling for models with offsets in
estimate_means()andestimate_contrasts(). Informative messages are given when models include offset terms, and it is possible to fix the offset value using theoffsetargument. Theoffsetargument is also available forestimate_relation(),estimate_prediction()and similar.For consistency,
estimate_slopes()now also uses the residual degrees of freedom by default (likeestimate_means()) when calculating confidence intervals and p-values.Minor improvements to the documentation.
Bug fixes
Fixed issues in
estimate_grouplevel()for models from package rstanarm.Fixed issues in calculating correct confidence intervals (and possibly p-values) for pooling functions
pool_parameters()andpool_predictions().Fixed issue in
estimate_means()for multivariate response models from package brms.Fixed issue with wrong y-axis label for plots from
estimate_slopes().Fixed issue with weights in
estimate_relation().Fixed issue in printed output for the statistic column, which should be
zfor themarginaleffectsbackend, when argumentdf = Inf.
modelbased 0.10.0
CRAN release: 2025-03-10
Breaking Changes
The deprecated function
visualisation_matrix()has been removed. Useinsight::get_datagrid()instead.The
"average"option for argumentestimatewas renamed into"typical". The former"average"option is still available, but now returns marginal means fully averaged across the sample.
Changes
The
transformargument now also works forestimate_slopes()and forestimate_contrasts()with numeric focal terms.estimate_contrasts()no longer callsestimate_slopes()for numeric focal terms when these are integers with only few values. In this case, it is assumed that contrasts of values (“levels”) are desired, because integer variables with only two to five unique values are factor-alike.estimate_contrasts: now supports optional standardized effect sizes, one of “none” (default), “emmeans”, or “bootES” (#227, @rempsyc).The
predict()argument forestimate_means()gets an"inverse_link"option, to calculate predictions on the link-scale and back-transform them to the response scale after aggregation by groups.estimate_means(),estimate_slopes()andestimate_contrasts()get akeep_iterationsargument, to keep all posterior draws from Bayesian models added as columns to the output.New functions
pool_predictions()andpool_contrasts(), to deal with modelbased objects that were applied to imputed data sets. E.g., functions likeestimate_means()can be run on several data sets where missing values were imputed, and the multiple results fromestimate_means()can be pooled usingpool_predictions().The
print()method is now explicitly documented and gets some new options to customize the output for tables.estimate_grouplevel()gets a new option,type = "total", to return the sum of fixed and random effects (similar to whatcoef()returns for (Bayesian) mixed models).New option
"esarey"for thep_adjustargument. The"esarey"option is specifically for the case of Johnson-Neyman intervals, i.e. when callingestimate_slopes()with two numeric predictors in an interaction term.print_html()andprint_md()pass...to format-methods (e.g. toinsight::format_table()), to tweak the output.The
show_dataargument inplot()is automatically set toFALSEwhen the models has a transformed response variable, but predictions were not back-transformed using thetransformargument.The
plot()method gets anumeric_as_discreteargument, to decide whether numeric predictors should be treated as factor or continuous, based on the of unique values in numeric predictors.Plots now use a probability scale for the y-axis for models whose response scale are probabilities (e.g., logistic regression).
Improved printing for
estimate_contrasts()when one of the focal predictors was numeric.
Bug fixes
Fixed issue in the
summary()method forestimate_slopes().Fixed issues with multivariate response models.
Fixed issues with plotting ordinal or multinomial models.
Fixed issues with
ciargument, which was ignored for Bayesian models.Fixed issues with contrasting slopes when
backendwas"emmeans".Fixed issues in
estimate_contrasts()when filtering numeric values inby.Fixed issues in
estimate_grouplevel().Fixed issue in
estimate_slopes()for models from package lme4.
modelbased 0.9.0
CRAN release: 2025-02-05
Breaking Changes
The default package used for
estimate_means(),estimate_slopes()andestimate_contrasts()is now marginaleffects. You can set your preferred package as backend using either thebackendargument, or in general by settingoptions(modelbased_backend = "marginaleffects")oroptions(modelbased_backend = "emmeans").Deprecated argument and function names have been removed.
Argument
fixedhas been removed, as you can fix predictor at certain values using thebyargument.Argument
transformis no longer used to determine the scale of the predictions. Please usepredictinstead.Argument
transformis now used to (back-) transform predictions and confidence intervals.Argument
methodinestimate_contrasts()was renamed intocomparison.All
model_*()alias names have been removed. Use the relatedget_*()functions instead.The
show_dataargument inplot()defaults toFALSE.
Major Changes
The
"marginaleffects"backend is now fully implemented and no longer work-in-progress. You can set your preferred package as backend using either thebackendargument, or in general by settingoptions(modelbased_backend = "marginaleffects")oroptions(modelbased_backend = "emmeans").All
estimate_*()functions get apredictargument, which can be used to modulate the type of transformation applied to the predictions (i.e. whether predictions should be on the response scale, link scale, etc.). It can also be used to predict auxiliary (distributional) parameters.estimate_means()andestimate_contrasts()get aestimateargument, to specify how to estimate over non-focal terms. This results in slightly different predicted values, each approach answering a different question.estimate_contrasts()gains abackendargument. This defaults to"marginaleffects", but can be set to"emmeans"to use features of that package to estimate contrasts and pairwise comparisons.estimate_expectation()and related functions also get abyargument, as alternative to create a datagrid for thedataargument.Many functions get a
verboseargument, to silence warnings and messages.
Bug fixes
estimate_contrasts()did not calculate contrasts for all levels when the predictor of interest was converted to a factor inside the model formula.Fixed issue in
estimate_contrasts()whencomparsison(formerly:method) was not"pairwise".
modelbased 0.8.9
CRAN release: 2024-10-26
- Fixed issues related to updates of other easystats packages.
modelbased 0.8.5
CRAN release: 2022-08-18
Fixed issues with printing-methods.
Maintenance release to fix failing tests in CRAN checks.
modelbased 0.8.0
CRAN release: 2022-03-31
-
visualisation_matrix()has now become an alias (alternative name) for theget_datagrid()function, which is implemented in theinsightpackage.
modelbased 0.7.2
CRAN release: 2022-02-27
- Patch release. This update fixes failing tests after updating the insight package.
modelbased 0.7.1
CRAN release: 2022-01-13
API changes:
levelsinestimate_contrastshas been replaced bycontrast.levelsandmodulateare in general aggregated underat.estimate_prediction()deprecated in favour ofestimate_response().estimate_expectation()now hasdata=NULLby default.
modelbased 0.7.0
CRAN release: 2021-06-06
General overhaul of the package.
Entire refactoring of
visualisation_matrix().Option of standardizing/unstandardizing predictions, contrasts and means is now available via
standardize()instead of via options.Introduction of
model_emmeans()as a wrapper to easily createemmeansobjects.estimate_smooth()transformed intodescribe_nonlinear()and made more explicit.
modelbased 0.6.0
CRAN release: 2021-04-12
-
estimate_link()now does not transform predictions on the response scale for GLMs. To keep the previous behaviour, use the newestimate_relation()instead. This follows a change in how predictions are made internally (which now relies onget_predicted(), so more details can be found there).
modelbased 0.3.0
CRAN release: 2020-09-26
