Description Usage Arguments Details Value Examples
med_rint
computes NDEr, NIEr and TEr, the random interventional
analogues of the natural direct effect, natural indirect effect and total effect,
in the presence of exposure-induced confounding of M -> Y. Gives bootstrapped confidence
interval. To do: extend to multiple confounders. Might or might not work at the moment.
1 2 |
dat |
The original dataset |
A |
the exposure of interest. Must be binary or categorical |
M |
the mediators of interest. Must be binary or categorical |
Y |
the outcome, currently must be continuous |
C |
confounders of either X -> M and/or M -> Y. Can take any form, specified as formula |
L |
the exposure-induced confounder of the association of M with Y. Must be binary or categorical |
boot |
specifies the number of bootstrap samples drawn to make the confidence intervals. Default is 10 for testing purposes |
quants |
an optional vector of quantiles for the confidence interval (95 percent by default) |
nmin |
number of participants all categories of exposure must have; samples will be redrawn if this criterion is not met |
mids |
an optional mids object to serve as template for imputations |
mlvl |
a matrix or table of probability-mass functions for the mediator, to calculate CDE(M). By default, mlvl is set to the observed sample distributions |
The procedure is described in chapter 5.4.2 of Tyler's book
An S3 object of class cmed.ipw
containing:
nde mean and 95p confidence intervals for NDEr
nie mean and 95p confidence intervals for NIEr
te mean and 95p confidence intervals for the total effect
ter mean and 95p confidence intervals for the random interventional analogue to the total effect
boots a list with nde, nie, te, and ter resutls for each bootstrap sample
raw a list of the duplicated dataset and intermediary propensity scores calculated from original data (not resampled)
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.