Skip to contents

Evaluates a fixed-size design under alternative rate, dispersion, enrollment, dropout, and follow-up assumptions without resizing the trial.

Usage

gsNBPower(
  design = NULL,
  lambda1 = NULL,
  lambda2 = NULL,
  dispersion = NULL,
  accrual_rate = NULL,
  accrual_duration = NULL,
  trial_duration = NULL,
  dropout_rate = NULL,
  max_followup = NULL,
  event_gap = NULL,
  ratio = NULL,
  rr0 = NULL,
  alpha = NULL,
  test_type = NULL,
  planned_calendar = NULL,
  target_info = NULL,
  target_events = NULL,
  min_n = NULL,
  min_followup = NULL,
  max_calendar = NULL,
  boundary_update = c("recompute", "fixed"),
  spending = c("min_planned_actual", "planned_final", "expected_final", "calendar"),
  full_spending_at_final = TRUE,
  usTime = NULL,
  lsTime = NULL,
  ...
)

# S3 method for class 'gsNBPower'
print(x, ...)

Arguments

design

A gsNB design, or NULL for a fixed-size specification.

lambda1, lambda2

Control and experimental rates; omitted values inherit the reference design.

dispersion

NB dispersion, scalar or arm-specific vector.

accrual_rate, accrual_duration

Piecewise enrollment rates and durations.

trial_duration

Final calendar date when no design is supplied.

dropout_rate

Dropout hazards, as in sample_size_nbinom().

max_followup

Maximum patient follow-up.

event_gap

Minimum gap between counted events.

ratio

Experimental-to-control allocation ratio.

rr0

Null rate ratio.

alpha

One-sided efficacy error budget.

test_type

"score" or "wald"; defaults to the fixed design's test.

planned_calendar

Calendar analysis dates; defaults to design$T. Use NA for an interim determined only by other criteria.

target_info, target_events

Expected information or event targets at each look. Scalars recycle; NA omits a requirement.

min_n, min_followup

Minimum enrollment followed by a minimum time since randomization. These counts do not exclude patients who subsequently drop out.

max_calendar

Hard calendar caps; defaults to the reference final date.

boundary_update

Recompute spending boundaries or retain numerical bounds.

spending

"min_planned_actual", "planned_final", "expected_final", or "calendar".

full_spending_at_final

Spend the full efficacy budget at the final look.

usTime, lsTime

Optional upper and lower spending-time overrides.

...

Boundary settings passed to gsDesign::gsDesign() when design is NULL.

x

A gsNBPower result.

Value

A gsNBPower list with power, futility_probability, harm_probability, look_results, expected resources, and assumptions.

Details

Power uses a canonical normal approximation with signed log-rate-ratio drift. The score approximation uses separate null and alternative variances and rescales each numerical Z boundary before canonical integration. These are planning approximations, not guarantees for estimated information or random analysis dates. Expected resources are measured at the stopping decision.

Examples

fixed <- sample_size_nbinom(
  lambda1 = 0.5, lambda2 = 0.35, dispersion = 0.5, power = 0.9,
  accrual_rate = 10, accrual_duration = 12, trial_duration = 24
)
design <- gsDesignNB::toInteger(gsNB(fixed))
gsNBPower(design, lambda2 = 0.4)
#> Asymptotic NB group sequential power: 0.5322 
#>  look analysis_time  n_total information information_null information_fraction
#>     1      7.862545 152.0092    30.67174         30.84766            0.3455538
#>     2     12.875342 232.0000    60.78479         61.04326            0.6848132
#>     3     24.000000 232.0000    90.12950         90.34615            1.0154162
#>  expected_events exposure_ctrl exposure_exp upper_bound lower_bound harm_bound
#>         268.9153      3.931273     3.931273    3.010739  -0.1997029       -Inf
#>         717.7857      6.875342     6.875342    2.546086   0.9844167       -Inf
#>        1879.2000     18.000000    18.000000    1.998104   1.9981037       -Inf
#>  spending_time lower_spending_time efficacy_prob futility_prob harm_prob
#>      0.3333333           0.3333333     0.0379552    0.07556975         0
#>      0.6666667           0.6666667     0.1780405    0.16614932         0
#>      1.0000000           1.0000000     0.3162517    0.22603349         0
#>  cumulative_efficacy cumulative_futility continuation_prob   status target_met
#>            0.0379552          0.07556975         0.8864750 analyzed       TRUE
#>            0.2159957          0.24171907         0.5422852 analyzed       TRUE
#>            0.5322475          0.46775256         0.0000000 analyzed       TRUE