mjskay / mjskay/ARTool

Use of emmean's option 'simple'

Open
#47 0 comments 0 reactions 0 assignees View on GitHub

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 ~ site
fsex + (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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.