ds.mediate | R Documentation |
This function is similar to R function mediate
from the
mediation
package.
ds.mediate( model.m = NULL, model.y = NULL, treat = NULL, mediator = NULL, boot = FALSE, conf.level = 0.95, robustSE = FALSE, sims = 1000, seed = NULL, newobj = NULL, datasources = NULL )
model.m |
a string character, the name of a fitted model object for mediator. |
model.y |
a string character, the name of a fitted model object for outcome. |
treat |
a character string indicating the name of the treatment variable used in the models. The treatment can be either binary (integer or a two-valued factor) or continuous (numeric). |
mediator |
a character string indicating the name of the mediator variable used in the models. |
boot |
a logical value. if 'FALSE' a quasi-Bayesian approximation is used for confidence intervals; if 'TRUE' nonparametric bootstrap will be used. Default is 'FALSE'. |
conf.level |
the level of the returned two-sided confidence intervals. Default is to return the 2.5 and 97.5 percentiles of the simulated quantities. |
robustSE |
a logical value. If 'TRUE', heteroskedasticity-consistent standard errors will be used in quasi-Bayesian simulations. Ignored if 'boot' is 'TRUE' or neither 'model.m' nor 'model.y' has a method for vcovHC in the sandwich package. Default is 'FALSE'. |
sims |
a number of Monte Carlo draws for nonparametric bootstrap or quasi-Bayesian approximation. |
seed |
a number of a seed random number generator. Default value is NULL. |
newobj |
a character string that provides the name for the output object
that is stored on the data servers. Default |
datasources |
a list of |
The function 'mediate' is used to estimate various quantities for causal mediation analysis, including average causal mediation effects (indirect effect), average direct effects, proportions mediated, and total effect.
a summary table of the object of class 'mediate'.
Demetris Avraam, for DataSHIELD Development Team
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.