Skip to content

Commit 5b60de3

Browse files
committed
docs
1 parent 9e9065f commit 5b60de3

File tree

5 files changed

+46
-20
lines changed

5 files changed

+46
-20
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: modelbased
33
Title: Estimation of Model-Based Predictions, Contrasts and Means
4-
Version: 0.8.9.1
4+
Version: 0.8.9.2
55
Authors@R:
66
c(person(given = "Dominique",
77
family = "Makowski",

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
- Deprecated argument and function names have been removed.
66

7+
- Argument `fixed` has been removed, as you can fix predictor at certain values
8+
using the `by` argument.
9+
10+
## Major Changes
11+
12+
- The `"marginaleffects"` backend for `estimate_means()` is now fully implemented
13+
and no longer work-in-progress.
14+
715
# modelbased 0.8.9
816

917
- Fixed issues related to updates of other *easystats* packages.

R/estimate_means.R

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@
77
#'
88
#' @inheritParams get_emmeans
99
#' @inheritParams parameters::model_parameters.default
10-
#' @param backend Whether to use 'emmeans' or 'marginaleffects' as a backend.
11-
#' The latter is experimental and some features might not work.
10+
#' @param backend Whether to use `"emmeans"` or `"marginaleffects"` as a backend.
11+
#' Results are usually very similar. The major difference will be found for mixed
12+
#' models, where `backend = "marginaleffects"` will also average across random
13+
#' effects levels, producing "marginal predictions" (instead of "conditional
14+
#' predictions", see Heiss 2022).
1215
#' @inherit estimate_slopes details
1316
#'
14-
#' @examplesIf require("emmeans", quietly = TRUE)
17+
#' @return A data frame of estimated marginal means.
18+
#'
19+
#' @references
20+
#' Heiss, A. (2022). Marginal and conditional effects for GLMMs with
21+
#' {marginaleffects}. Andrew Heiss. \doi{10.59350/xwnfm-x1827}
22+
#'
23+
#' @examplesIf all(insight::check_if_installed(c("emmeans", "see", "lme4"), quietly = TRUE))
1524
#' library(modelbased)
1625
#'
1726
#' # Frequentist models
@@ -29,21 +38,20 @@
2938
#' # Methods that can be applied to it:
3039
#' means <- estimate_means(model, by = c("Species", "Sepal.Width=0"))
3140
#'
32-
#' @examplesIf require("see") && require("emmeans", quietly = TRUE)
3341
#' plot(means) # which runs visualisation_recipe()
34-
#'
3542
#' standardize(means)
3643
#'
37-
#' @examplesIf require("lme4") && require("emmeans", quietly = TRUE)
3844
#' \donttest{
3945
#' data <- iris
4046
#' data$Petal.Length_factor <- ifelse(data$Petal.Length < 4.2, "A", "B")
4147
#'
42-
#' model <- lmer(Petal.Length ~ Sepal.Width + Species + (1 | Petal.Length_factor), data = data)
48+
#' model <- lme4::lmer(
49+
#' Petal.Length ~ Sepal.Width + Species + (1 | Petal.Length_factor),
50+
#' data = data
51+
#' )
4352
#' estimate_means(model)
4453
#' estimate_means(model, by = "Sepal.Width", length = 3)
4554
#' }
46-
#' @return A data frame of estimated marginal means.
4755
#' @export
4856
estimate_means <- function(model,
4957
by = "auto",

man/estimate_contrasts.Rd

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/estimate_means.Rd

Lines changed: 16 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)