lee_bounds.RdComputes 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
)A data frame containing the data.
Character. Name of the treatment variable in df.
Character. Name of the mediator variable in df.
Character. Name of the outcome variable in df.
Character or NULL. Name of the cluster variable
for clustered bootstrapping. Default NULL.
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.
Character. Units of the outcome variable (for labeling).
Default "".
Integer. Number of bootstrap draws. Default 1000.
A data frame with columns term, estimate,
std.error summarizing the computed bounds.
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
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.
if (FALSE) { # \dontrun{
data(example_data)
summarized_bounds <- lee_bounds(
df = example_data, d = "treatment",
m = "mediator", y = "outcome"
)
} # }