View source: R/residual_plot.R
| residual_plot | R Documentation |
rblimp and SIMPLE commandGenerates a conditional effect plots based on the posterior summaries from the output of rblimp.
residual_plot(
model,
variable,
nsigma = 1,
point_col = "black",
horz_line = "black",
col1 = "#0571b0",
col2 = "#ca0020",
linewidth = 1.1,
...
)
model |
an |
variable |
the name of the outcome for which to create a plot |
nsigma |
the number of standard deviations to produce credible bounds |
point_col |
the color of the points in the plot |
horz_line |
the color of the horiztonal zero line |
col1 |
the color of the loess mean line |
col2 |
the color of the loess credible bound lines |
linewidth |
the linewidth value for the loess lines and its bounds. |
... |
arguments passed to |
All colors are passed into ggplot2. See ggplot2::aes_colour_fill_alpha for details on changing colors.
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',
mydata,
nimps = 10,
seed = 10972,
burn = 1000,
iter = 1000
)
# Generate Plot
residual_plot(m1, 'y') + ggplot2::theme_minimal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.