pool_predictions | R Documentation |
This function "pools" (i.e. combines) multiple estimate_means
objects, in
a similar fashion as mice::pool()
.
pool_predictions(x, transform = NULL, ...)
x |
A list of |
transform |
A function applied to predictions and confidence intervals
to (back-) transform results, which can be useful in case the regression
model has a transformed response variable (e.g., |
... |
Currently not used. |
Averaging of parameters follows Rubin's rules (Rubin, 1987, p. 76).
Pooling is applied to the predicted values on the scale of the linear predictor,
not on the response scale, in order to have accurate pooled estimates and
standard errors. The final pooled predicted values are then transformed to
the response scale, using insight::link_inverse()
.
A data frame with pooled predictions.
Rubin, D.B. (1987). Multiple Imputation for Nonresponse in Surveys. New York: John Wiley and Sons.
# example for multiple imputed datasets
data("nhanes2", package = "mice")
imp <- mice::mice(nhanes2, printFlag = FALSE)
predictions <- lapply(1:5, function(i) {
m <- lm(bmi ~ age + hyp + chl, data = mice::complete(imp, action = i))
estimate_means(m, "age")
})
pool_predictions(predictions)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.