| simple_plot | R Documentation |
rblimp and SIMPLE commandGenerates a conditional effect plots based on the posterior summaries from the output of rblimp.
simple_plot(formula, model, ci = 0.95, xvals, ...)
formula |
an object of class |
model |
an |
ci |
a value between 0 and 1 specifying the credible interval size |
xvals |
a list of values to evaluate for the focal variable. If empty, they will automatically be determined |
... |
arguments passed to the internal |
To change colors use ggplot2's scale system. Both fill and color are used. See
ggplot2::aes_colour_fill_alpha for more information about setting a manual set of colors.
For nominal moderators, the variable must include the nominal code used in the dummy codes (e.g., moderator.1, moderator.2, etc).
When there are multiple dummy codes, then all codes must be listed using a +.
For example, after the ~ the following statement can be included:
\code{focal | moderator.1 + moderator.2}
a ggplot2::ggplot plot
# Generate Data
mydata <- rblimp_sim(
c(
'x ~ normal(0, 1)',
'm ~ normal(0, 1)',
'y ~ normal(10 + 0.5*x + m + 0.2*x*m, 1)'
),
n = 100,
seed = 981273
)
# Run Rblimp
m1 <- rblimp(
'y ~ x m x*m',
mydata,
center = ~ m,
simple = 'x | m',
seed = 10972,
burn = 1000,
iter = 1000
)
# Generate Plot
simple_plot(y ~ x | m, m1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.