calc_myreg_mreg_linear_yreg_linear function

Create calculators for effects and se (mreg linear / yreg linear)

Create calculators for effects and se (mreg linear / yreg linear)

Construct functions for the conditional effect estimates and their standard errors in the mreg linear / yreg linear setting. Internally, this function deconstructs model objects and feeds parameter estiamtes to the internal worker functions calc_myreg_mreg_linear_yreg_linear_est and calc_myreg_mreg_linear_yreg_linear_se.

calc_myreg_mreg_linear_yreg_linear( mreg, mreg_fit, yreg, yreg_fit, avar, mvar, cvar, emm_ac_mreg, emm_ac_yreg, emm_mc_yreg, interaction )

Arguments

  • mreg: A character vector of length 1. Mediator regression type: "linear" or "logistic".
  • mreg_fit: Model fit from fit_mreg
  • yreg: A character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
  • yreg_fit: Model fit from fit_yreg
  • avar: A character vector of length 1. Treatment variable name.
  • mvar: A character vector of length 1. Mediator variable name.
  • cvar: A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
  • emm_ac_mreg: A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
  • emm_ac_yreg: A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
  • emm_mc_yreg: A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
  • interaction: A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.

Returns

A list containing a function for effect estimates and a function for corresponding standard errors.