Computes and summarizes the Lee bounds on the average direct effect for always-takers (ATs). Requires the MedBounds package (archived) or its successor TestMechs. Applies bootstrapping to estimate standard errors of the bounds.

lee_bounds(
  df,
  d,
  m,
  y,
  cluster = NULL,
  c_at_ratio = NULL,
  units = "",
  numdraws = 1000
)

Arguments

df

A data frame containing the data.

d

Character. Name of the treatment variable in df.

m

Character. Name of the mediator variable in df.

y

Character. Name of the outcome variable in df.

cluster

Character or NULL. Name of the cluster variable for clustered bootstrapping. Default NULL.

c_at_ratio

Numeric or NULL. Specifies the ratio \(E[Y(1,1)|C] / E[Y(1,1)|AT]\). If specified, the direct effect for ATs is point-identified.

units

Character. Units of the outcome variable (for labeling). Default "".

numdraws

Integer. Number of bootstrap draws. Default 1000.

Value

A data frame with columns term, estimate, std.error summarizing the computed bounds.

Note

This function requires the MedBounds package (by Jonathan Roth), which is not available on CRAN. The original package has been renamed to TestMechs on GitHub, but the API has changed significantly. You may need an archived version of MedBounds. See: https://github.com/jonathandroth/TestMechs

References

Roth, J., & Sant'Anna, P. H. C. (2023). Efficient estimation when a nuisance parameter is estimated on a validation sample. Journal of the American Statistical Association, 118(544), 1665-1678.

Examples

if (FALSE) { # \dontrun{
data(example_data)
summarized_bounds <- lee_bounds(
  df = example_data, d = "treatment",
  m = "mediator", y = "outcome"
)
} # }