Skip to contents

Bayes approach for FLOW MR model.

Usage

BayesMediation(
  Gamma_hat,
  Sd_hat,
  init = "Random",
  iter = 6000,
  warmup = 3000,
  second = F,
  inv = T,
  cor = NULL,
  Raw = T,
  total = F,
  indirect = F
)

Arguments

Gamma_hat

The estimated exposure and outcome effects gamma_hat

Sd_hat

The standarded errors of gamma_hat

init

Starting value for gibbs sampler. Either "Random" or "EM"

iter

The number of iterations for gibbs sampler

warmup

The length of warm-up periods

second

Whether to run the second stage. Default is False.

inv

When inv = False, we are estiming B in Gamma = (I + B) alpha; inv = True, we are estimating B in Gamma = B Gamma + alpha.

cor

The correlation matrix of noise.

Raw

Whether to include the unprocessed raw outputs. Default is F

total

Whether to include the total effects. Default is F

indirect

Whether to include the indirect effects. Default is F.

Value

A list with elements

summary_first

The summary table of first stage

summary_second

The summary table of second stage (included if second = T)

total_effect_first

The total effect of each exposure on the outcome,

computed by first stage (included if total = T)

total_effect_second

The total effect of each exposure on the outcome,

computed by second stage (included if total = T and second = T)

indirect_effect_first

The indirect effect of each exposure on the outcome,

computed by first stage (included if indirect = T)

indirect_effect_second

The indirect effect of each exposure on the outcome,

computed by second stage (included if indirect = T and second = T)

raw_first

The unprocessed output from the first stage (included if raw= T)

raw_second

The unprocessed output from the second stage (included if raw = T and second = T)