Description Usage Arguments Value Examples
med_iptw
Computes CDE(M) for given mediator levels, in a setting with an exposure-induced confounder of
the mediator-outcome association. Described in chapter 5.3.1 of Tyler's book
1 2 3 |
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 confounders of the association of M with Y. Can take any form |
boot |
specifies the number of bootstrap samples drawn to make the confidence intervals |
nmin |
number of participants all categories of exposure must have; samples will be redrawn if this criterion is not met |
quants |
an optional vector of quantiles for the confidence interval (95 percent by default) |
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 |
mids |
an optional mids object to serve as template for imputations |
An S3 object of class cmed.ipw
containing:
w the ipw used in the marginal strucutral model
cde.int an array where cde.int[i,,] indexes a matrix corresponding to the CDE calculated for a PMF of M given in mlvl, with each row a bootsrap replicate
cde.noint a matrix of cde given no M*A interaction, with each row a bootstrap replicate
te a matrix of total effects, with each row a bootstrap replicate
ymod1 the marginal strucutral model of Y given no interaction
ymod2 the marginal strucutral model of Y allowing a A*M interaction
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.