13.6 Grouping, colour, stratification, and panels
--group and --stratify answer different visual questions. Group determines colour within a panel; stratification creates separate panels. Use them deliberately so comparisons remain readable and sample sizes remain visible.
Colour groups
--group DOSE colours profiles and summaries by dose. Several comma-separated columns are combined into the derived label GROUP_ALL. This is useful for STUDY,FORMULATION, but combinations can proliferate quickly. After eight groups the fixed palette cannot provide equally distinct colours; additional groups become grey and the caption notes it.
[eda] color can choose a color column independently, but a command-line --group supplies the data grouping and normally becomes the colour. Set configuration deliberately and inspect the resolved settings rather than relying on memory of precedence.
Facet strata
--stratify STUDY makes one panel per level. Facets help when overplotting hides shapes or when scales should be compared side by side. They also reduce points per panel. A striking pattern in a panel with two subjects is not equivalent to one supported by a balanced study.
Numeric groups with more than max_categories values may be cut into quantile groups. If a continuous covariate should remain continuous, use a scatter plot or smoother instead of accidental categorization.
A practical selection rule
Use colour for the primary comparison, facets for a prespecified secondary design factor, and separate figures for additional questions. Always accompany a grouped graphic with counts from T01/T02/T03 or a custom count table.
Common mistakes
- Combining so many group columns that nearly every subject has a unique colour.
- Reading facet differences without checking sample sizes and design balance.
- Allowing automatic quantile bins to masquerade as clinical categories.
- Comparing panels with free scales as though axes were identical.
Checklist
- Define the primary comparison before plotting.
- Count subjects and observations per group/panel.
- Keep labels and units consistent.
- Limit colours and facets to readable numbers.
- Record any automatic binning.
Further reading
See covariate classification, covariate plots, and custom facets.