- Support for monotonic predictors in brms models (
mo()
). - For generalized additive models, values for splines are no longer automatically prettified (which ensures smooth plots, without the need to use the
[all]
tag, i.e.terms="... [all]"
). - If splines or plolynomial terms are used, a message is printed to indicate that using the
[all]
tag, i.e.terms="... [all]"
, will produce smoother plots. - The package-vignette Marginal Effects at Specific Values now has examples on how to get marginal effects for each group level of random effects in mixed models.
- Added an
n
-tag for theterms
-argument inggpredict()
andggeffect()
, to give more flexibility according to how many values are used for "prettifying" large value ranges. - Added a
sample
-tag for theterms
-argument inggpredict()
andggeffect()
, to pick a random sample of values for plotting. ggpredict()
andggeffect()
now also return the standard error of predictions, if available.- The
jitter
-argument inplot()
now also changes the amount of noise for plots of models with binary outcome (whenrawdata = TRUE
).
- Fix issue with proper calculation of random effect variances for glmmTMB models for
type="re"
andtype="re.zi"
in general, and also for models withar1
random effects structure.
- Reduce package dependencies.
- Moved package effects from dependencies to suggested packages, due to the restrictive requirements (R >= 3.5).
- New
print()
-method, with a nicer print of the returned data frame. This method replaces thesummary()
-method, which was removed. ggeffect()
now supportsclm2
-models from the ordinal-package.ggpredict()
has improved support forcoxph
-models from the survival-package (survival probabilities, cumulative hazards).
- The
type
-argument inggpredict()
now has additional options,type = "fe.zi"
andtype = "re.zi"
, to explicitely condition zero-inflated (mixed) models on their zero-inflation component. - The
type
-argument inggpredict()
now has additional options,type = "surv"
andtype = "cumhaz"
, to plot probabilities of survival or cumulative hazards fromcoxph
-models. ggpredict()
gets argumentsvcov.fun
,vcov.type
andvcov.args
to calculate robust standard errors for confidence intervals of predicted values. These are based on the varioussandwich::vcov*()
-functions, hence robust standard errors can be calculated for all models that are supported bysandwich::vcov*()
.- The
plot()
-method gets two argumentsline.size
anddot.size
, to determine the size of the geoms. - The
ci
-argument for theplot()
-method now also accepts the character values"dash"
and"dot"
to plot dashed or dotted lines as confidence bands. - The
terms
-argument inggpredict()
andggeffect()
may also be a formula, which is more convenient for typing, but less flexible than specifying the terms as character vector with specific options.
- Fixed improper calculation of confidence intervals for hurdle- and zero-inflated models (from package pscl), which could exceed the range of plausible values (e.g. below zero for incidence rates).
- Fixed issues with calculation of confidence intervals for mixed models with polynomial terms.
- New vignette Different Output between Stata and ggeffects.
ggpredict()
now automatically back-transforms predictions to the response scale for model with log-transformed response.ggeffect()
andggpredict()
now automatically set numeric vectors with 10 or more unique values to representative values (seerprs_values()
), if these are used as second or third value in theterms
-argument (to represent a grouping structure).- Fix memory allocation issue in
ggeffect()
. rprs_values()
is now exported.- The
pretty
-argument is deprecated, because prettifying values almost always makes sense - so this is done automatically. ggpredict()
now supportsbrmsfit
-objects with categorical-family.ggalleffect()
has been removed.ggeffect()
now plots effects for all model terms ifterms = NULL
.gginteraction()
andggpoly()
have been removed, asggpredict()
andggeffect()
are more efficient and generic for plotting interaction or polynomial terms.
- Fix issues with categorical or ordinal outcome models (
polr
,clm
,multinom
) forggeffect()
. - Fix issues with confidence intervals for mixed models with log-transformed response value.
- Fix issues with confidence intervals for generalized mixed models when response value was a rate or proportion created with
cbind()
in model formula.
- Removed alias names
mem()
,eff()
andame()
. - For mixed models (packages lme4, nlme, glmmTMB), the uncertainty of the random effect variances is now taken into account when
type = "re"
. - Computing confidence intervals for mixed models should be much more memory efficient now, resulting less often in warnings about memory allocation problems.
- Updated reference in
CITATION
to the publication in the Journal of Open Source Software. - A test-suite was added to the package.
pretty_range()
, to create a pretty sequence of integers of a vector.
ggpredict()
gets acondition
-argument to specify values at which covariates should be held constant, instead of theirtypical
value.- The
pretty
-option forggpredict()
now calculates more values, leading to smoother plots. - The
terms
-argument inggpredict()
can now also select a range of feasible values for numeric values, e.g.terms = "age [pretty]"
. In contrast to thepretty
-argument, which prettyfies all terms, you can selectively prettify specific terms with this option. - The
terms
-argument inggpredict()
now also supports all shortcuts that are possible for themdrt.values
-argument ingginteraction()
, so for instanceterm = "age [meansd]"
would return three values: mean(age) - sd(age), mean(age) and mean(age) + sd(age). plot()
gets some new arguments to control which plot-title to show or hide:show.title
,show.x.title
andshow.y.title
.plot()
gets alog.y
argument to transform the y-axis to logarithmic scale, which might be useful for binomial models with predicted probabilities, or other models with log-alike link-functions.- The
plot()
-method for plotting all effects withggpredict()
(whenterm = NULL
) now allows to arrange the plot in facets (usingfacets = TRUE
). - Values in dot-argument for
plot()
are now passed down toggplot::scale_y*()
, to control the appearance of the y-axis (likebreaks
).
- Fixed issue with binomial models that used
cbind(...)
as response variable. - Fixed issue with suboptimal precision of confidence resp. prediction intervals for mixed models (packages lme4, nlme), which are now more accurate.
- Prediction for
glmmTMB
-objects now compute proper confidence intervals, due to fix in package glmmTMB 0.2.1 - If
terms
inggpredict()
is missing orNULL
, marginal effects for each model term are calculated.ggpredict()
then returns a list of data frames, which can also be plotted withplot()
.
- The
jitter
-argument fromplot()
now accepts a numeric value between 0 and 1, to control the width of the random variation in data points. ggpredict()
andggeffect()
can now predict transformed values, which is useful, for instance, to exponentiate predictions forlog(term)
on the original scale of the variable. See package vignette, section Marginal effects at specific values or levels for examples.
- Multivariate response models in brms with variable names with underscores and dots were not correctly plotted.
- Better support for multivariate-response-models from brms.
- Support for cumulative-link-models from brms.
ggpredict()
now supports linear multivariate response models, i.e.lm()
with multiple outcomes.
ggpredict()
gets apretty
-argument to reduce and "prettify" the value range from variables interms
for predictions. This applies to all variables interms
with more than 25 unique values.
- Recognize negative binomial family from
brmsfit
-models.
ggpredict()
,ggeffect()
andgginteraction()
get ax.as.factor
-argument to preserve factor-class for thex
-column in the returned data frame.- The
terms
-argument now also allows the specification of a range of numeric values in square brackets, e.g.terms = "age [30:50]"
.
- Give proper warning that
clm
-models don't supportfull.data
-argument. emm()
did not work properly for some random effects models.
- Use
convert_case()
from sjlabelled, in preparation for the latest snakecase-package update.
- Model weights are now correctly taken into account.