Draws strip summaries for public, private, and delta posterior draws, plus a
mean tick for majority responses. By default, it plots the summary for all
respondents in the model. If cohorts is a cohort set, the plot is faceted
with one panel per cohort; for a single cohort, a single plot is returned
with the weighted N in the subtitle.
Usage
lx_strip_plot(
model,
cohorts = NULL,
color_public = "#50bd90",
color_private = "#36c8ef",
color_delta = "#ffcf60",
color_majority = "#826cc4",
probs = c(0.025, 0.975),
n_bins = 100
)Arguments
- model
An
lx_modelobject.- cohorts
A
cohort,cohort_set,NULLfor the whole population,"predictors"(all predictors + population),"population"(population-only), or a character vector of predictor names. Include"population"in an explicit vector when you also want the overall population cohort.- color_public, color_private, color_delta, color_majority
Colors for the public, private, delta, and majority ticks/strips.
- probs
Quantile bounds used to define the strip range.
- n_bins
Number of density bins used to shade the strip.
Examples
model_pets <- example_lx_model
# Whole population
lx_strip_plot(model_pets)
#> ℹ No weights provided. Using equal weights of 1.
# Cohort set (e.g., by gender)
cohort_set <- example_srv_lx |>
dplyr::filter(!is.na(d_gender)) |>
g6tr.cohorts::create_cohort_set(
id_col = response_id,
grp_cols = c(d_gender),
weight_col = weight
)
lx_strip_plot(model_pets, cohorts = cohort_set)