Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Proposal: extend simulation framework to binary and normal endpoints

未关闭
#381 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
r
领域
data

调研方向

Read the existing sim_pw_surv() API and its enrollment, allocation, stratification, and data-cut helpers to understand the shared trial bookkeeping described in the proposal. Then review issue #258 for the related multiple-testing context. Done would require agreement on a participant/outcome schema and callback contract, followed by staged binary and normal generators, availability cuts, and evaluation examples; the issue leaves those design decisions open.

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

描述

Motivation

Could simtrial's simulation framework be extended to binary and normally distributed continuous outcomes, while retaining its existing time-to-event workflows?

We are developing a concept for a complete design and analysis package for weighted parametric group sequential testing in gsDesignWP. Useful evaluation examples include multiple treatments versus a common control, nested or overlapping biomarker populations, and repeated analyses. simtrial already provides a useful foundation for enrollment, stratification, randomization, data cuts, and time-to-event simulation. Reusing these concepts for other outcomes would avoid building a separate trial simulator in each design package.

This is a feature proposal for discussion, not a request to implement everything at once or a claim that the current API supports these endpoints.

Suggested initial scope

  • Binary outcomes: Bernoulli risks by treatment and disjoint population stratum, initially one prespecified assessment per participant. Supply baseline risks and treatment effects with explicit direction and scale, so analysis callbacks can evaluate risk difference or risk ratio (usually log risk ratio for asymptotic methods). Validate that implied probabilities lie in [0, 1].
  • Normal outcomes: means and standard deviations by treatment and stratum, initially one assessment per participant. Keep the generating model separate from the chosen known-variance, pooled-variance, or unequal-variance analysis.
  • Outcome availability: enrollment dates, assessment delays, and a declared missingness mechanism. Interim cuts should use available outcomes or a prespecified calendar/sample-size rule, rather than reinterpreting TTE event counts. Unobserved binary outcomes must not silently become failures, and unavailable observations must not count toward information.
  • Shared trial structure: stable participant IDs, treatment allocation, and disjoint population-membership strata. A tested population can be a union of these strata. Generate each participant and shared control outcome once, then reuse the same records across populations and cuts so the intended dependence is preserved.

Endpoint-specific generators and cut helpers could share common trial bookkeeping and analysis callbacks. They need not be forced into the existing sim_pw_surv() arguments or a TTE event/censoring representation. Keep any new interface backward compatible with current TTE calls.

Analysis and results

Support external analysis callbacks returning estimates, standard errors, information when defined, test statistics or exact p-values, and method identifiers. Preserve simulation, analysis, endpoint, population, contrast, and hypothesis identifiers in results. Multiple tests at a cut are relevant; this relates to #258, while adding outcome families is a separate extension.

Exact-binomial methods should be usable as callbacks where appropriate. However, adding a binary generator does not establish an exact sequential or multiplicity-adjusted test: two-arm risk-difference/risk-ratio nulls, nuisance parameters, discreteness, and shared controls require separate statistical methods. Those testing and graphical-recycling rules can remain the responsibility of the calling design/analysis package.

For multiple endpoints on the same participants, joint generation should require an explicit dependence model. Unknown endpoint correlation should not silently become independence. Single-endpoint simulations would be a useful first release.

Evaluation and staged delivery

  1. Add and document single-assessment binary and normal generators using the shared enrollment/allocation/stratum concepts.
  2. Add calendar and outcome-availability cuts, plus fixed and group sequential examples.
  3. Demonstrate a shared-control example and a nested-population example, reporting marginal power, appropriate joint power/FWER, stopping, and expected sample size or observed outcomes.
  4. Check moments, allocation, cut bookkeeping, and simple analytic or exact benchmarks; include global and relevant partial-null scenarios with Monte Carlo uncertainty. Preserve reproducibility across sequential and parallel execution using the package's existing RNG conventions.

In gsDesignWP, deterministic design and boundary calibration would remain the default. simtrial would be an optional tool for finite-sample and operational evaluation, not a required Monte Carlo backend for routine numerical integration.

Does this belong in simtrial's intended scope? If so, an initial agreement on the common participant/outcome schema and callback contract would be useful before choosing new function names or a broader API.

主要语言
R
星标
41
派生
14
平均合并
3 小时 4 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

Merck/simtrial 的其他 Issue

查看 Merck/simtrial 的全部 Issue

相似的 Issue

更多 R Issue

把新 issue 发到你的邮箱

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