tidy.robmedfit: Tidy a robmedfit object (broom-compatible)

View source: R/broom_methods.R

tidy.robmedfitR Documentation

Tidy a robmedfit object (broom-compatible)

Description

Returns a tidy data frame of the mediation effect estimates (NDE, NIE, TE) at the reference dose, with confidence intervals. Compatible with broom::tidy() and the broader tidymodels ecosystem.

Usage

## S3 method for class 'robmedfit'
tidy(x, conf.int = TRUE, ...)

Arguments

x

A robmedfit object.

conf.int

Logical. Include confidence interval columns? Default TRUE.

...

Ignored.

Value

A data frame with columns term, estimate, conf.low, conf.high, and ref_dose.

Examples


fit <- robustmediate(
  treatment_formula = X ~ Z1 + Z2 + Z3,
  mediator_formula  = M ~ X + Z1 + Z2 + Z3,
  outcome_formula   = Y ~ X + M + Z1 + Z2 + Z3,
  data = sim_mediation, R = 50
)
tidy(fit)



RobustMediate documentation built on April 16, 2026, 5:08 p.m.