combine: Combine results using Rubin's rules

View source: R/client.R

combineR Documentation

Combine results using Rubin's rules

Description

Runs a GLM across all stored imputations and combines the results using Rubin's combination rules for multiple imputation inference.

Usage

combine(
  model_id,
  y,
  ind_vars = NULL,
  dof_adjust = TRUE,
  incl_constant = TRUE,
  ...
)

Arguments

model_id

A character model ID, or a fitted model object (list with a ⁠$model_id⁠ element) as returned by midas_fit() or midas().

y

Character. Name of the outcome variable.

ind_vars

Character vector of independent variable names, or NULL for all non-outcome columns.

dof_adjust

Logical. Apply Barnard-Rubin degrees-of-freedom adjustment (default TRUE).

incl_constant

Logical. Include an intercept (default TRUE).

...

Arguments forwarded to ensure_server().

Value

A data frame with columns term, estimate, std.error, statistic, df, and p.value.

Examples

## Not run: 
df <- data.frame(Y = rnorm(200), X1 = rnorm(200), X2 = rnorm(200))
df$X1[sample(200, 40)] <- NA
fit <- midas_fit(df, epochs = 10L)
midas_transform(fit, m = 10)
results <- combine(fit, y = "Y")
results

## End(Not run)

rMIDAS2 documentation built on March 12, 2026, 9:07 a.m.