Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The package version remains at 0.30.0.19 despite the user-visible change, so installation and update tooling cannot distinguish this release from the previous one.
1 open issue
What changed in this PR
This pull request updates model_parameters() formatting for multcomp::glht objects to use fitted-model variable labels in hypothesis expressions while preserving coefficient names, descriptive contrast labels, and numerical results.
Changes:
- Added label-aware formatting for coefficient and interaction expressions.
- Preserved descriptive and ambiguous matrix contrast names.
- Added regression tests and documented the fix in
NEWS.md.
| File | Description |
|---|---|
| tests/testthat/test-model_parameters.glht.R | Adds regression tests for variable labels, interaction labels, disabled formatting, and descriptive matrix contrast names. |
| R/format_parameters.R | Adds coefficient-aware relabeling of glht hypothesis expressions using fitted-model variable labels. |
| NEWS.md | Documents the glht hypothesis-label formatting fix. |
Review effort: Lite
Comment on lines
+38
to
+39
| * `model_parameters()` uses variable labels for coefficients in *multcomp* | ||
| hypothesis labels (#1139). |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #1139.
Use the fitted model's variable labels when formatting
glht()hypotheses. Match the whole coefficient names against those used in the contrast so that descriptive matrix row names and ambiguous duplicate names retain their original text. TheParametercolumn and numerical results stay the same.The new test reproduced the missing labels and the truncated interaction label on main. The
glht, formatting, and model-label tests passed with the patch. An installed-package check also verified the printed label and equal statistics with label formatting disabled.