Say where `.member_contrast_*` columns may be used

未关闭 适合新手
#175 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Voyagerroc 已经在做这个了。

开始于 2026年11月13日。

  • #181 来自 @Voyagerroc —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
85/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
r
领域
documentation

调研方向

先查看 prepare_dyad_data() 的帮助文档,了解其参数 seed 和返回值,然后找到 APIM vignette 中的 exchangeable 部分。在两个位置都添加建议的说明:仅在 .member_contrast_* 自己的随机效应块中使用它,并将其与共享块分开。文档的两个位置都包含相同的说明后,即为完成。

由索引模型根据 Issue 内容生成。

描述

documentation good first issue priority: low

The .member_contrast_* columns assign +1 and -1 to the two members of a dyad at random. The documented exchangeable model uses the column in one place only: a random-effect block of its own, next to a separate shared block. That model gives the same results for every seed.

Other uses depend on the random assignment. The docs call the assignment arbitrary, but they do not say where the column belongs.

Example

library(dyadMLM)
for (s in 1:3) {
  p <- prepare_dyad_data(
    dyads_cross, dyad = coupleID, member = personID, role = gender,
    keep_compositions = "female-female", model_types = "none", seed = s
  )
  m <- glmmTMB::glmmTMB(
    closeness ~ 1 + .member_contrast_arbitrary +   # fixed effect of the contrast
      us(1 | coupleID) + us(0 + .member_contrast_arbitrary | coupleID),
    dispformula = ~0, data = p
  )
  print(logLik(m))
}
#> -413.87, -413.46, -412.10

A single block such as us(1 + .member_contrast_arbitrary | coupleID) depends on the seed in the same way. recover_exchangeable_covariance() refuses that block. A fixed effect of the contrast is fitted without any message.

Suggested fix and checks

  • Add one sentence to the seed argument and the return value in the prepare_dyad_data() help.
  • Add the same sentence to the exchangeable section of the APIM vignette.
  • Suggested wording: "Use this column only in a random-effect block of its own, separate from the shared block. If results change with seed, the column is used somewhere else."
主要语言
R
星标
1
派生
2
平均合并
11 小时 4 分钟
30 天内合并 PR
42

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Pascal-Kueng/dyadMLM 的其他 Issue

查看 Pascal-Kueng/dyadMLM 的全部 Issue

相似的 Issue

更多 R Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。