Sample Size Calculation for Two-Group Non-Inferiority Survival Study
Source:R/twoSurvSampleSizeNI.R
twoSurvSampleSizeNI.Rd
Calculates the required sample size and expected event numbers for a non-inferiority trial with two survival curves, using piecewise integration of hazard functions under exponential survival assumptions.
Usage
twoSurvSampleSizeNI(
syear,
yrsurv1,
yrsurv2,
alloc,
accrualTime,
followTime,
alpha,
power,
margin
)
Arguments
- syear
Survival time horizon (e.g., median survival time) in years.
- yrsurv1
Survival probability of the standard group at
syear
.- yrsurv2
Survival probability of the test group at
syear
.- alloc
Allocation ratio (Test / Standard), e.g., 1 means equal allocation.
- accrualTime
Duration of patient accrual period.
- followTime
Follow-up period after last patient is accrued.
- alpha
One-sided significance level (e.g., 0.025).
- power
Desired statistical power (e.g., 0.8).
- margin
Non-inferiority margin for hazard ratio (HR).
Value
A list containing:
- Sample_size_of_standard_group
Required sample size in the standard group.
- Sample_size_of_test_group
Required sample size in the test group.
- Total_sample_size
Total sample size.
- Expected_event_numbers_of_standard_group
Expected number of events in the standard group.
- Expected_event_numbers_of_test_group
Expected number of events in the test group.
- Total_expected_event_numbers
Total number of expected events across both groups.
References
Jung SH, Chow SC. (2012). On sample size calculation for comparing survival curves under general hypothesis testing. Journal of Biopharmaceutical Statistics, 22(3), 485–495.
Web calculator (Non-Inferiority): https://nshi.jp/en/js/twosurvyrni/
Examples
twoSurvSampleSizeNI(
syear = 2,
yrsurv1 = 0.7,
yrsurv2 = 0.65,
alloc = 1,
accrualTime = 1,
followTime = 1,
alpha = 0.025,
power = 0.8,
margin = 1.3
)
#> $Sample_size_of_standard_group
#> [1] 11501
#>
#> $Sample_size_of_test_group
#> [1] 11501
#>
#> $Total_sample_size
#> [1] 23002
#>
#> $Expected_event_numbers_of_standard_group
#> [1] 2691.2
#>
#> $Expected_event_numbers_of_test_group
#> [1] 3162.4
#>
#> $Total_expected_event_numbers
#> [1] 5853.6
#>