Description Usage Arguments Examples
View source: R/mediation2_moda.R
This function runs a serial mediation analysis with two mediators (model 6) with an added moderation on path a (like model 7) using the model numbers from A. Hayes (2013). As part of the output, you will find data screening, all model outputs used in the traditional Baron and Kenny (1986) steps, total/direct/indirect effects, the z-score and p-value for the Aroian Sobel test, and the bootstrapped confidence interval for the indirect effect. These are separated by simple slopes for the moderation part of the analysis.
1 2 3 4 5 6 7 8 9 10 11 12 | mediation2_moda(
y,
x,
m1,
m2,
mod,
cvs = NULL,
df,
with_out = T,
nboot = 1000,
conf_level = 0.95
)
|
y |
The dependent variable column name from your dataframe. |
x |
The independent variable column name from your dataframe. This column will be treated as X in mediation or moderation models, please see diagrams online for examples. |
m1 |
The first mediator for your model. |
m2 |
The second mediator for your model. |
cvs |
The covariates you would like to include in the model.
Use a |
df |
The dataframe where the columns from the formula can be found. Note that only the columns used in the analysis will be data screened. |
with_out |
A logical value where you want to keep the outliers in
model |
nboot |
A numeric value indicating the number of bootstraps you would like to complete. |
conf_level |
A numeric value indicating the confidence interval width for the boostrapped confidence interval. |
1 2 3 | mediation2(y = "Q11", x = "Q151", m1 = "Q31", m2 = "Q41", mod = "Q121",
cvs = NULL, df = mediation2_data, nboot = 1000, with_out = T,
conf_level = .95)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.