moderation1 | R Documentation |
This function runs a complete two way moderation analysis with one moderator, similiar to model 1 in PROCESS by A. Hayes (2013). As part of the output, you will find data screening, the overall model, and the simple slopes for X at each level of the moderator. X and M variables will be mean centered after data screening and before analysis to control for multicollinearity unless they are categorical.
moderation1(y, x, m, cvs = NULL, df, with_out = T)
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 moderator for your model, as this model only includes one moderator. |
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 |
states = as.data.frame(state.x77)
moderation1(y = "Income", x = "Illiteracy", m = "Murder",
cvs = c("Population", "Area"), df = states)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.