← Back to all sparks
M

modelbased

ANALYTICS
Velocity0.0

Estimate marginal means, contrasts and model-based predictions in R

modelbased is turning marginal effects into a full contrast grammar

easystatsmarginal-effectscontrastsmixed-modelsstatistical-visualizationr-package
Current state
modelbased computes marginal means, contrasts, and slopes from fitted models, and it ships every one to two months with a consistent shape: new comparison types, broader model support, and steady renaming toward clearer vocabulary. The recent arc runs from marginal effects inequality measures through inequality ratios to an omnibus global test and a post_process argument for multi-step comparisons. Argument names have been settled along the way, with trend becoming slope and an alias left behind.
Where it's heading
The package is building a compositional vocabulary rather than a fixed menu — contrasts of average slopes, contrasts across two numeric predictors, inequality summaries across all outcome categories, and now user-supplied post-processing of comparisons. Support quietly widens underneath, covering nestedLogit, brms finite mixtures, and offsets under population and average estimation. Plotting gets attention in proportion to how often these results are presented rather than tabulated, including collapse_by_group() for showing averaged raw data under mixed-model fits.
Prediction
With post_process and omnibus tests both landed, the likely next step is making these composed comparisons easier to report — formatting or plotting methods for the multi-step results rather than new comparison types.

Recent moves

  1. 1mo ago

    modelbased 0.16.0 adds post-processing and omnibus contrast tests

    estimate_contrasts() gains a post_process argument for multi-step comparisons and an omnibus comparison option for a global test across predictor levels, while offsets start working under population and average estimation. The post_process hook is the more open-ended addition, letting users compose comparisons the package does not name.

    View source ↗
  2. 3mo ago

    modelbased 0.15.0 contrasts average slopes across numeric predictors

    estimate_contrasts() can contrast average slopes by naming two numeric predictors, which is useful for within- and between-effects in the same model, and nestedLogit models gain support. The plot() method's join_dots argument now defaults to FALSE, a small breaking change to output.

    View source ↗
  3. 5mo ago

    modelbased 0.14.0 renames trend to slope and adds collapse_by_group()

    The trend argument becomes slope with an alias retained, and collapse_by_group() extracts raw data averaged over a grouping factor for mixed models, wired into the plotting methods via collapse_group. Presentation work aimed at plots that would otherwise be unreadable under a mixed model.

    View source ↗
  4. 8mo ago

    modelbased 0.13.1 adds marginal group-level estimates and as.data.frame()

    estimate_grouplevel() gains a marginal type option, modelbased objects get an as.data.frame() method and a saved call attribute, and equivalence-test output formatting improves. Interoperability work, including accepting parameters::equivalence_test() on modelbased objects.

    View source ↗
  5. 11mo ago

    modelbased 0.13.0 adds inequality ratios and slope marginalization

    estimate_slopes() gains an estimate argument controlling marginalization over non-focal terms, inequality comparisons extend to numeric-predictor slopes, and inequality_ratio arrives for comparing inequality measures across groups. Also adds tinyplot methods.

    View source ↗
  6. 1y ago

    modelbased 0.12.0 introduces marginal effects inequality measures

    The comparison argument gains inequality and inequality_pairwise, summarizing a categorical predictor's overall effect or a predictor's effect across all outcome categories of a nominal or ordinal response. This is where the inequality thread that later releases extend begins.

    View source ↗