Use of emmean's option 'simple'
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 66
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
Hello.
I've found the package very useful but now I stumbled on something I consider a bug.
Say I have a model like this:
rt <- art(score ~ site*fsex + (1|patid), data = tofit)
were 'score' is a disease score, 'site' is a body region, 'fsex' is sex coded as factor and 'patid' is the patient ID.
I'm interested in the contrast of each site by sex. Say 'arm/male - arm/female'
If a use a linear model and the steps after
lm <- lmerTest::lmer(score ~ sitefsex + (1|patid), data = tofit)
LEMM <- emmeans(lm, ~ site:fsex)
pairs(LEMM, simple="fsex")
I get what I want. Whereas,
rt <- art(score ~ sitefsex + (1|patid), data = tofit)
EMM <- emmeans(rtlm, ~ sitefsex)
pairs(EMM, simple="fsex")
Will give me only NA's. I believe this is because LEMM has a 'site' column and an 'fsex' column, whereas in EMM these columns are combined into 'sitefsex'.
If there's a workaround for this I would be happy to know.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the two emmeans and pairs calls from the issue, comparing the separate site and fsex columns with the combined sitefsex result. Trace how simple="fsex" is interpreted for the ART model and confirm the expected contrast output; done means the behavior is corrected or a verified workaround is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- analytics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100