This function obtains the estimates of various types of mediation effects for a single time based on one bootstrap sample. This function calculates the effects through different combinations of potential outcomes by the algorithm we proposed.
This is an internal function, automatically called by the function BootEstimation_for or BootEstimation_MT.
SingleEstimation (m_model, y_model, data, X, exp0=NULL, exp1=NULL,
M, Y, m_type, y_type)This function returns a list of three dataframes of mediation effects on risk difference (RD), odds ratio (OR) and risk ratio (RR) scales. Each dataframe has only one single estimate for each effect.
a fitted model object for the mediator.
a fitted model object for the outcome.
a dataframe used in the analysis.
a character variable of the exposure's name.
a numeric variable of the baseline level of the exposure.
a numeric variable of the new level of the exposure.
a character variable of the mediator's name.
a character variable of the outcome's name.
a character variable of the mediator's type.
a character variable of the outcome's type.