Skip to content

Releases: strengejacke/ggeffects

ggeffects 1.7.2

13 Oct 12:12
3b87d7a
Compare
Choose a tag to compare

Breaking changes

  • The deprecated argument ppd was removed.

  • Some of the deprecated arguments in plot() were removed.

  • Pooling functions now use the model's degrees of freedom to calculate the
    critical values for the confidence intervals.

Changes

  • test = "slope" (or test = "trend") are aliases in test_predictions() for
    test = NULL with numeric predictors.

  • predict_response() (and ggpredict(), ggemmeans() and ggeffect()) get
    an argument bias_correction, to correct for bias when back-transforming
    predictions for non-Gaussian mixed models.

ggeffects 1.7.1

01 Sep 20:17
03bd93c
Compare
Choose a tag to compare

General

  • Added support for models of class glm_weightit, ordinal_weightit,
    multinom_weightit from package WeightIt.

Bug fixes

  • Fixed issues for multivariate response models due changes in the last
    insight package updates.

  • Fixed issue with swapped lower and higher confidence interval values for
    models with inverse-link.

  • Fixed CRAN check issues due to breaking changes in the last marginaleffects
    update.

ggeffects 1.7.0

20 Jun 17:07
Compare
Choose a tag to compare

Breaking

  • The deprecated argument ci.lvl in test_predictions() was removed.

General

  • ggpredict() now supports models of class glmgee (package glmtoolbox).

  • ggemmeans() gains arguments vcov_fun, vcov_type and vcov_args to
    specify the variance-covariance matrix for the marginal means, similar to
    what is already available in ggpredict() and ggaverage().

  • When test = "contrast", the engine is automatically set to "emmeans"
    in test_predictions().

  • ggaverage() (or predict_response(..., margin = "empirical")) now also
    supports following type options for zero-inflated models: "zi_prob",
    "zero_inflated" and "fixed".

  • Support for zero-inflated models was massively improved in test_predictions(),
    which, for instance, now also supports scale = "zprob" to calculate contrasts
    for the zero-inflation probability for zero-inflated models from glmmTMB or
    pscl. Furthermore, when predictions for zero-inflation probabilities were
    calculated using pr <- predict_response(..., type = "zi_prob"), corresponding
    contrasts will be calculated with test_predictions(pr) automatically.
    Additionally, other types for models with zero-inflation component
    ("zero_inflated", "fixed") are supported as well.

  • ggeffect() now warns the user about arguments that are supported by
    ggpredict() or ggemmeans(), but not by this function (e.g., vcov_fun).

  • Improved accuracy of standard errors for test_predictions(..., engine = "ggeffects").

  • The terms argument now also accepts the shortcut "percentile" (plus numeric
    value) to select a range of percentiles for continuous variables, e.g.
    terms = "x [percentile90]" to select a range of the 90% percentile.

Bug fixes

  • Fixed issue with brms models with monotonic effects in formula (mo()).

  • Fixed issue in vcov() for ggeffects objects, which could occur in rare
    situations when some of the predictors were character vectors.

  • Fixed issue with calculation of standard errors when one of the focal term
    was a character vector.

  • Fixed issue in plot() method with show_data = TRUE, where in certain
    situations the raw data points were not colored when groups were present.

  • Fixed issue in plot() with too many data points when collapsing random
    effects groups.

ggeffects 1.6.0

18 May 21:11
dde293e
Compare
Choose a tag to compare

General

  • ggpredict() now works for models of class clm2 from package ordinal,
    however, confidence intervals are not yet supported for these models.

  • ggeffect() now passes the latent argument for models with ordinal outcome
    down to effects::Effect(), to plot effects for ordinal models on the latent
    scale.

  • When argument test in test_predictions() is "interaction",
    "consecutive", or a data frame, emmeans is automatically used as backend,
    as this is the relevant package that supports these argument types.

  • format() (and hence, print()) for test_predictions() gains a
    combine_levels argument, to combine levels of the focal term in the output
    table.

  • The engine argument in test_predictions() can now also be "ggeffects".
    However, this is currently work-in-progress and offers muss less options as the
    default engine, "marginaleffects". It can be faster in some cases, though,
    and works for comparing predicted random effects in mixed models.

  • test_predictions() now automatically falls back to engines "emmeans" or
    "ggeffects" if the marginaleffects (or emmeans) package is not installed.

  • predict_response(), test_predictions() and ggpredict() will warn the user
    when all focal terms are only included as random effects in the model and no
    appropriate type or margin is specified. This is to avoid meaningless
    results.

  • plot() gets an n_rows argument, to define the number of rows for the
    panel alignment. This is useful when the number of facets is large and the
    default alignment is not optimal.

  • The ppd argument for Bayesian models will be superseded by the interval
    argument, i.e. ppd = TRUE is equivalent to interval = "prediction" (and
    ppd = FALSE is equivalent to interval = "confidence").

  • When back_transform = FALSE, and model has a transformed response variable,
    the plot() method for ggeffects objects now rescales the raw data points.
    This ensures that the raw data points are plotted on the same scale as the
    predicted values when show_data = TRUE.

  • Minor revisions of documentation and vignettes, to improve readability and
    clarity.

  • Several arguments have been deprecated and replaced by new argument names. A
    warning is printed when deprecated arguments are used. The deprecated arguments
    will be removed in a future release.

Bug fixes

  • Fixed issue in print() for ggeffect() and models with ordinal outcome,
    where one column was too much in the output.

  • Fixed issue in test_predictions() with wrong order of term labels when
    a focal term was a character vector.

  • Fixed issue in ggpredict() with wbm models from package panelr.

  • Fixed issue in ggemmeans() for glmmTMB models with zero-inflation, when
    terms included variables that were specified in the conditional, but not
    in the zero-inflation model formula.

  • Fixed issue in ggpredict() for Stan models (from packages rstanarm and brms)
    where the ci_level argument was not correctly recognized.

  • Fixed CRAN check issues due to latest marginaleffects update.

ggeffects 1.5.1

26 Mar 08:13
9d56e77
Compare
Choose a tag to compare

General

  • Overhaul of the documentation (again), to provide more clarity about the
    terminology "adjusted predictions", "marginal means" and "marginal effects",
    and how to calculate each of these quantities using the ggeffects package.

  • print_html() methods were updated to work with the latest release of
    tinytable.

  • New print_md() method, to print the output as markdown table. This is useful
    inside RMarkdown or Quarto documents, where the output can be directly included.

ggeffects 1.5.0

24 Feb 20:59
3fcad4f
Compare
Choose a tag to compare

New functions

  • predict_response() as "generic" high-level function, which is a replacement
    for ggpredict(), ggemmeans() and ggaverage(). The new function is more
    clear about how the function marginalizes over non-focal terms. The margin
    argument can be used to specify how to marginalize over non-focal terms, i.e.
    which function internally is used to compute the marginal effects.

General

  • The documentation was revised, to provide more clarity about what the package
    functions do and how to decide, which function or method to calculate marginal
    effects is the most appropriate.

  • Improved calculation of prediction intervals for Poisson regression models.

  • Improved handling of the vcov_fun argument. This argument now accepts an
    estimation type as string, e.g. vcov_fun = "HC0", which is then used to
    compute the variance-covariance matrix. Thus, it is no longer necessary to
    define both vcov_fun and vcov_type, if the variance-covariance matrix is
    covered by one of the pre-defined estimation types. See ?ggpredict for
    details.

  • hypothesis_test() now also accepts the vcov_fun argument, and not only
    vcov. This ensures consistency with the vcov_fun argument in ggpredict().
    Furthermore, the information about the type of variance-covariance matrix
    is saved to the ggeffects object returned by ggpredict(), predict_response()
    etc., and if this information is available, it is automatically used in
    hypothesis_test() when a ggeffects object is passed to the function.

Bug fixes

  • Fixed bug in wrong order of printed (sub-)tables for predictions.

  • Fixed wrong table column name for confidence interval columns for other
    confidence levels than the default 95% in print() for ggeffects objects.

  • Fixed issue with ggpredict() for models of class fixest when the cluster
    variable was numeric.

ggeffects 1.4.0

05 Feb 19:44
01078ae
Compare
Choose a tag to compare

Breaking Changes

  • The print() method has been revised. A format() method was added, which
    allows to format the output of ggpredict() (and ggeffect() etc.) for
    printing. The refactoring of the print() method makes the code base easier
    to maintain and it is easier to enhance the print-functionality. Now it is
    possible to create HTML tables as well, using print_html(). The style of the
    output has also slightly changed. By default, confidence intervals are no
    longer enclosed in parentheses. You can change this behaviour by passing the
    ci_brackets argument to print() (see examples), or permanently define custom
    parentheses or brackets with, e.g., options(ggeffects_ci_brackets = c("[", "]")).
    Additionally, there are new arguments to further control the output of the
    tables: collapse_ci can be used to collapse confidence intervals into a
    single column together with the predicted values. collapse_tables can be used
    to collapse multiple tables into a single table (only applies when there is
    more than one focal term). Again, these settings can be permanently defined
    via options (see ?print.ggeffects for details).

New functions

  • print_html(), to print the output as HTML table. This method is available
    for objects from ggpredict() (and alike) as well as hypothesis_test().

General

  • A new vignette was added, showing examples for the new print-functionality.

Bug fixes

  • Fixed issue with ggpredict() for models of class vglm with multivariate
    responses.

ggeffects 1.3.4

18 Dec 09:27
2de9c10
Compare
Choose a tag to compare

General

  • ggpredict() now supports models of class rqs from package quantreg.

  • Fixed issues to be compatible with forthcoming update of emmeans.

ggeffects 1.3.3

15 Dec 09:23
Compare
Choose a tag to compare

New function

  • ggaverage(), to compute average predicted values. This function is based on
    marginaleffects::avg_predictons().

  • pool_comparisons(), to pool results from multiple calls to hypothesis_test(),
    e.g. with imputed data sets.

General

  • Support for sdmTMB (sdmTMB) models.

  • Improved support for the logistf package, including models flic() and
    flac().

  • Confidence intervals for predictions from merMod models (package lme4)
    now use the standard errors returned by predict(..., se.fit = TRUE). This
    should not affect numerical results, but can be more robust for certain edge
    cases. Note that standard errors are only based on predict() when
    tpye = "fixed". For type = "random", standard errors are still based on
    the model's variance-covariance matrix, taking uncertainty from random
    effects into account.

  • hypothesis_test() now suppports models from package parsnip.

  • johnson_neyman() gains a p_adjust argument, to adjust p-values for multiple
    comparisons. Currently, only p_adjust = "esarey" (resp. p_adjust = "es") and
    p_adjust = "fdr" (resp. p_adjust = "bh") are supported.

Bug fixes

  • ggpredict() now computes appropriate predicted probabilites for models
    of class rms::lrm() with ordinal outcome.

  • Fixed issue in ggpredict() for type = "random" when sampling from random
    effects levels, where the levels were numeric characters with a pattern like
    "001", "002", etc.

  • Fixed minor issue in plot.ggalleffects().

  • ... arguments in ggpredict() are now passed down to the predict() method
    for mgcv::gam() models.

ggeffects 1.3.2

17 Oct 10:42
3be6739
Compare
Choose a tag to compare

Breaking changes

  • Some function arguments will be renamed, to achieve consistency across the
    package and across other packages where I'm involved in the development.
    This will be a soft transition, i.e. the old argument names will still work
    for some package updates.

Changes

  • The typical argument now supports a mix of functions for different variable
    types at which numeric or categorical covariates (non-focal terms) are held
    constant.

  • Clarification of how the re.form argument is set when using type = "random"
    resp. type = "fixed" in ggpredict().

  • hypothesis_test() now returns the standard error of contrasts or pairwise
    comparisons as attribute standard_error. This can be used to compute the
    test-statistic, if required. In forthcoming updates, there will be methods
    for insight::get_statistic() and parameters::model_parameters() to include
    standard errors and test-statistics in the output.

  • test_predictions() was added as an alias for hypothesis_test().

Bug fixes

  • Fixed issue in hypothesis_test() for mixed models, which sometimes failed
    when random effects group variables were numeric, and not factors.