parameter_estimates: A column matrix of β, γ, and θ parameter values obtained from a COMMA analysis function. Parameter estimates should be supplied in the following order: 1) β
(intercept, slope), 2) γ (intercept and slope from the M = 1 mechanism, intercept and slope from the M = 2 mechanism), and 3) θ
(intercept, slope, coefficient for x, slope coefficient for m, slope coefficient for c, and, optionally, slope coefficient for xm if using).
sigma_estimate: A numeric value specifying the estimated standard deviation. Default is 1.
n_bootstrap: A numeric value specifying the number of bootstrap samples to draw.
n_parallel: A numeric value specifying the number of parallel cores to run the computation on.
x_matrix: A numeric matrix of predictors in the true mediator and outcome mechanisms. x_matrix should not contain an intercept and no values should be NA.
z_matrix: A numeric matrix of covariates in the observation mechanism. z_matrix should not contain an intercept and no values should be NA.
c_matrix: A numeric matrix of covariates in the true mediator and outcome mechanisms. c_matrix should not contain an intercept and no values should be NA.
tolerance: A numeric value specifying when to stop estimation, based on the difference of subsequent log-likelihood estimates. The default is 1e-7.
max_em_iterations: A numeric value specifying when to stop estimation, based on the difference of subsequent log-likelihood estimates. The default is 1e-7.
em_method: A character string specifying which EM algorithm will be applied. Options are "em", "squarem", or "pem". The default and recommended option is "squarem".
random_seed: A numeric value specifying the random seed to set for bootstrap sampling. Default is NULL.
Returns
COMMA_OLS_bootstrap_SE returns a list with two elements: 1) bootstrap_df and 2) bootstrap_SE. bootstrap_df is a data frame containing COMMA_OLS output for each bootstrap sample. bootstrap_SE
is a data frame containing bootstrap standard error estimates for each parameter.