mlm_summary {bmlm} | R Documentation |
Print a summary of the estimated multilevel mediation model
Description
Prints the estimated parameters (numerical summaries of the marginal posterior distributions).
Usage
mlm_summary(
mod = NULL,
level = 0.95,
pars = c("a", "b", "cp", "me", "c", "pme"),
digits = 2
)
Arguments
mod |
A |
level |
"Confidence" level; Defines the limits of the credible intervals. Defaults to .95 (i.e. displays 95% CIs.) |
pars |
Parameters to summarize. Defaults to main average-level parameters. See Details for more information. |
digits |
How many decimal points to display in the output. Defaults to 2. |
Details
After estimating a model (drawing samples from the joint posterior
probability distribution) with mlm()
, show the estimated results
by using mlm_summary(fit)
, where fit
is an object containing
the fitted model.
The function shows, for each parameter specified with pars
,
the posterior mean, and limits of the Credible Interval as specified
by level
. For example, level = .91
shows a
91% Credible Interval, which summarizes the central 91% mass of
the marginal posterior distribution.
Parameters
By default, mlm()
estimates and returns a large number of parameters,
including the varying effects, and their associated standard deviations.
However, mlm_summay()
by default only displays a subset of the
estimated parameters:
- a
Regression slope of the X -> M relationship.
- b
Regression slope of the M -> Y relationship.
- cp
Regression slope of the X -> Y relationship. (Direct effect.)
- me
Mediated effect (
a * b + \sigma_{{a_j}{b_j}}
).- c
Total effect of X on Y. (
cp + me
)- pme
Percent mediated effect.
The user may specify pars = NULL
to display all estimated parameters.
Other options include e.g. pars = "tau"
to display the varying
effects' standard deviations. To display all the group-level parameters
(also known as random effects) only, specify pars = "random"
.
With this argument, mlm_summary()
prints the following parameters:
- tau_a
Standard deviation of subject-level
a_j
s.- tau_b
Standard deviation of subject-level
b_j
s.- tau_cp
Standard deviation of subject-level
c\'_j
s.- covab
Estimated covariance of
a_j
andb_j
s.- corrab
Estimated correlation of
a_j
andb_j
s.
To learn more about the additional parameters, refer to the Stan code
(cat(get_stancode(fit))
).
Value
A data.frame
summarizing the estimated multilevel
mediation model:
- Parameter
Name of parameter
- Mean
Mean of parameter's posterior distribution.
- Median
Median of parameter's posterior distribution.
- SE
Standard deviation of parameter's posterior distribution.
- ci_lwr
The lower limit of Credible Intervals.
- ci_upr
The upper limit of Credible Intervals.
- n_eff
Number of efficient samples.
- Rhat
Should be 1.00.
Author(s)
Matti Vuorre mv2521@columbia.edu