Learn R Programming

ggeffects (version 1.7.1)

pool_comparisons: Pool contrasts and comparisons from test_predictions()

Description

This function "pools" (i.e. combines) multiple ggcomparisons objects, returned by test_predictions(), in a similar fashion as mice::pool().

Usage

pool_comparisons(x, ...)

Value

A data frame with pooled comparisons or contrasts of predictions.

Arguments

x

A list of ggcomparisons objects, as returned by test_predictions().

...

Currently not used.

Details

Averaging of parameters follows Rubin's rules (Rubin, 1987, p. 76).

References

Rubin, D.B. (1987). Multiple Imputation for Nonresponse in Surveys. New York: John Wiley and Sons.

Examples

Run this code
if (FALSE) { # require("mice")
data("nhanes2", package = "mice")
imp <- mice::mice(nhanes2, printFlag = FALSE)
comparisons <- lapply(1:5, function(i) {
  m <- lm(bmi ~ age + hyp + chl, data = mice::complete(imp, action = i))
  test_predictions(m, "age")
})
pool_comparisons(comparisons)
}

Run the code above in your browser using DataLab