This function "pools" (i.e. combines) multiple ggeffects
objects, in
a similar fashion as mice::pool()
.
pool_predictions(x, ...)
x | A list of |
---|---|
... | Currently not used. |
A data frame with pooled predictions.
Averaging of parameters follows Rubin's rules (Rubin, 1987, p. 76).
Rubin, D.B. (1987). Multiple Imputation for Nonresponse in Surveys. New York: John Wiley and Sons.
# example for multiple imputed datasets if (require("mice")) { data("nhanes2") imp <- mice(nhanes2, printFlag = FALSE) predictions <- lapply(1:5, function(i) { m <- lm(bmi ~ age + hyp + chl, data = complete(imp, action = i)) ggpredict(m, "age") }) pool_predictions(predictions) }#>#> #>#>#> #>#>#> #>#> # Predicted values of bmi #> # x = age #> #> x | Predicted | 95% CI #> ---------------------------------- #> 20-39 | 29.11 | [27.15, 31.07] #> 40-59 | 23.68 | [20.96, 26.41] #> 60-99 | 22.62 | [18.98, 26.26] #> #> Adjusted for: #> * hyp = no #> * chl = 191.65