View source: R/SingleEstimation.R
SingleEstimation | R Documentation |
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, M, Y, m_type, y_type)
m_model |
a fitted model object for the mediator. |
y_model |
a fitted model object for the outcome. |
data |
a dataframe used in the analysis. |
X |
a character variable of the exposure's name. |
M |
a character variable of the mediator's name. |
Y |
a character variable of the outcome's name. |
m_type |
a character variable of the mediator's type. |
y_type |
a character variable of the outcome's 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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.