Skip to content

Fix/local power fix: now local power calculation using Schoenfeld information scale - #5

Merged
ytymofyeyev merged 2 commits into
mainfrom
fix/local-power
Aug 5, 2026
Merged

Fix/local power fix: now local power calculation using Schoenfeld information scale#5
ytymofyeyev merged 2 commits into
mainfrom
fix/local-power

Conversation

@ytymofyeyev

Copy link
Copy Markdown
Collaborator

Summary

Local power values in Table 5 were computed using the alternative
information scale ("alt_info"), which overstates power under the null.
This fix switches to info_scale = "h0_info" (Schoenfeld), consistent
with how rpact and gsDesign2 define local power.

Changes

  • R/utils-process.R: set info_scale = "h0_info" in get_boundaries()
    for TTE hypotheses

Validation

Added Tier 2 rpact cross-validation tests (tests/testthat/test-local-power-rpact.R):

  • Purpose-built single-stratum fixture config (tests/testthat/fixtures/local_power_validation_config.R): 1:4 allocation, HR=0.55, piecewise hazard, asOF spending
  • Validates H2 OS local power against independent rpact::getPowerSurvival() calculation across all weight scenarios
  • Max observed difference vs rpact: 2e-06 (tolerance: 0.002)
  • Tests skip on CRAN and when rpact is not installed

Pass info_scale='h0_info' to gs_power_ahr() so local power (Table 5)
uses null information throughout, matching rpact analytical results.
The default 'h0_h1_info' mixed null-boundary with alt-spread, producing
power values that matched neither simulation nor Schoenfeld.
- Add tests/testthat/fixtures/local_power_validation_config.R: minimal
  single-stratum, 1:4 allocation, HR=0.55, asOF, piecewise hazard fixture
  config purpose-built for numerical validation (not a real study design)
- Add tests/testthat/test-local-power-rpact.R: Tier 2 rpact cross-validation
  of H2 OS local power across all weight scenarios; all rpact inputs derived
  from config and result — no hardcoded numerics except tolerance
- Observed max difference vs rpact: 2e-06 (tolerance: 0.002)
- Tests skip on CRAN and when rpact is not installed
@ytymofyeyev
ytymofyeyev merged commit f739643 into main Aug 5, 2026
2 checks passed
@ytymofyeyev
ytymofyeyev deleted the fix/local-power branch August 5, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant