Get YaMastar used in NDE and NIE caculation

YaMastar.SamplePred(
  a,
  astar,
  e.m = NULL,
  e.y,
  fit.m,
  fit.y,
  X.predict.M,
  X.predict.Y,
  sel,
  seed,
  K
)

Arguments

a

exposure variables at current level

astar

exposure variables at counterfactual level

e.m

effect modifier for the mediator variable

e.y

effect modifier for the outcome variable

fit.m

model fit regressing mediator on exposures and confounders on mediator

fit.y

model fit regressing outcome on exposures, effect modifiers, mediator and confounders on outcome

X.predict.M

counfounders for mediator

X.predict.Y

counfounders for outcome

sel

a vector selecting which iterations of the fit should be retained or inference

seed

the random seed to use to evaluate the code

K

number of samples to generate for each MCMC iteration

Value

A vector containing the sample prediction for YaMastar