beta_hat {regmedint} | R Documentation |
Create a vector of coefficients from the mediator model (mreg)
Description
This function extracts coef
from mreg_fit
and pads with zeros appropriately to create a named vector consistently having the following elements:
(Intercept)
,
avar
,
cvar
(this part is eliminated when cvar = NULL
),
emm_ac_mreg
(this part is eliminated when emm_ac_mreg = NULL
).
Usage
beta_hat(mreg, mreg_fit, avar, cvar, emm_ac_mreg = NULL)
Arguments
mreg |
A character vector of length 1. Mediator regression type: |
mreg_fit |
Model fit object for mreg (mediator model). |
avar |
A character vector of length 1. Treatment variable name. |
cvar |
A character vector of length > 0. Covariate names. Use |
emm_ac_mreg |
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model. |
Value
A named numeric vector of coefficients.