Package 'RobustMediate'

Title: Causal Mediation Analysis with Diagnostics and Sensitivity Analysis
Description: Provides tools for causal mediation analysis with continuous treatments using inverse probability weighting (IPW). Estimates natural direct and indirect effects over a user-defined treatment grid and supports flexible dose-response mediation analysis. Includes diagnostic procedures for assessing covariate balance in both treatment and mediator models using standardized mean differences. Implements pathway-specific extensions of the impact threshold for a confounding variable (ITCV; Frank, 2000 <doi:10.1177/0049124100029002001>) adapted to mediation settings. Provides joint sensitivity analysis combining E-values (VanderWeele and Ding, 2017 <doi:10.7326/M16-2607>) and violations of sequential ignorability (Imai, Keele, and Yamamoto, 2010 <doi:10.1214/10-STS321>). Additional utilities include visualization of dose-response mediation functions, robustness profiles, fragility summaries, and formatted outputs for applied research. Supports clustered data structures and multiple outcome families.
Authors: Subir Hait [aut, cre] (ORCID: <https://orcid.org/0009-0004-9871-9677>)
Maintainer: Subir Hait <[email protected]>
License: MIT + file LICENSE
Version: 0.1.1
Built: 2026-05-17 07:44:59 UTC
Source: https://github.com/causalfragility-lab/robustmediate

Help Index


RobustMediate: Causal Mediation Analysis with Diagnostics and Sensitivity Analysis

Description

RobustMediate provides a workflow for causal mediation analysis with continuous treatments using inverse probability weighting (IPW), diagnostic tools, and sensitivity analysis.

Main functions include:

  • robustmediate() - Fits treatment, mediator, and outcome models and stores precomputed results for downstream plotting and reporting.

  • plot_balance() - Displays covariate balance before and after weighting for both the treatment and mediator pathways using standardized mean differences.

  • plot_mediation() - Plots estimated natural direct effects (NDE) and natural indirect effects (NIE) over the treatment range, with pointwise uncertainty bands.

  • plot_sensitivity() - Displays a bivariate sensitivity surface based on E-values and sequential ignorability violations parameterized by rho.

  • sensitivity_meditcv() - Computes pathway-specific mediation ITCV (medITCV) diagnostics based on Frank's impact threshold for a confounding variable framework.

  • plot_meditcv() - Displays pathway-specific medITCV robustness corridors for the a-path and b-path.

  • diagnose() - Produces a formatted diagnostic summary of balance, mediation effects, and sensitivity results.

Getting started

library(RobustMediate)

data(sim_mediation)

fit <- robustmediate(
  X ~ Z1 + Z2 + Z3,
  M ~ X + Z1 + Z2 + Z3,
  Y ~ X + M + Z1 + Z2 + Z3,
  data = sim_mediation,
  R = 500
)

plot(fit)
plot(fit, type = "balance")
plot(fit, type = "sensitivity")
plot(fit, type = "meditcv")
diagnose(fit)

Sensitivity interpretation

The E-value x rho surface is a bivariate robustness display rather than a single unified causal model. It is intended to help users examine how large different classes of unmeasured confounding would need to be to attenuate or nullify the estimated indirect effect.

The mediation ITCV (medITCV) is reported separately for the a-path and b-path. The indirect-effect summary is interpreted as a minimum-path robustness bound governed by the weaker pathway.

Author(s)

Maintainer: Subir Hait [email protected] (ORCID)

References

Frank, K. A. (2000). Impact of a confounding variable on a regression coefficient. Sociological Methods & Research, 29(2), 147–194.

Imai, K., Keele, L., & Yamamoto, T. (2010). Identification, inference, and sensitivity analysis for causal mediation effects. Psychological Methods, 15(4), 309–334.

VanderWeele, T. J., & Ding, P. (2017). Sensitivity analysis in observational research: Introducing the E-value. Annals of Internal Medicine, 167(4), 268–274.

See Also

Useful links:


Coerce effects curve to a data frame

Description

Convenience accessor returning the NDE/NIE/TE curve data frame.

Usage

## S3 method for class 'robmedfit'
as.data.frame(x, ...)

Arguments

x

A robmedfit object.

...

Ignored.

Value

A data frame with columns dose, estimand, estimate, lower, upper.


Augment data with fitted values from a robmedfit object (broom-compatible)

Description

Returns the original data augmented with IPW weights, fitted mediator values, and fitted outcome values from the pathway models.

Usage

## S3 method for class 'robmedfit'
augment(x, data = NULL, ...)

Arguments

x

A robmedfit object.

data

Optional data frame to augment. Defaults to the data stored in the outcome model's ⁠$data⁠ slot.

...

Ignored.

Value

The original data frame with additional columns:

.ipw_weight

Stabilised inverse probability weights.

.fitted_mediator

Predicted mediator values.

.fitted_outcome

Predicted outcome values.

.resid_mediator

Residuals from the mediator model.

.resid_outcome

Residuals from the outcome model.

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
)
aug <- augment(fit)
hist(aug$.ipw_weight)

Compare Two robmedfit Objects Side by Side

Description

Overlays the NDE/NIE/TE curves from two robmedfit objects on the same panel. Useful for sensitivity comparisons (e.g. different spline degrees, trimming thresholds, or model specifications).

Usage

compare_fits(
  fit1,
  fit2,
  label1 = "Model 1",
  label2 = "Model 2",
  estimands = c("NDE", "NIE")
)

Arguments

fit1

First robmedfit object.

fit2

Second robmedfit object.

label1

Label for fit1. Default "Model 1".

label2

Label for fit2. Default "Model 2".

estimands

Estimands to display. Default c("NDE","NIE").

Value

A ggplot2 object.

Examples

## Not run: 
fit_a <- robustmediate(X~Z, M~X+Z, Y~X+M+Z, data=dat, spline_df=3, R=200)
fit_b <- robustmediate(X~Z, M~X+Z, Y~X+M+Z, data=dat, spline_df=6, R=200)
compare_fits(fit_a, fit_b, label1="df=3", label2="df=6")

## End(Not run)

Diagnose a robmedfit Object

Description

Prints a formatted diagnostics report covering balance, mediation effects, and sensitivity robustness. The output is structured so that it can be used directly (or with minimal editing) in the Results section of an applied paper. Returns the underlying results invisibly.

Usage

diagnose(x, ...)

Arguments

x

A robmedfit object.

...

Ignored.

Value

Invisibly returns a list with elements balance, effects, sensitivity, meditcv, and meditcv_profile.


Pathway Fragility Decomposition Table

Description

Returns a publication-ready table decomposing indirect-effect robustness into pathway-specific components. Columns follow the medITCV reporting convention: pathway, coefficient, SE, t, df, observed partial r, critical r, medITCV, medITCV%, fragility classification, and tipping-point confounder r.

Usage

fragility_table(x, alpha = 0.05)

Arguments

x

A robmedfit object.

alpha

Significance level. Default 0.05.

Value

A data frame with three rows (a-path, b-path, indirect effect) and columns pathway, coefficient, SE, t_stat, df, r_obs, r_crit, medITCV, medITCV_pct, fragility, tipping_r_confounder, and bottleneck.

Examples

data(sim_mediation)
  fit <- robustmediate(
    X ~ Z1 + Z2, M ~ X + Z1 + Z2, Y ~ X + M + Z1 + Z2,
    data = sim_mediation, R = 20, verbose = FALSE
  )
fragility_table(fit)

Glance at a robmedfit object (broom-compatible)

Description

Returns a one-row summary of the fit: sample size, bootstrap reps, reference dose, percentage mediated, and the two tipping-point sensitivity values.

Usage

## S3 method for class 'robmedfit'
glance(x, ...)

Arguments

x

A robmedfit object.

...

Ignored.

Value

A one-row data frame.

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
)
glance(fit)

Love Plot: Balance Diagnostics for Both Pathways

Description

Produces a publication-ready love plot showing standardised mean differences (SMDs) before and after IPW weighting for both the treatment and mediator pathways — stacked vertically in a single panel. This dual-pathway display is unique to RobustMediate; no other mediation package provides it.

Usage

plot_balance(x, threshold = 0.1, pathways = c("treatment", "mediator"), ...)

Arguments

x

A robmedfit object.

threshold

Absolute SMD threshold displayed as dashed reference lines. Reviewers conventionally accept |SMD| < 0.10. Default 0.1.

pathways

Character vector indicating which pathways to show. Options: "treatment", "mediator", or both (default).

...

Ignored (for S3 consistency).

Value

A ggplot2 object. Add layers or themes as usual.

Examples

## Not run: 
fit <- robustmediate(X ~ Z, M ~ X + Z, Y ~ X + M + Z, data = mydata)
plot_balance(fit)
plot_balance(fit, threshold = 0.05, pathways = "treatment")

## End(Not run)

Plot Dose-Varying Fragility (Curvature-Based Sensitivity)

Description

Three-panel visualisation of dose-varying fragility: (1) effect curve with CI bands and fragility zones, (2) local fragility index, (3) normalised curvature.

Usage

plot_curvature(x, estimand = "NIE", ref_dose = NULL, ...)

Arguments

x

Data frame from sensitivity_curvature().

estimand

Label for the estimand. Default "NIE".

ref_dose

Optional reference dose vertical line.

...

Ignored.

Value

A ggplot2 object.

Examples

data(sim_mediation)
  fit <- robustmediate(
    X ~ Z1 + Z2, M ~ X + Z1 + Z2, Y ~ X + M + Z1 + Z2,
    data = sim_mediation, R = 20, verbose = FALSE
  )
curv <- sensitivity_curvature(fit)
plot_curvature(curv, ref_dose = fit$meta$ref_dose)

Dose-Response Curve: Natural Direct and Indirect Effects

Description

Plots NDE, NIE, and (optionally) total effect as smooth spline curves over the full range of treatment values, with pointwise bootstrap confidence bands. This is the signature visualisation of RobustMediate and is publication-ready out of the box.

Usage

plot_mediation(
  x,
  estimands = c("NDE", "NIE"),
  show_total = FALSE,
  facet = FALSE,
  ...
)

Arguments

x

A robmedfit object.

estimands

Character vector of estimands to display. Any subset of c("NDE", "NIE", "TE"). Default c("NDE","NIE").

show_total

Shorthand for adding "TE" to estimands. Default FALSE.

facet

Logical. Split estimands into separate facets? Default FALSE.

...

Ignored.

Value

A ggplot2 object.

Examples

## Not run: 
fit <- robustmediate(X ~ Z, M ~ X + Z, Y ~ X + M + Z, data = mydata)
plot_mediation(fit)
plot_mediation(fit, estimands = c("NDE","NIE","TE"), facet = TRUE)

## End(Not run)

Plot medITCV robustness corridors for both mediation pathways

Description

Produces a two-panel pathway-specific robustness corridor plot showing the observed partial correlation, critical partial correlation threshold, medITCV corridor, and benchmark confounder impacts for each pathway.

Usage

plot_meditcv(x, ...)

Arguments

x

A meditcv object from sensitivity_meditcv().

...

Ignored.

Value

A ggplot2 object.

Examples

data(sim_mediation)
  fit <- robustmediate(
    X ~ Z1 + Z2, M ~ X + Z1 + Z2, Y ~ X + M + Z1 + Z2,
    data = sim_mediation, R = 20, verbose = FALSE
  )
med <- sensitivity_meditcv(fit)
plot_meditcv(med)

Plot the medITCV Robustness Profile

Description

Visualises how each pathway's partial correlation is attenuated as confounding impact delta increases, with tipping points and a fragility zone marked.

Usage

plot_meditcv_profile(x, ...)

Arguments

x

A meditcv_profile object from sensitivity_meditcv_profile().

...

Ignored.

Value

A ggplot2 object.

Examples

data(sim_mediation)
  fit <- robustmediate(
    X ~ Z1 + Z2, M ~ X + Z1 + Z2, Y ~ X + M + Z1 + Z2,
    data = sim_mediation, R = 20, verbose = FALSE
  )
mp  <- sensitivity_meditcv_profile(fit)
plot_meditcv_profile(mp)

Sensitivity Contour Plot: Joint E-value x Rho Display

Description

Renders the novel bivariate robustness map unique to RobustMediate: a 2-D heatmap where the x-axis is the E-value (VanderWeele-style unmeasured treatment–outcome confounding) and the y-axis is Imai's sequential-ignorability violation parameter rho. Contour lines show where the mediation effect crosses zero, so readers can judge robustness to two different sensitivity dimensions simultaneously.

This visualisation does not exist elsewhere in the R ecosystem. The correct interpretation is as a bivariate robustness display, not a joint causal model — see the package paper for theoretical justification.

Usage

plot_sensitivity(
  x,
  annotate_zero = TRUE,
  n_breaks = 12,
  palette = "RdYlGn",
  ...
)

Arguments

x

A robmedfit object.

annotate_zero

Logical. Draw a bold dashed zero-crossing contour? Default TRUE. Highly recommended for applied papers.

n_breaks

Number of fill colour breaks in the heatmap. Default 12.

palette

RColorBrewer palette name. Default "RdYlGn".

...

Ignored.

Value

A ggplot2 object.

Examples

## Not run: 
fit <- robustmediate(X ~ Z, M ~ X + Z, Y ~ X + M + Z, data = mydata)
plot_sensitivity(fit)
plot_sensitivity(fit, annotate_zero = FALSE, palette = "PuOr")

## End(Not run)

Plot a robmedfit object

Description

Dispatches to the appropriate plot function based on type.

Usage

## S3 method for class 'robmedfit'
plot(
  x,
  type = c("mediation", "balance", "sensitivity", "meditcv", "meditcv_profile",
    "curvature"),
  ...
)

Arguments

x

A robmedfit object.

type

Which plot to produce. One of:

"mediation"

Dose-response curve of NDE/NIE/TE (default).

"balance"

Dual love plot of covariate balance.

"sensitivity"

E-value x rho sensitivity contour.

"meditcv"

Pathway-specific medITCV robustness corridor.

"meditcv_profile"

medITCV robustness profile (fragility decomposition).

"curvature"

Dose-varying fragility (curvature-based sensitivity).

...

Passed to the underlying plot function.

Value

A ggplot2 object.


Print a meditcv object

Description

Print a meditcv object

Usage

## S3 method for class 'meditcv'
print(x, ...)

Arguments

x

A meditcv object from sensitivity_meditcv().

...

Ignored.

Value

The input object, invisibly. Called for its side effect of printing a formatted medITCV report to the console.


Print a meditcv_profile object

Description

Print a meditcv_profile object

Usage

## S3 method for class 'meditcv_profile'
print(x, ...)

Arguments

x

A meditcv_profile object from sensitivity_meditcv_profile().

...

Ignored.

Value

The input object, invisibly. Called for its side effect of printing a formatted medITCV robustness profile to the console.


Print a robmedfit object

Description

Print a robmedfit object

Usage

## S3 method for class 'robmedfit'
print(x, ...)

Arguments

x

A robmedfit object returned by robustmediate().

...

Ignored.

Value

The input object, invisibly.


Robust Causal Mediation Analysis

Description

Fits treatment, mediator, and outcome models for causal mediation analysis with continuous treatments using inverse probability weighting (IPW), and returns a precomputed robmedfit object for plotting and diagnostics.

Usage

robustmediate(
  treatment_formula,
  mediator_formula,
  outcome_formula,
  data,
  ref_dose = NULL,
  dose_grid = NULL,
  R = 500,
  alpha = 0.05,
  covariates = NULL,
  cluster_var = NULL,
  family_treatment = stats::gaussian(),
  family_mediator = stats::gaussian(),
  family_outcome = stats::gaussian(),
  spline_df = 4,
  evalue_seq = seq(1, 10, by = 0.25),
  rho_seq = seq(-1, 1, by = 0.05),
  verbose = TRUE
)

Arguments

treatment_formula

Formula for the treatment model (for example, X ~ Z1 + Z2).

mediator_formula

Formula for the mediator model (for example, M ~ X + Z1 + Z2).

outcome_formula

Formula for the outcome model (for example, Y ~ X + M + Z1 + Z2).

data

A data frame containing all analysis variables.

ref_dose

Reference dose value. Defaults to the sample mean of the treatment variable.

dose_grid

Numeric vector of dose values over which NDE, NIE, and TE are evaluated. Defaults to 100 evenly spaced points across the observed treatment range.

R

Number of bootstrap replicates. Default is 500.

alpha

Significance level. Default is 0.05.

covariates

Covariate names for balance diagnostics. If NULL, covariates are inferred from the treatment formula.

cluster_var

Optional clustering variable name. NULL assumes independent observations.

family_treatment

GLM family for the treatment model. Default is stats::gaussian().

family_mediator

GLM family for the mediator model. Default is stats::gaussian().

family_outcome

GLM family for the outcome model. Default is stats::gaussian().

spline_df

Degrees of freedom for spline-based effect summaries. Default is 4.

evalue_seq

Sequence of E-values used to build the sensitivity surface. Default is seq(1, 10, by = 0.25).

rho_seq

Sequence of rho values used to build the sensitivity surface. Default is seq(-1, 1, by = 0.05).

verbose

Logical; if TRUE, display progress messages.

Value

An object of class "robmedfit" containing:

models

Fitted treatment, mediator, and outcome models.

balance

Balance statistics before and after weighting.

effects

Dose-response summaries for NDE, NIE, and TE, including bootstrap intervals.

sensitivity

Bivariate E-value and rho sensitivity surface.

meditcv

Pathway-specific medITCV object from sensitivity_meditcv().

meditcv_profile

medITCV robustness profile from sensitivity_meditcv_profile().

cluster

Cluster information, or NULL if clustering was not used.

meta

Call, variable names, dose settings, bootstrap settings, and sample information.

Examples

n <- 400
Z1 <- rnorm(n)
Z2 <- rbinom(n, 1, 0.5)
X  <- 0.5 * Z1 + 0.3 * Z2 + rnorm(n)
M  <- 0.4 * X + 0.2 * Z1 + rnorm(n)
Y  <- 0.3 * X + 0.5 * M + 0.1 * Z1 + rnorm(n)
dat <- data.frame(Y, X, M, Z1, Z2)

fit <- robustmediate(
  treatment_formula = X ~ Z1 + Z2,
  mediator_formula = M ~ X + Z1 + Z2,
  outcome_formula = Y ~ X + M + Z1 + Z2,
  data = dat,
  R = 100
)

print(fit)

Dose-Varying Fragility: Curvature-Based Sensitivity

Description

Computes the fragility curvature of the mediation effect across the full treatment dose grid. Returns local fragility index, numerical curvature of the effect curve, and a fragility zone flag at each dose value.

Usage

sensitivity_curvature(x, estimand = c("NIE", "NDE", "TE"))

Arguments

x

A robmedfit object.

estimand

Which estimand to analyse: "NIE" (default), "NDE", or "TE".

Value

A data frame with columns dose, estimate, lower, upper, se_approx, frag_local, curvature, and in_fragility_zone.

See Also

plot_curvature(), sensitivity_meditcv_profile()

Examples

data(sim_mediation)
  fit <- robustmediate(
    X ~ Z1 + Z2, M ~ X + Z1 + Z2, Y ~ X + M + Z1 + Z2,
    data = sim_mediation, R = 20, verbose = FALSE
  )
curv <- sensitivity_curvature(fit, estimand = "NIE")
plot_curvature(curv)

Mediation ITCV (medITCV) for pathway-specific robustness

Description

Computes a mediation-specific extension of Kenneth Frank's (2000) Impact Threshold for a Confounding Variable (ITCV) for both pathways of a mediation model:

  • a-path: treatment -> mediator

  • b-path: mediator -> outcome (controlling for treatment)

The mediation ITCV (medITCV) quantifies how strong an unmeasured confounder would need to be, in terms of the product rXCrYCr_{XC} \cdot r_{YC}, to invalidate inference for each pathway.

Usage

sensitivity_meditcv(x, alpha = 0.05)

Arguments

x

A robmedfit object returned by robustmediate().

alpha

Significance level. Default is 0.05.

Value

An object of class "meditcv": a named list with elements a_path, b_path, indirect, and alpha. Each pathway element contains the observed partial correlation, critical partial correlation, medITCV value, and benchmark confounder impacts.

References

Frank, K. A. (2000). Impact of a confounding variable on a regression coefficient. Sociological Methods & Research, 29(2), 147–194.

See Also

plot_meditcv(), print.meditcv()

Examples

data(sim_mediation)
  fit <- robustmediate(
    X ~ Z1 + Z2, M ~ X + Z1 + Z2, Y ~ X + M + Z1 + Z2,
    data = sim_mediation, R = 20, verbose = FALSE
  )
med <- sensitivity_meditcv(fit)
print(med)
plot_meditcv(med)

medITCV Robustness Profile: Pathway-Specific Fragility Framework

Description

Implements the medITCV robustness profile, a formal extension of Frank's ITCV to causal mediation. Computes pathway-specific fragility thresholds, applies the minimum robustness principle, and identifies the bottleneck pathway that governs indirect-effect fragility.

Usage

sensitivity_meditcv_profile(
  x,
  alpha = 0.05,
  delta_grid = seq(0, 0.5, by = 0.01)
)

Arguments

x

A robmedfit object.

alpha

Significance level. Default 0.05.

delta_grid

Numeric vector of confounding impact values over which the robustness profile is evaluated. Default seq(0, 0.5, by = 0.01).

Value

An object of class "meditcv_profile": a named list with elements a_path, b_path, meditcv_indirect, bottleneck, robustness_profile, fragility_ratio, meditcv_detail, and alpha.

References

Frank, K. A. (2000). Impact of a confounding variable on a regression coefficient. Sociological Methods & Research, 29(2), 147–194.

See Also

sensitivity_meditcv(), plot_meditcv_profile(), sensitivity_curvature()

Examples

data(sim_mediation)
  fit <- robustmediate(
    X ~ Z1 + Z2, M ~ X + Z1 + Z2, Y ~ X + M + Z1 + Z2,
    data = sim_mediation, R = 20, verbose = FALSE
  )
mp  <- sensitivity_meditcv_profile(fit)
print(mp)
plot_meditcv_profile(mp)

Simulated Mediation Study Data

Description

A synthetic dataset mimicking a clustered education study with a continuous treatment (tutoring hours), a continuous mediator (mid-year test score), and a continuous outcome (end-of-year test score). Designed to illustrate RobustMediate with realistic effect sizes and non-trivial confounding.

Usage

sim_mediation

Format

A data frame with 600 rows (30 schools x 20 students) and 7 columns:

school

Factor. School identifier (30 levels). Use as cluster_var.

Y

Numeric. End-of-year test score (outcome).

X

Numeric. Tutoring hours received (continuous treatment, >= 0).

M

Numeric. Mid-year test score (mediator).

Z1

Numeric. Prior achievement (continuous covariate).

Z2

Integer (0/1). Free-lunch status (binary covariate).

Z3

Numeric. Parental education index (continuous covariate).

True parameter targets

The data-generating process sets:

  • NDE (X → Y direct path) ~= 0.25

  • NIE (X → M → Y path) ~= 0.35

  • TE ~= 0.60

  • % mediated ~= 58%

Use these as a ground truth to assess estimation accuracy.

Source

Generated via data-raw/generate_sim_data.R. See that script for the full data-generating process.

Examples

data(sim_mediation)
str(sim_mediation)
summary(sim_mediation[, c("Y","X","M")])

## Not run: 
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,
  cluster_var = "school",
  R           = 500
)
diagnose(fit)

## End(Not run)

Summary method for robmedfit objects

Description

Summary method for robmedfit objects

Usage

## S3 method for class 'robmedfit'
summary(object, ...)

Arguments

object

A robmedfit object.

...

Ignored.

Value

A list with effect, balance, and sensitivity summaries, invisibly.


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)

Extract Tipping-Point Table

Description

Returns a formatted data frame of sensitivity tipping points: the minimum E-value and minimum |rho| required to nullify the NIE. Designed for direct insertion into a table in a manuscript.

Usage

tipping_table(x)

Arguments

x

A robmedfit object.

Value

A data frame with columns parameter, tipping_value, interpretation.