Likelihood Function for Normal Outcome Mechanism with a Binary Mediator
theta_optim.Rd
Likelihood Function for Normal Outcome Mechanism with a Binary Mediator
Arguments
- param_start
A numeric vector or column matrix of starting values for the \(\theta\) parameters in the outcome mechanism and \(\sigma\) parameter. The number of elements in
param_start
should be equal to the number of columns ofx_matrix
andc_matrix
plus 2 (ifinteraction_indicator
isFALSE
) or 3 (ifinteraction_indicator
isTRUE
). Starting values should be provided in the following order: intercept, slope coefficient for thex_matrix
term, slope coefficient for the mediatorm
term, slope coefficient for first column of thec_matrix
, ..., slope coefficient for the final column of thec_matrix
, and, optionally, slope coefficient forxm
). The final entry should be the starting value for \(\sigma\).- m
A vector or column matrix containing the true binary mediator or the E-step weight (with values between 0 and 1). There should be no
NA
terms.- x
A vector or column matrix of the predictor or exposure of interest. There should be no
NA
terms.- 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 beNA
.- outcome
A vector containing the outcome variables of interest. There should be no
NA
terms.- sample_size
An integer value specifying the number of observations in the sample. This value should be equal to the number of rows of the design matrix,
X
orZ
.- n_cat
The number of categorical values that the true outcome,
M
, and the observed outcome,M*
can take.