Releases: strengejacke/ggeffects
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.
ggeffects 1.3.2
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 usingtype = "random"
resp.type = "fixed"
inggpredict()
. -
hypothesis_test()
now returns the standard error of contrasts or pairwise
comparisons as attributestandard_error
. This can be used to compute the
test-statistic, if required. In forthcoming updates, there will be methods
forinsight::get_statistic()
andparameters::model_parameters()
to include
standard errors and test-statistics in the output. -
test_predictions()
was added as an alias forhypothesis_test()
.
Bug fixes
- Fixed issue in
hypothesis_test()
for mixed models, which sometimes failed
when random effects group variables were numeric, and not factors.
ggeffects 1.3.1
New functions
johnson_neyman()
, to create Johnson-Neyman intervals and plots from
ggeffects
objects.
Changes
-
Better automatic handling of offset-terms, both for predictions and generating
plots with raw data. When the model formula contains an offset-term, and the
offset term is fixed at a specific value, the response variable is now
automatically transformed back to the original scale, and the offset-term is
added to the predicted values. A warning is printed when model contains transformed offset-terms that are not fixed, e.g. via thecondition
argument. -
ggeffect()
now supportsnestedLogit
models.
Bug fixes
-
Fixed issue in
hypothesis_test()
, where theby
argument did not work
together with thecollapse_levels
argument. -
Fixed issue in
plot()
method when adding raw data points for data frame
that had now row names.
ggeffects 1.3.0
Breaking
- To avoid confusion when adding raw data or residuals to plots, the
jitter
argument that is used to add some noice to data points to avoid overlapping
now defaults toNULL
. Formerly, a small jitter was added by default,
leading to confusion when data points did not match the original data.
Changes
-
The
plot()
method gets alabel.data
argument, to add row names to data
points whenadd.data = TRUE
. -
tibbles
are always converted into data frames, to avoid issues. -
hypothesis_test()
gains aby
argument, to specify a variable that is used
to group the comparisons or contrasts. This is useful for models with interaction
terms.
Bug fixes
-
Plotting residuals did not work when model object passed to
ggpredict()
were inside a list, or when called from inside functions (scoping issues). -
Fixed issue where plotting raw data (i.e.
plot(..., add.data = TRUE)
) did
not work when there were missing data in weight variables (i.e. when the
regression model used weights). -
Fixes issue in
plot()
when no term was specified in the call toggpredict()
. -
Fixed issues with robust estimation for models of package pscl.
-
Fixed issues introduced by breaking changes in marginaleffects.
ggeffects 1.2.3
General
-
Support for
nestedLogit
(nestedLogit) models. -
hyothesis_test()
gains ascale
argument, to explicitely modulate the scale
of the contrasts or comparisons (e.g."response"
or"link"
, or"exp"
to
return transformed contrasts/comparisons). -
hyothesis_test()
now includes the response level for models with ordinal
outcomes (and alike). -
When
ggpredict()
is used inside functions and a name for a vector variable
(passed as argument to that function) interms
is used, the variable is
now correctly recognized. -
Partial residuals (when
plot(..., residuals = TRUE)
) now supports more
linear (mixed) models, including models from package lme (such asgls()
orlme()
). -
For mixed models,
type = "random"
used to calculate prediction intervals
that always accounted for random effects variances, leading to larger intervals.
Usinginterval = "confidence"
together withtype = "random"
now allows to
calculate "usual" confidence intervals for random effects. This is usefule for
predictions at specific group levels of random effects (when focal terms are
only fixed effects, usetype = "fixed"
for regular confidence intervals). -
The
vcov.fun
argument can now also be a function that returns a
variance-covariance matrix. -
The
verbose
argument inggpredict()
andhypothesis_test()
now also toggle
messages for the respectiveprint()
methods. -
The
print()
method forhypothesis_test()
has been revised and now provides
more details for possible transformation of the scale of comparisons and
contrasts. -
The
print()
method now shows all rows by default when the focal term is
a factor. If rows are not shown in the output, a message is printed to inform
the user about truncated output. -
A new vignette about using ggeffects in the context of an intersectional
multilevel analysis of individual heterogeneity, using the MAIHDA framework.
Bug fixes
-
Fixed issue with wrong order of x-axis-labels for plots when the focal term
on the x-axis was a character vector, where alphabetical order of values did
not match order of predictions. -
Fixed issues in
hyothesis_test()
for models with ordinal outcomes (and alike).
ggeffects 1.2.2
General
-
Added a new
[.ggeffects
function, which allows to subsetggeffects
objects
in the same way as regular data frames, i.e. it is now possible to do:gge <- ggpredict(model, "x1") gge[c(1:2)]
-
Using a name for a vector variable in
terms
now works from inside functions.
E.g., you can now do:foo <- function(data) { fit <- lm(barthtot ~ c12hour + c172code, data = data) v <- c(20, 50, 70) ggpredict(fit, terms = "c12hour [v]") } foo(efc)
-
The
colors
argument inplot()
can now also be applied to single-colored
plots. -
hyothesis_test()
gains acollapse_level
argument, to collapse term labels
that refer to the same levels into a singel unique level string.
Bug fixes
-
Fixed issue with misplaced residuals when x-axis was categorical and the
factor levels were not in alphabetical order. -
pool_predictions()
now correctly handles models with transformed response
variables (likelog(y)
) and returns the correct back-transformed pooled
predictions (and their confidence intervals). -
Fixed issue with wrong computation of confidence intervals for models of class
clm
from package ordinal. -
Fixed failing tests due to changes in the logistf package, which now also
supports emmeans. That means,ggemmeans()
now also works for models from
package logistf. -
Fixed bug in
plot()
when partial residuals were added (i.e.residuals = TRUE
)
andcollapse.group
was provided (in case of mixed models). -
Fixed issue with on-the-fly created factors inside formulas, which were not
correctly treated as factors in theplot()
method. This bug was related to
recent changes ininsight::get_data()
. -
Fixed issue with wrong labels in
hyothesis_test()
for comparisons with many
rows, when betas starting with same digit were specified (e.g.
test = "(b1-b13)=(b3-b15)"
). -
Fixed issue in
hyothesis_test()
for mixed models when focal terms included
factors with factor levels that contained a comma. -
Fixed issue with missing confidence intervals for mixed models when one of
the variable names contains white space characters (e.g.y ~ 'x a' + xb
).
ggeffects 1.2.0
Breaking
- Confidence intervals of adjusted predictions now take the model's degrees of
freedom into account, thereby leading to slightly larger intervals for models
that do not have infinite degrees of freedom (like linear models with
t-statistic).
New functions
-
hypothesis_test()
, to compute contrasts and comparisons of predictions and
test differences for statistical significance. Additionally, an accompanying
vignette that explains the new function in detail is added. -
install_latest()
, to install the latest official package version from
CRAN, or the latest development version from r-universe. -
An
as.data.frame()
method was added, which convertsggeffects
objects
returned byggpredict()
into data frame, where standard column names are
replaced by their related variable names.
General
-
Response values are now also back-transformed when these were transformed
usinglog2()
,log10()
orlog1p()
. -
The
terms
argument can now also be a named list. Thus, instead of
terms = c("score [30,50,70]", "status [low, middle]")
one could also write
terms = list(score = c(30,50,70), status = c("low", "middle"))
.
ggeffects 1.1.4
General
- Reduced package dependencies. Packages sjlabelled and MASS were moved
from imports to suggests. ggeffects is now a very lightweight package to
compute adjusted predictions and estimated marginal means.
New supported models
logitr
(package logitr)
Bug fixes
-
Fixed issue with wrong standard errors for predicting random effect groups
for more multiple levels. -
Fixed issue in
ggemmeans()
, which did not correctly averaged over character
vectors when these were hold constant. -
Fixed bug for models of class
lme
whentype = "re"
was requested.
0.14.1.1
allow re,form arg