condPlot {modnets} | R Documentation |
Conditional effects plot
Description
Creates a plot of the relationships between two variables at different levels of the moderator. Only works for relationships that include an interaction.
Usage
condPlot(
out,
to,
from,
swap = FALSE,
avg = FALSE,
compare = NULL,
hist = FALSE,
xlab = NULL,
mods = NULL,
nsims = 500,
xn = NULL,
getCIs = FALSE,
discrete = FALSE,
ylab = NULL,
main = NULL,
midline = TRUE
)
Arguments
out |
Output from |
to |
Outcome variable, specified with character string or numeric value. |
from |
Predictor variable, specified with character string or numeric value. |
swap |
Logical. Serves to switch the arguments for |
avg |
Logical. If |
compare |
Two values can be supplied to indicate levels of the moderator to be compared. |
hist |
Logical. Determines whether to show a histogram of the data distribution at the bottom of the plot. |
xlab |
Character string for labeling the x-axis. |
mods |
This argument will be removed. Model output is automatically
detected based on |
nsims |
Number of iterations to simulate the posterior distribution. |
xn |
Numeric value to indicate how many values of the moderator should be evaluated. |
getCIs |
Logical. Only applies when |
discrete |
Logical. Determines whether to treat the moderator as a discrete or continuous variable. |
ylab |
Character string for labeling the y-axis. |
main |
Character string for labeling the title of the plot. |
midline |
Logical. Only applies when |
Value
A plot of the conditional effects of one variable on another given different levels of the moderator.
See Also
Examples
fit <- fitNetwork(ggmDat, 'M')
condPlot(fit, to = 'V5', from = 'V4')
condPlot(fit, to = 2, from = 3, avg = TRUE)