Skip to contents

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

Usage

pool_comparisons(x, ...)

Arguments

x

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

...

Currently not used.

Value

A data frame with pooled comparisons or contrasts of predictions.

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

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)
#> # Pairwise comparisons
#> 
#> age         | Contrast |       95% CI |      p
#> ----------------------------------------------
#> 20-39-40-59 |     5.84 |  1.73,  9.96 | < .001
#> 20-39-60-99 |     7.22 |  2.40, 12.03 | < .001
#> 40-59-60-99 |     1.37 | -2.53,  5.28 | 0.404