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.
Usage
est_med(
dat,
type = "NP",
t_0,
nde = TRUE,
nie = TRUE,
pm = TRUE,
scale = "RR",
params_np = params_med_np()
)
Arguments
- 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
params_med_np
that are relevant if type="NP".
Value
A dataframe containing the following columns:
effect
: one of c("NDE", "NIE", "PM")est
: point estimatese
: standard error of point estimateci_lower
: a confidence interval lower limitci_upper
: a confidence interval upper limit