Description Usage Arguments Examples
This function runs a complete simple mediation analysis with one mediator, similiar to model 4 in PROCESS by A. Hayes (2013). As part of the output, you will find data screening, all three models 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.
1 2 3 4 5 6 7 8 9 10 | mediation1(
y,
x,
m,
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. |
m |
The mediator for your model, as this model only includes one mediator. |
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 | mediation1(y = "cyl", x = "mpg", m = "disp",
cvs = c("drat", "gear"), df = mtcars)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.