Releases: strengejacke/ggeffects
ggeffects 2.0.0
Breaking changes
-
The way how
type = "random"
works has been revised.type = "random"
no
longer returns predictions intervals. Instead, useinterval = "prediction"
.
type = "random"
is now mainly responsible for unit-level predictions in
mixed models, as opposed totype = "fixed"
, which should be used for
population-level predictions. The separation fromtype = "random"
and
theinterval
argument makes the handling for mixed models easier, more
intuitive and consistent. Accordingly, the vignette regarding the introduction
into mixed models with ggeffects has been largely revised. -
The
vcov_fun
andvcov_type
argument were removed and are now replaced
by the singlevcov
argument, to be in line with the handling of
heteroscedasticity-consistent standard errors in other packages (mainly:
easystats eco-system). -
The deprecated arguments for
ggpredict()
,vcov()
,ggeffect()
and
ggemmeans()
have been removed. -
The deprecated arguments for the
plot()
method have been removed. -
Options
type = "random"
andtype = "zi_random"
are not longer available
forggemmeans()
. These were only responsible to set prediction intervals,
which can be done withinterval = "prediction"
now.
Changes
-
Added a
get_preditions()
method, which can be used to implement own S3-classes
to add support for new models to ggeffects. There is a corresponding
vignette, too. -
The
plot()
method gets adot_shape
argument, to change the shape of data
points whenshow_data = TRUE
. -
test_predictions
gains atest_args
argument, to optionally pass further
options totest
for emmeans engine/options. -
vcov()
returns a more informative warning, when the variance-covariance
matrix could not be extracted due to problems in creating the model matrix
(which prevents confidence intervals from being calculated). -
Added Okabe-Ito color scale to the available color ggeffects-palettes.
-
For models of class
survreg
, argumenttype
can also be"quantile"
.
Bug fixes
-
Fixed issue with argument
condition
forggaverage()
. -
Fixed issues with missing confidence intervals for objects of class
averaging
.
ggeffects 1.7.2
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"
(ortest = "trend"
) are aliases intest_predictions()
for
test = NULL
with numeric predictors. -
predict_response()
(andggpredict()
,ggemmeans()
andggeffect()
) get
an argumentbias_correction
, to correct for bias when back-transforming
predictions for non-Gaussian mixed models.
ggeffects 1.7.1
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
Breaking
- The deprecated argument
ci.lvl
intest_predictions()
was removed.
General
-
ggpredict()
now supports models of classglmgee
(package glmtoolbox). -
ggemmeans()
gains argumentsvcov_fun
,vcov_type
andvcov_args
to
specify the variance-covariance matrix for the marginal means, similar to
what is already available inggpredict()
andggaverage()
. -
When
test = "contrast"
, theengine
is automatically set to"emmeans"
intest_predictions()
. -
ggaverage()
(orpredict_response(..., margin = "empirical")
) now also
supports followingtype
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 supportsscale = "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 usingpr <- predict_response(..., type = "zi_prob")
, corresponding
contrasts will be calculated withtest_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()
orggemmeans()
, 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()
forggeffects
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 withshow_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
General
-
ggpredict()
now works for models of classclm2
from package ordinal,
however, confidence intervals are not yet supported for these models. -
ggeffect()
now passes thelatent
argument for models with ordinal outcome
down toeffects::Effect()
, to plot effects for ordinal models on the latent
scale. -
When argument
test
intest_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()
) fortest_predictions()
gains a
combine_levels
argument, to combine levels of the focal term in the output
table. -
The
engine
argument intest_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()
andggpredict()
will warn the user
when all focal terms are only included as random effects in the model and no
appropriatetype
ormargin
is specified. This is to avoid meaningless
results. -
plot()
gets ann_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 theinterval
argument, i.e.ppd = TRUE
is equivalent tointerval = "prediction"
(and
ppd = FALSE
is equivalent tointerval = "confidence"
). -
When
back_transform = FALSE
, and model has a transformed response variable,
theplot()
method forggeffects
objects now rescales the raw data points.
This ensures that the raw data points are plotted on the same scale as the
predicted values whenshow_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()
forggeffect()
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()
withwbm
models from package panelr. -
Fixed issue in
ggemmeans()
forglmmTMB
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 theci_level
argument was not correctly recognized. -
Fixed CRAN check issues due to latest marginaleffects update.
ggeffects 1.5.1
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
New functions
predict_response()
as "generic" high-level function, which is a replacement
forggpredict()
,ggemmeans()
andggaverage()
. The new function is more
clear about how the function marginalizes over non-focal terms. Themargin
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 bothvcov_fun
andvcov_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 thevcov_fun
argument, and not only
vcov
. This ensures consistency with thevcov_fun
argument inggpredict()
.
Furthermore, the information about the type of variance-covariance matrix
is saved to the ggeffects object returned byggpredict()
,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% inprint()
forggeffects
objects. -
Fixed issue with
ggpredict()
for models of classfixest
when the cluster
variable was numeric.
ggeffects 1.4.0
Breaking Changes
- The
print()
method has been revised. Aformat()
method was added, which
allows to format the output ofggpredict()
(andggeffect()
etc.) for
printing. The refactoring of theprint()
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, usingprint_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 toprint()
(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 fromggpredict()
(and alike) as well ashypothesis_test()
.
General
- A new vignette was added, showing examples for the new print-functionality.
Bug fixes
- Fixed issue with
ggpredict()
for models of classvglm
with multivariate
responses.
ggeffects 1.3.4
General
-
ggpredict()
now supports models of classrqs
from package quantreg. -
Fixed issues to be compatible with forthcoming update of emmeans.
ggeffects 1.3.3
New function
-
ggaverage()
, to compute average predicted values. This function is based on
marginaleffects::avg_predictons()
. -
pool_comparisons()
, to pool results from multiple calls tohypothesis_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 bypredict(..., 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 onpredict()
when
tpye = "fixed"
. Fortype = "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 ap_adjust
argument, to adjust p-values for multiple
comparisons. Currently, onlyp_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 classrms::lrm()
with ordinal outcome. -
Fixed issue in
ggpredict()
fortype = "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 inggpredict()
are now passed down to thepredict()
method
formgcv::gam()
models.