Check that fitted groups contain both partner positions
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
Research direction
Start in R/backtransform_residual_covariance.R: read validate_exchangeable_coding (around lines 827-867) and the automatic covariance-block matching near lines 1133-1137, and reproduce the failing helper example from the issue first. Pass the fitted group IDs into the check, apply the both-positions check to package-generated and user-supplied contrast columns alike (error if none, warn if only some), and leave the transformation formulas untouched. Done means the example now errors, plus new tests covering wrong grouping, one-partner groups, partly observed dyads, and valid dyad grouping for both column-name types.
Written by the indexing model from the issue text.
Description
Problem
Covariance recovery should check that fitted groups contain both partner positions (-1 and +1). It skips this check for package-generated contrast names (source). When covariance blocks are matched automatically, the check receives no group IDs (source).
A repeated-measures model grouped by personID instead of coupleID can therefore receive a partner covariance even though no group contains both partners. Rows omitted during fitting can also leave groups with one partner.
Example of the missing check
dyadMLM:::validate_exchangeable_coding(
data.frame(.member_contrast_arbitrary = c(-1, -1, 1, 1)),
idiff = ".member_contrast_arbitrary",
shared_indicator = "1",
group_ids = c(1, 1, 2, 2),
group_name = "personID"
)
This passes. Renaming the column to idiff correctly produces an error: no group contains both -1 and +1.
Suggested fix
- Pass fitted group IDs to the check when matching covariance blocks automatically.
- Check package-generated and user-supplied contrast columns alike. Among groups covered by the selected indicators, give an error if none contain both positions; warn if only some do.
- For package-generated contrasts, skip only the warning about members keeping the same -1/+1 code across repeated rows.
- Test wrong grouping, groups with one partner position, partly observed dyads, and valid dyad grouping, with both package-generated and user-supplied column names.
Keep the shared/difference transformation formulas unchanged.
The helper example was confirmed on 2026-09-10 at c92eb46; fitted-model tests are still needed.
Related: #33.
- Dominant language
- R
- Stars
- 1
- Forks
- 2
- Avg merge
- 9h 28m
- Merged PRs (30d)
- 21
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
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.
More from Pascal-Kueng/dyadMLM
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Pascal-Kueng/dyadMLM#92 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Pascal-Kueng/dyadMLM#83 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Pascal-Kueng/dyadMLM#71 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Pascal-Kueng/dyadMLM#70 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Pascal-Kueng/dyadMLM#69 ·
Maintainers usually reply within 1 day
All issues in Pascal-Kueng/dyadMLM
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stan-dev/priorsense#150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
xuzhougeng/wisp-science#1571 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
bennettoxford/opencodecounts#170 ·