Skip to contents

Power analysis and sample size calculation for survival studies using Lachin-Foulkes and Schoenfeld methods from gsDesign package.

Usage

survivalpower(
  data,
  calculation_type = "sample_size",
  method = "lachin_foulkes",
  hazard_control = 0.083,
  hazard_treatment = 0.042,
  hazard_ratio = 0.6,
  study_duration = 24,
  accrual_duration = 12,
  dropout_rate = 0,
  allocation_ratio = 1,
  alpha = 0.025,
  beta = 0.1,
  power = 0.9,
  sided = "1",
  entry_type = "unif",
  gamma = 0,
  sample_size_input = 100,
  events_input = 50,
  show_summary = TRUE,
  show_formulas = FALSE,
  show_interpretation = TRUE
)

Arguments

data

The data as a data frame (optional for power calculations).

calculation_type

Type of power calculation to perform.

method

Method for power/sample size calculation.

hazard_control

Event hazard rate for control group (events per person-time unit).

hazard_treatment

Event hazard rate for treatment group (events per person-time unit).

hazard_ratio

Hazard ratio (treatment/control) for Schoenfeld method.

study_duration

Maximum study duration (months or years).

accrual_duration

Patient accrual (recruitment) duration.

dropout_rate

Equal dropout hazard rate for both groups.

allocation_ratio

Randomization ratio (treatment:control).

alpha

Type I error rate (significance level).

beta

Type II error rate (1 - power).

power

Statistical power (1 - beta).

sided

One-sided or two-sided statistical test.

entry_type

Pattern of patient entry into the study.

gamma

Rate parameter for exponential entry (0 if uniform entry).

sample_size_input

Total sample size when calculating power.

events_input

Number of events when calculating power with Schoenfeld method.

show_summary

Whether to display comprehensive study design summary.

show_formulas

Whether to display mathematical formulas used.

show_interpretation

Whether to include clinical interpretation of results.

Value

A results object containing:

results$instructionsa html
results$power_resultsa html
results$formulasa html
results$interpretationa html

Examples

# \donttest{
# Example usage:
library(gsDesign)
#> 
#> Attaching package: ‘gsDesign’
#> The following object is masked from ‘package:crosstable’:
#> 
#>     as_gt
# Sample size for survival study
nSurvival(lambda1 = 0.2, lambda2 = 0.1, Ts = 24, Tr = 12)
#> Fixed design, two-arm trial with time-to-event
#> outcome (Lachin and Foulkes, 1986).
#> Study duration (fixed):          Ts=24
#> Accrual duration (fixed):        Tr=12
#> Uniform accrual:              entry="unif"
#> Control median:      log(2)/lambda1=3.5
#> Experimental median: log(2)/lambda2=6.9
#> Censoring only at study end (eta=0)
#> Control failure rate:       lambda1=0.2
#> Experimental failure rate:  lambda2=0.1
#> Censoring rate:                 eta=0
#> Power:                 100*(1-beta)=90%
#> Type I error (1-sided):   100*alpha=2.5%
#> Equal randomization:          ratio=1
#> Sample size based on hazard ratio=0.5 (type="rr")
#> Sample size (computed):           n=98
#> Events required (computed): nEvents=87
# Number of events required
nEvents(hr = 0.6, alpha = 0.025, beta = 0.1)
#> [1] 161.0686
# }