Generate Bootstrap Samples for Estimating Standard Errors
COMMA_boot_sample(
parameter_estimates,
sigma_estimate = 1,
outcome_distribution,
interaction_indicator,
x_matrix,
z_matrix,
c_matrix
)COMMA_boot_sample returns a list with the bootstrap sample data:
A vector of observed mediator values.
A vector of true mediator values.
A vector of outcome values.
A matrix of predictor values in the true mediator mechanism. Identical to that supplied by the user.
A matrix of predictor values in the observed mediator mechanism. Identical to that supplied by the user.
A matrix of covariates. Identical to that supplied by the user.
A column matrix of \(\beta\), \(\gamma\),
and \(\theta\) parameter values obtained from a COMMA analysis function.
Parameter estimates should be supplied in the following order: 1) \(\beta\)
(intercept, slope), 2) \(\gamma\) (intercept and slope from the M = 1
mechanism, intercept and slope from the M = 2 mechanism), and 3) \(\theta\)
(intercept, slope, coefficient for x, slope coefficient for m,
slope coefficient for c, and, optionally, slope coefficient for
xm if using).
A numeric value specifying the estimated
standard deviation. This value is only required if outcome_distribution
is "Normal". Default is 1. For non-Normal outcome distributions, the
value should be NULL.
A character string specifying the distribution of
the outcome variable. Options are "Bernoulli", "Normal", or
"Poisson".
A logical value indicating if an interaction between
x and m should be used to generate the outcome variable, y.
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.
A numeric matrix of covariates in the observation mechanism.
z_matrix should not contain an intercept and no values should be NA.
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.