results_mediation | R Documentation |
This function allows you to run mediation analysis based on two sets of returns from the 'analysis' function. The dependent variable from 'm.mediator' must be present as an independent variable in 'm.outcome.' Transformations in the outcome model are allowed but transformations in the mediator are not.
results_mediation( m.mediator, m.outcome, predictions, times = NULL, draws = 1000, .outcome = NULL, .mediator.name = NULL )
m.mediator |
Object returned from 'analysis' function that identifies the effect of the treatment on the mediator. |
m.outcome |
Object returned from 'analysis' function that identifies the effect of the treatment and the mediator on the outcome. |
predictions |
A 'pr_list' object with the desired change in the treatment. The treatment should be in both equations. |
times |
An optional vector indicating the time(s) to conduct the mediation analysis if the outcome is a survival model. |
draws |
An optional integer indicating the number of draws (randomly sampled) from the results to use. Smaller values allow a faster run. |
.outcome |
Optional name for the outcome. If this is missing the name of the dependent variable in 'm.outcome' is used. |
All estimated effects are on the scale of the response variable.
A datafame showing the direct effect, the indirect effect, the total effect, the portion of the total effect mediated, and the effect of the treatment on the mediator.
Other results:
get_prediction_frequentist()
,
qualitative_assessment()
,
results()
,
summarize_interval()
results_mediation(m.mediator, m.outcome, predictions = predictions.mediation)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.