Marginaleffects

Latest version: v0.0.14

Safety actively analyzes 682416 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 6

0.13.0

Breaking change:

* `glmmTMB`: Standard errors are no longer supported because they may have been erroneous. Follow Issue 810 on Github for developments: https://github.com/vincentarelbundock/marginaleffects/issues/810

New:

* `hypothesis` argument accepts wildcards: `hypothesis = "b*=b1"`
* `s.value` column in all output: Shannon transforms for p values. See Greenland (2019).
* `marginal_means` supports `mira` (`mice` objects).
* `comparisons()`: The `variables` arguments now accepts arbitrary numeric vectors of length equal to the number of rows in `newdata`. This allows users to specify fully custom treatment sizes. In the documentation examples, we show how to estimate the difference for a 1 standard deviation shift in a regressor, where the standard deviation is calculated on a group-wise basis.
* `comparisons()`: the `variables` argument now accepts "revpairwise", "revsequential", "revreference" for factor and character variables.
* `comparisons()`: the `comparison` argument now accept "lift" and "liftavg".

Performance:

* Computing elasticities for linear models is now up to 30% faster (787, etiennebacher).

Bug fixes:

* Better handling of environments when `newdata` is a function call. Thanks to jcccf for report 814 and to capnrefsmmat for the proposed fix using the `rlang` package.
* Degrees of freedom mismatch for joint hypothesis tests. Thanks to snhansen for report 789.

0.12.0

Breaking change:

* Row order of output has changed for many calls, especially those using the `by` argument. This may break hypothesis tests conducted by indexing `b1`, `b2`, etc. This was necessary to fix Issue 776. Thanks to marcora for the report.

New:

* `hypotheses()`: Joint hypothesis tests (F and Chi-square) with the `joint` and `joint_test` arguments.
* `vcov.hypotheses` method.
* `wts` is now available in `plot_predictions()`, `plot_comparisons()`, and `plot_slopes()`.

Bug:

* Wrong order of rows in bayesian models with `by` argument. Thanks to shirdekel for report 782.

0.11.2

* `vcov()` and `coef()` methods for `marginaleffects` objects.
* Strings in `wts` are accepted with the `by` argument.
* `predictions()` and `avg_predictions()` no longer use an automatic backtransformation for GLM models unless `hypothesis` is `NULL`.
* `vcov()` can be used to retrieve a full variance-covariance matrix from objects produced by `comparisons()`, `slopes()`, `predictions()`, or `marginal_means()` objects.
* When processing objects obtained using `mice` multiple imputation, the pooled model using `mice::pool` is attached to the `model` attribute of the output. This means that functions like `modelsummary::modelsummary()` will not erroneously report goodness-of-fit statistics from just a single model and will instead appropriately report the statistics for the pooled model. Thanks to Tristan-Siegfried for PR 740.
* More informative error messages on some prediction problems. Thanks to andymilne for Report 751.

Performance:

* `inferences()` is now up to 17x faster and much more memory-efficient when `method` is `"boot"` or `"rsample"` (770, 771, etiennebacher).

Bugs:

* `brms` models with `nl=TRUE` and a single predictor generated an error. Thanks to Tristan-Siegried for Report 759.
* `avg_predictions()`: Incorrect group-wise averaging when all predictors are categorical, the `variables` variable is used, and we are averaging with `avg_` or the `by` argument. Thanks to BorgeJorge for report 766.
* Bug when `datagrid()` when called inside a user-written function. Thanks to NickCH-K for report 769 and to capnrefsmmat for the diagnostics.

0.11.1

Breaking change:

* Row orders are now more consistent, but may have changed from previous version. This could affect results from `hypothesis` with `b1`, `b2`, ... indexing.

Support new models:

* `nlme::lme()`
* `phylolm::phylolm()`
* `phylolm::phyloglm()`

New:

* Vignette on 2x2 experimental designs. Thanks to Demetri Pananos.
* `comparisons()` accepts data frames with two numeric columns ("low" and "high") to specify fully customizable contrasts.
* `datagrid()` gets a new `by` argument to create apply grid-making functions within groups.
* `plot_*()` gain a `newdata` argument for use with `by`.

Bug:

* `comparisons(comparison = "lnratioavg")` ignored `wts` argument. Thanks to Demetri Pananos for report 737.
* `ordinal::clm()`: incorrect standard errors when location and scale parameters are the same. Thanks to MrJerryTAO for report 718.
* Incorrect label for "2sd" comparisons. Thanks to Andy Milne for report 720.
* Invalid factor levels in `datagrid()` means `newdata` argument gets ignored. Thanks to Josh Errickson for report 721.
* Error in models with only categorical predictors and the `by` argument. Thanks to Sam Brilleman for report 723.
* Elasticities are now supported for `ordinal::clm()` models. Thanks to MrJerryTAO for report 729.
* `glmmTMB` models with zero-inflated components are supported. Thanks to Helsinki-Ronan and strengejacke for report 734.

0.11.0

Breaking changes:

* `type` column is replaced by `type` attribute.
* `predictions()` only works with officially supported model types (same list as `comparisons()` and `slopes()`).

Renamed arguments (backward compatibility is preserved):

* `transform_pre` -> `comparison`
* `transform_post` -> `transform`

New:

* `p_adjust` argument: Adjust p-values for multiple comparisons.
* `equivalence` argument available everywhere.

Performance:

* Much faster results in `avg_*()` functions for models with only categorical predictors and many rows of data, using deduplication and weights instead of unit-level estimates.
* Faster predictions in `lm()` and `glm()` models using `RcppEigen`.
* Bayesian models with many rows. Thanks to Etienne Bacher. 694
* Faster predictions, especially with standard errors and large datasets.

Bugs:

* Multiple imputation with `mira` objects was not pooling all datasets. Thanks to Generalized for report 711.
* Support for more models with offsets. Thanks to mariofiorini for report 705.
* Error on `predictions()` with `by` and `wts`. Thanks to Noah Greifer for report 695.
* `afex`: some models generated errors. Thanks to Daniel Lüdecke for report 696.
* `group` column name is always forbidden. Thanks to Daniel Lüdecke for report 697.
* Blank graphs in `plot_comparisons()` with a list in `variables`.
* `type="link"` produced an error with some categorical `brms` models. Thanks to shirdekel for report 703.
* Error on `predictions(variables = ...)` for `glmmTMB` models. Thanks to Daniel Lüdecke for report 707.
* `by` with user-specified function in `comparison` and factor predictor did not aggregate correctly. Thanks to joaotedde for report 715.
* `ordinal::clm`: Support `cum.prob` and `linear.predictor` prediction types. Thanks to MrJerryTAO for report 717.

0.10.0

Performance:

* 2-4x faster execution for many calls. Thanks to Etienne Bacher.

New models supported:

* `MCMCglmm::MCMCglmm`
* `Rchoice::hetprob`
* `Rchoice::ivpml`
* Multiple imputation using `mice` and any package which can return a list of imputed data frames (e.g., `Amelia`, `missRanger`, etc.)

Plot improvements:

* New `by` argument to display marginal estimates by subgroup.
* New `rug` argument to display tick marks in the margins.
* New `points` argument in `plot_predictions()` to display a scatter plot.
* New `gray` argument to plot in grayscale using line types and shapes instead of color.
* The `effect` argument is renamed to `variables` in `plot_slopes()` and `plot_comparisons()`. This improves consistency with the analogous `slopes()` and `comparisons()` functions.
* The plotting vignette was re-written.

Other:

* Support multiple imputation with `mice` `mira` objects. The multiple imputation vignette was rewritten.
* The `variables_grid` argument in `marginal_means()` is renamed `newdata`. Backward compatibility is maintained.
* `avg_*()` returns an informative error when `vcov` is "satterthwaite" or "kenward-roger"
* "satterthwaite" and "kenward-roger" are now supported when `newdata` is not `NULL`
* Informative error when `hypothesis` includes a `b` larger than the available number of estimates.
* `avg_predictions(model, variables = "x")` computes average counterfactual predictions by subgroups of `x`
* `datagrid()` and `plot_*()` functions are faster in datasets with many extraneous columns.
* In `predictions(type = NULL)` with `glm()` and `Gam()` we first make predictions on the link scale and then backtransform them. Setting `type="response"` explicitly makes predictions directly on the response scale without backtransformation.
* Standard errors now supported for more `glmmTMB` models.
* Use the `numDeriv` package for numeric differentiation in the calculation of delta method standard error. A global option can now be passed to `numDeriv::jacobian`:
- `options(marginaleffects_numDeriv = list(method = "simple", method.args = list(eps = 1e-6)))`
- `options(marginaleffects_numDeriv = list(method = "Richardson", method.args = list(eps = 1e-6)))`
- `options(marginaleffects_numDeriv = NULL)`
* Print:
- Print fewer significant digits.
- `print.marginaleffects` now prints all columns supplied to `newdata`
- Less redundant labels when using `hypothesis`
* Many improvements to documentation.

Bugfixes:

* Standard errors could be inaccurate in models with non-linear components (and interactions) when some of the coefficients were very small. This was related to the step size used for numerical differentiation for the delta method. Issue 684.
* `avg_predictions(by =)` did not work when the dataset included a column named `term`. Issue 683.
* `brms` models with multivariate outcome collapsed categories in `comparisons()`. Issue 639.
* `hypotheses()` now works on lists and in calls to `lapply()`, `purrr::map()`, etc. Issue 660.

Page 3 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.