pool_contrasts: Pool contrasts and comparisons from 'estimate_contrasts()'

View source: R/pool.R

pool_contrastsR Documentation

Pool contrasts and comparisons from estimate_contrasts()

Description

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

Usage

pool_contrasts(x, ...)

Arguments

x

A list of estimate_contrasts objects, as returned by estimate_contrasts().

...

Currently not used.

Details

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

Value

A data frame with pooled comparisons or contrasts of predictions.

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))
  estimate_contrasts(m, "age")
})
pool_contrasts(comparisons)


easystats/estimate documentation built on April 5, 2025, 1:36 p.m.