View source: R/plot_by_group.R
plot_by_group | R Documentation |
Plot posterior densities of group summaries of individual parameters. The respondents can be grouped by any categorical variable and the function works whether the fitted model is of "MULTI"-type or not.
plot_by_group(
object,
par = "abs_beta",
group_id = NULL,
ascending_means = TRUE,
fill = "#2166AC",
color = "#053061",
alpha = 0.5,
ncol = max(1, round(length(unique(group_id))/10))
)
object |
An instance of class |
par |
Character: Name of the parameter to be plotted. One of the following: |
group_id |
An optional vector that will be used to split the respondents into groups. The vector must either be as long as the number of rows in the original dataset, or as long as the number of respondents included in the analysis. If a |
ascending_means |
Logical: Should the groups be placed in ascending order based on their posterior means ( |
fill |
Fill color. Passed on to |
color |
Color of outer lines. Passed on to |
alpha |
Number in [0,1]: Inverse level of transparency. |
ncol |
Number of columns. The default uses a formula to have approximately ten subplots per column. |
A ggplot
object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.