Skip to contents

Walks every node that drm_sem() derived an imputation model for and returns the engine's missing-predictor table, stacked, with a node column. Omitting variable stacks every imputed parent — it never silently returns the first mi() term only. Branch on uncertainty_status, never on is.na(std_error): observed rows and se = FALSE requests report std_error = NA with status "ok". This is not multiple imputation, not Rubin's rules, and not full-information maximum likelihood across the SEM.

Usage

imputed(object, ...)

# S3 method for class 'drm_sem'
imputed(
  object,
  variable = NULL,
  node = NULL,
  rows = c("missing", "all"),
  se = TRUE,
  ...
)

Arguments

object

A drm_sem object.

...

Unused.

variable

Optional parent name. When omitted, every imputed parent is stacked.

node

Optional endogenous node name that restricts the stack.

rows

"missing" or "all", forwarded to the engine.

se

Logical; forwarded to the engine.

Value

A data frame with node plus the engine columns variable, original_row, model_row, observed, estimate, std_error, source, and uncertainty_status. Zero rows when nothing was imputed.

See also

Examples

if (FALSE) { # \dontrun{
sem <- drm_sem(
  m = drm_node(drmTMB::bf(m ~ x)),
  y = drm_node(drmTMB::bf(y ~ m + x)),
  data = dat, impute = "auto"
)
imputed(sem)
imputed(sem, variable = "m", rows = "all")
} # }