Renders the labels of parameter quantities from their structured label parts: catalog quantities (the label_parts column of parameter_catalog()) and the columns of mixed and marginal posterior draws (the quantities draw metadata, see posterior_metadata()). The same renderer produces the catalog aliases, the rows of the summary tables, the column names of mixed posteriors, plot legends, and warning text, so a label shown by BayesTools is always a label of the same quantity everywhere.

parameter_labels(
  x,
  style = c("selector", "table", "plot", "warning"),
  formula_prefix = TRUE,
  simplify = FALSE,
  vocabulary = NULL
)

Arguments

x

a parameter catalog (or its quantities or aliases table), a parameter selection returned by parameter_catalog_resolve(), a data frame with a label_parts column (e.g. the quantities attribute of an estimates table), or a list of label parts.

style

one of "selector" (the exact selector, i.e., the canonical name of a catalog quantity; also for the quantities of an extension provider that have no label parts), "table" (the summary-table row label), "plot" (the plot-legend label: the level text of a level cell), or "warning" (the row label used in warnings and footnotes).

formula_prefix

whether table and warning labels show the formula parameter, as in (mu) x. Defaults to TRUE.

simplify

whether random-effect labels use their simplified display arguments (for example, sd for a sole random intercept). Defaults to FALSE.

vocabulary

optional named character vector renaming the random-effect quantities in the labels, e.g. c(sd = "tau", cor = "rho") renders (mu) study: tau(intercept) for (mu) study: sd(intercept). Quantities without an entry keep their names. Defaults to NULL.

Value

a character vector of labels.

Details

Square brackets after a factor term hold a level label (g[b]); interaction cells name the level of every factor (g[b]:h[v], g[b]:x); contrast coefficients that are not level cells are written with curly braces (g{1}). Selectors percent-escape syntax-sensitive level characters and quote interaction tokens as the catalog does; table, plot, and warning labels show the level labels as they are. The quantities of an ordered term (prior_ordered()) follow the same grammar: its total is a coefficient of the term that is not a level, f{total} (f:x{total} for a term with a continuous predictor, written on the last component that is not an ordinary factor), and the share of the total reached at a level is a per-level quantity of the ordered factor, f[share: mid] (f[share: mid]:x, with the tag on the component of its ordered factor). When the ordinary factors of the term index several slices, the slice follows the last ordinary factor: f{total}:g{1}, f[share: mid]:g{1}, g{1}:f{total}. The inclusion indicator of a mixture total reads f{total} (inclusion). The label parts of catalog aliases render the aliases with style = "table"; under a vocabulary, they render the aliases of the renamed random-effect quantities (including the pairwise aliases of the shared correlation of cs() and hcs() blocks).