This function obtains the estimates of mediation effects by the ordinary for loop.
Through bootstrap sampling and repeating the algorithm of function SingleEstimation,
This function obtains a number of estimates for each type of effect.
This is an internal function, automatically called by the function Statistics.
BootEstimation_for (m_model, y_model, data, X, exp0=NULL, exp1=NULL,
M, Y, m_type, y_type, boot_num = 100)This function returns a list of three dataframes, i.e.,
the bootstrapping results of the mediation effects.
This list is also saved in the return of the main function FormalEstmed.
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.
the times of bootstrapping in the analysis. The default is 100.
This function is realized by the ordinary for loop, therefore may take longer time to proceed.
For small amounts of data, e.g., dozens to a hundred samples, with relatively simple models,
for loop is recommended.