Skip to content

Split response names with dots in contrasts of multivariate brms models - #687

Merged
strengejacke merged 2 commits into
easystats:mainfrom
jmgirard:hotfix-dotted-multivariate-responses
Oct 18, 2026
Merged

strengejacke merged 2 commits into
easystats:mainfrom
jmgirard:hotfix-dotted-multivariate-responses

Conversation

@jmgirard

Copy link
Copy Markdown
Contributor

For multivariate brms models whose response names contain dots, estimate_contrasts() did not split the contrast labels into Response1/Response2. For mvbind(Sepal.Length, Petal.Length) ~ Species on iris, estimate_contrasts(m, "Species") returned labels like PetalLength versicolor in Level1 and Level2.

brms removes the dots from the response names (Sepal.Length becomes SepalLength) and uses these names in the labels, but .split_contrast_response_levels() searched only for Sepal.Length. The names of insight::find_response() hold the brms names, so the fix adds them to the response levels. estimate_means() already shows these names in its Response column.

The new test in test-brms.R fits the iris model above. It fails on main (no Response1/Response2 columns) and passes with the fix: the 15 contrasts have Response1 levels SepalLength and PetalLength, and Level1/Level2 hold only the species.

jmgirard and others added 2 commits October 17, 2026 15:51
brms removes dots from response names (Sepal.Length becomes SepalLength)
and uses these names in the contrast labels, so
.split_contrast_response_levels() did not find the response and kept the
labels unsplit. It now also searches for the names of
insight::find_response(), which hold the brms names.
@strengejacke
strengejacke merged commit f5a810d into easystats:main Oct 18, 2026
8 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants