
Pool contrasts and comparisons from test_predictions()
Source: R/pool_comparisons.R
pool_comparisons.Rd
This function "pools" (i.e. combines) multiple ggcomparisons
objects, returned
by test_predictions()
, in a similar fashion as mice::pool()
.
Arguments
- x
A list of
ggcomparisons
objects, as returned bytest_predictions()
.- ...
Currently not used.
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)
#> Model-based Contrasts Analysis
#>
#> Level1 | Level2 | Difference | 95% CI | t(20) | p
#> ---------------------------------------------------------------
#> 40-59 | 20-39 | -5.84 | [-10.22, -1.47] | -4.07 | < .001
#> 60-99 | 20-39 | -7.22 | [-12.34, -2.09] | -4.27 | < .001
#> 60-99 | 40-59 | -1.37 | [ -5.53, 2.79] | -0.85 | 0.404
#>
#> Variable predicted: bmi
#> Predictors contrasted: age
#> Predictors averaged: hyp, chl (2e+02)
#>