pool.table | R Documentation |
Combines estimates from a tidy table
pool.table(
w,
type = c("all", "minimal", "tests"),
conf.int = TRUE,
conf.level = 0.95,
exponentiate = FALSE,
dfcom = Inf,
custom.t = NULL,
rule = c("rubin1987", "reiter2003"),
...
)
w |
A |
type |
A string, either |
conf.int |
Logical indicating whether to include a confidence interval. |
conf.level |
Confidence level of the interval, used only if
|
exponentiate |
Flag indicating whether to exponentiate the coefficient estimates and confidence intervals (typical for logistic regression). |
dfcom |
A positive number representing the degrees of freedom of the
residuals in the complete-data analysis. The |
custom.t |
A custom character string to be parsed as a calculation
rule for the total variance |
rule |
A string indicating the pooling rule. Currently supported are
|
... |
Arguments passed down |
The input data w
is a data.frame
with columns named:
term | a character or factor with the parameter names |
estimate | a numeric vector with parameter estimates |
std.error | a numeric vector with standard errors of estimate |
residual.df | a numeric vector with the degrees of freedom |
Columns 1-3 are obligatory. Column 4 is optional. Usually,
all entries in column 4 are the same. The user can omit column 4,
and specify argument pool.table(..., dfcom = ...)
instead.
If both are given, then column residual.df
takes precedence.
If neither are specified, then mice
tries to calculate the
residual degrees of freedom. If that fails (e.g. because there is
no information on sample size), mice
sets dfcom = Inf
.
The value dfcom = Inf
is acceptable for large samples
(n > 1000) and relatively concise parametric models.
pool.table()
returns a data.frame
with aggregated
estimates, standard errors, confidence intervals and statistical tests.
The meaning of the columns is as follows:
term | Parameter name |
m | Number of multiple imputations |
estimate | Pooled complete data estimate |
std.error | Standard error of estimate |
statistic | t-statistic = estimate / std.error |
df | Degrees of freedom for statistic |
p.value | One-sided P-value under null hypothesis |
conf.low | Lower bound of c.i. (default 95 pct) |
conf.high | Upper bound of c.i. (default 95 pct) |
riv | Relative increase in variance |
fmi | Fraction of missing information |
ubar | Within-imputation variance of estimate |
b | Between-imputation variance of estimate |
t | Total variance, of estimate |
dfcom | Residual degrees of freedom in complete data |
# conventional mice workflow
imp <- mice(nhanes2, m = 2, maxit = 2, seed = 1, print = FALSE)
fit <- with(imp, lm(chl ~ age + bmi + hyp))
pld1 <- pool(fit)
pld1$pooled
# using pool.table() on tidy table
tbl <- summary(fit)[, c("term", "estimate", "std.error", "df.residual")]
tbl
pld2 <- pool.table(tbl, type = "minimal")
pld2
identical(pld1$pooled, pld2)
# conventional workflow: all numerical output
all1 <- summary(pld1, type = "all", conf.int = TRUE)
all1
# pool.table workflow: all numerical output
all2 <- pool.table(tbl)
all2
class(all1) <- "data.frame"
identical(all1, all2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.