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

Consider couple-clustered robust SEs in the generalized vignette

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
r
Domain
documentation

Research direction

Read dev/vignettes/generalized-apim.Rmd first to see the existing generalized-model structure, then check how sandwich::vcovCL() clusters on coupleID and which fit objects (stats::glm(), ordinal::clm()) actually support the sandwich score method — see the linked sandwich estfun.R for clm() restrictions. Run a small simulation (bias, coverage, false-positive rate, power with few vs many couples) evaluating marginal effects, not conditional coefficients. Done means a short vignette section plus one worked example fitting a model, computing couple-clustered SEs, and interpreting them, with the limitations stated; no new dyadMLM function required.

Written by the indexing model from the issue text.

Description

enhancement

What would you like to improve?

Consider a short section in dev/vignettes/generalized-apim.Rmd on marginal generalized models with standard errors clustered by couple, using sandwich::vcovCL().

This could provide an alternative for estimating population-average actor and partner effects when a suitable latent covariance structure is difficult to fit or identify, including for ordinal outcomes. Treat it as an option to evaluate before recommending it.

What to assess

  • Start with ordinary generalized linear models (stats::glm(), for example binary or count outcomes) and ordinal cumulative-link models (ordinal::clm()), without random effects. Cluster by the whole coupleID so inference allows both same-occasion partner dependence and dependence across occasions, assuming independent couples.
  • Explain the change from conditional mixed-model effects to marginal effects. Preserve the within-person/between-person predictor decomposition. Robust SEs cannot repair a misspecified marginal mean or category-probability model; in particular, averaging over random effects need not preserve proportional odds.
  • Verify supported model classes, links, and package versions. Basic clm() has sandwich support, but its score method requires flexible thresholds and does not support scale regression. Do not assume the same workflow works for clmm() or arbitrary glmmTMB fits, or provides clubSandwich CR2 corrections. Explain the limitations with few independent couples.
  • Before recommending a workflow, use a small targeted simulation to check bias, interval coverage, false-positive rates, and power under partner/time dependence, with few and many couples. Evaluate the intended marginal effect, rather than comparing it directly with a conditional mixed-model coefficient.
  • If suitable, add one minimal worked example showing fitting, couple-clustered SEs, and inference using that covariance matrix, followed by a brief explanation of when to choose this approach. Retain guidance on checking the marginal model.

The initial scope is evaluating and documenting an existing workflow; no new dyadMLM function is needed.

References

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.