est_med | R Documentation |
Estimate mediation effects, including the natural direct effect (NDE), the natural indirect effect (NIE), and the proportion mediated (PM). See references for definitions of these objects.
est_med(
dat,
type = "NP",
t_0,
nde = TRUE,
nie = TRUE,
pm = TRUE,
scale = "RR",
params_np = params_med_np()
)
dat |
A data object returned by load_data |
type |
One of c("NP", "Cox"). This specifies whether to estimate the effects using a marginalized Cox proportional hazards model or using a nonparametric estimator. |
t_0 |
Time point of interest |
nde |
Boolean. If TRUE, the natural direct effect is computed and returned. |
nie |
Boolean. If TRUE, the natural indirect effect is computed and returned. |
pm |
Boolean. If TRUE, the proportion mediated is computed and returned. |
scale |
One of c("RR", "VE"). This determines whether NDE and NIE estimates and CIs are computed on the risk ratio (RR) scale or the vaccine efficacy (VE) scale. The latter equals one minus the former. |
params_np |
A list of options returned by |
A dataframe containing the following columns:
effect
: one of c("NDE", "NIE", "PM")
est
: point estimate
se
: standard error of point estimate
ci_lower
: a confidence interval lower limit
ci_upper
: a confidence interval upper limit
Fay MP and Follmann DA (2023). Mediation Analyses for the Effect of Antibodies in Vaccination <doi:10.48550/arXiv.2208.06465>
data(hvtn505)
dat <- load_data(time="HIVwk28preunblfu", event="HIVwk28preunbl", vacc="trt",
marker="IgG_V2", covariates=c("age","BMI","bhvrisk"),
weights="wt", ph2="casecontrol", data=hvtn505)
ests_np <- est_med(dat=dat, type="NP", t_0=578)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.