Speed improvement for some models when calculating uncertainty intervals of predictions.

Minor fixes.

- Add more informative error message for
*brmsfit*models using`mo()`

with numeric predictors, which only allow to predict for values that are actually present in the data.

Fixed issue with adding raw data points for plots from logistic regression models, when the response variable was no factor with numeric levels.

Fixed issues with CRAN checks.

`orm`

(package**rms**)

Prediction intervals (where possible, or when

`type = "random"`

), are now always based on sigma^2 (i.e.`insight::get_sigma(model)^2`

). This is in line with`interval = "prediction"`

for*lm*, or for predictions based on simulations (when`type = "simulate"`

).`print()`

now uses the name of the focal variable as column name (instead) of`"x"`

).

`collapse_by_group()`

, to generate a data frame where the response value of the raw data is averaged over the levels of a (random effect) grouping factor.

A new vignette was added related to the definition and meaning of “marginal effects” and “adjusted predictions”. To be more strict and to avoid confusion with the term “marginal effect”, which meaning may vary across fields, either “marginal effects” was replaced by “adjusted predictions”, or “adjusted predictions” was added as term throughout the package’s documentation and vignettes.

Allow confidence intervals when predictions are conditioned on random effect groups (i.e. when

`type = "random"`

and`terms`

includes a random effect group factor).Predicted response values based on

`simulate()`

(i.e. when`type = "simulate"`

) is now possible for more model classes (see`?ggpredict`

).`ggpredict()`

now computes confidence intervals for some edge cases where it previously failed (e.g. some models that do not compute standard errors for predictions, and where a factor was included in the model and not the focal term).`plot()`

gains a`collapse.group`

argument, which - in conjunction with`add.data`

- averages (“collapses”) the raw data by the levels of the group factors (random effects).`data_grid()`

was added as more common alias for`new_data()`

.

`ggpredict()`

and`plot()`

for survival-models now always start with time = 1.Fixed issue in

`print()`

for survival-models.Fixed issue with

`type = "simulate"`

for`glmmTMB`

models.Fixed issue with

`gamlss`

models that had`random()`

function in the model formula.Fixed issue with incorrect back-transformation of predictions for

`geeglm`

models.

`residuals.type`

argument in`plot()`

is deprecated. Always using`"working"`

residuals.

`pretty_range()`

and`values_at()`

can now also be used as function factories.`plot()`

gains a`limit.range`

argument, to limit the range of the prediction bands to the range of the data.

Fixed issue with unnecessary back-transformation of log-transformed offset-terms from

*glmmTMB*models.Fixed issues with plotting raw data when predictor on x-axis was a character vector.

Fixed issues from CRAN checks.

- Fixed CRAN check issues.
- Added argument
`interval`

to`ggemmeans()`

, to either compute confidence or prediction intervals.

`averaging`

(package**MuMIn**)

`pool_predictions()`

, to pool multiple`ggeffects`

objects. This can be used when predicted values or estimated marginal means are calculated for models fit to multiple imputed datasets.

- The function
`residualize_over_grid()`

is now exported. - The back-transformation of the response-variable (if these were log- or square root-transformed in the model) now also works with square root-transformations and correctly handles
`log1p()`

and`log(mu + x)`

. - Since standard errors were on the link-scale and not back-transformed for non-Gaussian models, these are now no longer printed (to avoid confusion between standard errors on the link-scale and predictions and confidence intervals on the response-scale).

- Fixed issue for mixed models when predictions should be conditioned on random effects variances (e.g.
`type = "random"`

or`"zi_random"`

), but random effects variances could not be calculated or were almost zero. - Fixed issue with confidence intervals for
`multinom`

models in`ggemmeans()`

. - Fixed issue in
`ggemmeans()`

for models from*nlme*. - Fixed issue with
`plot()`

for some models in`ggeffect()`

. - Fixed issue with computation of confidence intervals for zero-inflated models with offset-term.

- Package
*insight*since version 0.9.5 now returns the “raw” (untransformed, i.e. original) data that was used to fit the model also for log-transformed variables. Thus, exponentiation like using`terms = "predictor [exp]"`

is no longer necessary.

`mlogit`

(package**mlogit**)

`plot()`

now can also create partial residuals plots. There, arguments`residuals`

,`residuals.type`

and`residuals.line`

were added to add partial residuals, the type of residuals and a possible loess-fit regression line for the residual data.

- The message for models with a back-transformation to the response scale (all non-Gaussian models), that standard errors are still on the link-scale, did not show up for models of class
`glm`

since some time. Should be fixed now. - Fixed issue with
`ggpredict()`

and`rlmerMods`

models when using factors as adjusted terms. - Fixed issue with brms-multi-response models.

`mclogit`

(package**mclogit**)

- Fixed issues due to latest
*rstanarm*update. - Fixed some issues around categorical/cumulative
*brms*models when the outcome is numeric. - Fixed bug with factor level ordering when plotting raw data from
`ggeffect()`

.

`ggpredict()`

gets a new`type`

-option,`"zi.prob"`

, to predict the zero-inflation probability (for models from*pscl*,*glmmTMB*and*GLMMadaptive*).- When model has log-transformed response variable and
`add.data = TRUE`

in`plot()`

, the raw data points are also transformed accordingly. `plot()`

with`add.data = TRUE`

first adds the layer with raw data, then the points / lines for the marginal effects, so raw data points to not overlay the predicted values.- The
`terms`

-argument now also accepts the name of a variable to define specific values. See vignette*Marginal Effects at Specific Values*.

- Fix issues in cluster-robust variance-covariance estimation when
`vcov.type`

was not specified.

- Fixed issues to due changes in other CRAN packages.

*ggeffects*now requires*glmmTMB*version 1.0.0 or higher.- Added human-readable alias-options to the
`type`

-argument.

- Fixed issue when log-transformed predictors where held constant and their typical value was negative.
- Fixed issue when plotting raw data to a plot with categorical predictor in the x-axis, which had numeric factor levels that did not start at
`1`

. - Fixed issues for model objects that used (log) transformed
`offset()`

terms.

- Reduce package dependencies.
- New package-vignette
*(Cluster) Robust Standard Errors*.

`mixor`

(package**mixor**),`cgam`

,`cgamm`

(package**cgam**)

- Fix CRAN check issues due to latest
*emmeans*update.

- The argument
`x.as.factor`

is considered as less useful and was removed.

`fixest`

(package**fixest**),`glmx`

(package**glmx**).

- Reduce package dependencies.
`plot(rawdata = TRUE)`

now also works for objects from`ggemmeans()`

.`ggpredict()`

now computes confidence intervals for predictions from`geeglm`

models.- For
*brmsfit*models with`trials()`

as response variable,`ggpredict()`

used to choose the median value of trials were the response was hold constant. Now, you can use the`condition`

-argument to hold the number of trials constant at different values. - Improve
`print()`

.

- Fixed issue with
`clmm`

-models, when group factor in random effects was numeric. - Raw data is no longer omitted in plots when grouping variable is continuous and added raw data doesn’t numerically match the grouping levels (e.g., mean +/- one standard deviation).
- Fix CRAN check issues due to latest
*geepack*update.

- The use of
`emm()`

is discouraged, and so it was removed.

`bracl`

,`brmultinom`

(package**brglm2**) and models from packages**bamlss**and**R2BayesX**.

- Updated package dependencies.
`plot()`

now uses dodge-position for raw data for categorical x-axis, to align raw data points with points and error bars geoms from predictions.- Updated and re-arranged internal color palette, especially to have a better behaviour when selecting colors from continuous palettes (see
`show_pals()`

).

- Added a
`vcov()`

function to calculate variance-covariance matrix for marginal effects.

`ggemmeans()`

now also accepts`type = "re"`

and`type = "re.zi"`

, to add random effects variances to prediction intervals for mixed models.- The ellipses-argument
`...`

is now passed down to the`predict()`

-method for*gamlss*-objects, so predictions can be computed for sigma, nu and tau as well.

- Fixed issue with wrong order of plot x-axis for
`ggeffect()`

, when one term was a character vector.

- The use of
`ggaverage()`

is discouraged, and so it was removed. - The name
`rprs_values()`

is now deprecated, the function is named`values_at()`

, and its alias is`representative_values()`

. - The
`x.as.factor`

-argument defaults to`TRUE`

.

`ggpredict()`

now supports cumulative link and ordinal*vglm*models from package**VGAM**.- More informative error message for
*clmm*-models when`terms`

included random effects. `add.data`

is an alias for the`rawdata`

-argument in`plot()`

.`ggpredict()`

and`ggemmeans()`

now also support predictions for*gam*models from`ziplss`

family.

- Improved
`print()`

-method for ordinal or cumulative link models. - The
`plot()`

-method no longer changes the order of factor levels for groups and facets. `pretty_data()`

gets a`length()`

argument to define the length of intervals to be returned.

- Added “population level” to output from print-method for
*lme*objects. - Fixed issue with correct identification of gamm/gamm4 models.
- Fixed issue with weighted regression models from
*brms*. - Fixed broken tests due to changes of forthcoming
*effects*update.

- Revised docs and vignettes - the use of the term
*average marginal effects*was replaced by a less misleading wording, since the functions of**ggeffects**calculate marginal effects at the mean or at representative values, but not average marginal effects. - Replace references to internal vignettes in docstrings to website-vignettes, so links on website are no longer broken.
`values_at()`

is an alias for`rprs_values()`

.

`betabin`

,`negbin`

(package**aod**),`wbm`

(package*panelr*)

`ggpredict()`

now supports prediction intervals for models from*MCMCglmm*.`ggpredict()`

gets a`back.transform`

-argument, to tranform predicted values from log-transformed responses back to their original scale (the default behaviour), or to allow predictions to remain on log-scale (new).`ggpredict()`

and`ggemmeans()`

now can calculate marginal effects for specific values from up to three terms (i.e.`terms`

can be of lenght four now).- The
`ci.style`

-argument from`plot()`

now also applies to error bars for categorical variables on the x-axis.

- Fixed issue with
*glmmTMB*models that included model weights.

- Better support, including confidence intervals, for some of the already supported model types.
- New package-vignette
*Logistic Mixed Effects Model with Interaction Term*.

`gamlss`

,`geeglm`

(package**geepack**),`lmrob`

and`glmrob`

(package**robustbase**),`ols`

(package**rms**),`rlmer`

(package**robustlmm**),`rq`

and`rqss`

(package**quantreg**),`tobit`

(package**AER**),`survreg`

(package**survival**)

- The steps for specifying a range of values (e.g.
`terms = "predictor [1:10]"`

) can now be changed with`by`

, e.g.`terms = "predictor [1:10 by=.5]"`

(see also vignette*Marginal Effects at Specific Values*). - Robust standard errors for predictions (see argument
`vcov.fun`

in`ggpredict()`

) now also works for following model-objects:`coxph`

,`plm`

,`polr`

(and probably also`lme`

and`gls`

, not tested yet). `ggpredict()`

gets an`interval`

-argument, to compute prediction intervals instead of confidence intervals.`plot.ggeffects()`

now allows different horizontal and vertical jittering for`rawdata`

when`jitter`

is a numeric vector of length two.

- Models with
`AsIs`

-conversion from division of two variables as dependent variable, e.g.`I(amount/frequency)`

, now should work. `ggpredict()`

failed for`MixMod`

-objects when`ci.lvl=NA`

.