bayesgmed_summary {BayesGmed} | R Documentation |
Print a summary of the estimated causal mediation model
Description
Print a summary of the estimated causal mediation model
Usage
bayesgmed_summary(
model = NULL,
level = 0.95,
pars = c("NDE_control", "NDE_treated", "NIE_control", "NIE_treated", "ANDE", "ANIE",
"TE"),
digits = 3
)
Arguments
model |
A |
level |
The "confidence" level that defines the limits of the credible intervals (default is .95, i.e. 95% CIs). |
pars |
The parameters to summarize (defaults to main causal effect estimands similar to the |
digits |
The number of decimal points to display in the output (default is 3). |
Details
After estimating a model with bayesgmed()
, use bayesgmed_summary(fit)
to display the estimated results,
where fit
is an object containing the fitted model. By default, bayesgmed_summary()
only displays a subset of
the estimated parameters:
- NDE_control
: direct effect estimate when the exposure level is set to the control value.
- NDE_treated
: direct effect estimate when the exposure level is set to the treated value.
- NIE_control
: mediated effect estimate when the exposure level is set to the control value.
- NIE_treated
: mediated effect estimate when the exposure level is set to the treated value.
- ANDE
: average direct effect of X on Y.
- ANIE
: average indirect effect of X on Y.
- TE
: the total effect of A on Y.
To display all estimated parameters where all chains merged, set pars = NULL
. This will print all parameters defined
in the model definitions, including the most important ones:
- alphaZ[]
: parameter estimate of the confounders (i.e., X -> Y) relationship, listed in the order they are specified
in the covariates
argument of bayesgmed()
. alpha[1]
is the intercept.
- alphaM
: parameter estimate of the M -> Y relationship.
- alphaA
: parameter estimate of the A -> Y relationship.
- betaZ
: parameter estimate of the confounders (i.e., X -> M) relationship, listed in the order they are specified
in the covariates
argument of bayesgmed()
. beta[1]
is the intercept
To learn more about the additional parameters, refer to the Stan code
(cat(get_stancode(fit))
).
Value
A data.frame
summarizing the estimated causal mediation model, including the following columns:
-
Parameter
: the name of the parameter. -
Mean
: the mean of the parameter's posterior distribution. -
Median
: the median of the parameter's posterior distribution. -
SE
: the standard deviation of the parameter's posterior distribution. -
ci_lwr
: the lower limit of the credible interval. -
ci_upr
: the upper limit of the credible interval. -
n_eff
: the number of efficient samples. -
Rhat
: a value of 1.00 suggests model convergence.
Author(s)
Belay B. Yimer belaybirlie.yimer@manchester.ac.uk