Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Check that fitted groups contain both partner positions

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
r
Domain
data, testing

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

bug priority: medium

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

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.

More from Pascal-Kueng/dyadMLM

All issues in Pascal-Kueng/dyadMLM

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.