# Piecewise accrual, piecewise exponential survival, and 5% dropout by
# the end of 1 year.
# Example 1: Obtains accrual duration given power and follow-up time
lrsamplesize(beta = 0.2, kMax = 2,
informationRates = c(0.8, 1),
alpha = 0.025, typeAlphaSpending = "sfOF",
accrualTime = seq(0, 8),
accrualIntensity = 26/9*seq(1, 9),
piecewiseSurvivalTime = c(0, 6),
lambda1 = c(0.0533, 0.0309),
lambda2 = c(0.0533, 0.0533),
gamma1 = -log(1-0.05)/12,
gamma2 = -log(1-0.05)/12,
accrualDuration = NA,
followupTime = 18, fixedFollowup = FALSE)
# Example 2: Obtains follow-up time given power and accrual duration
lrsamplesize(beta = 0.2, kMax = 2,
informationRates = c(0.8, 1),
alpha = 0.025, typeAlphaSpending = "sfOF",
accrualTime = seq(0, 8),
accrualIntensity = 26/9*seq(1, 9),
piecewiseSurvivalTime = c(0, 6),
lambda1 = c(0.0533, 0.0309),
lambda2 = c(0.0533, 0.0533),
gamma1 = -log(1-0.05)/12,
gamma2 = -log(1-0.05)/12,
accrualDuration = 22,
followupTime = NA, fixedFollowup = FALSE)
# Example 3: Obtains absolute accrual intensity given power,
# accrual duration, follow-up time, and relative accrual intensity
lrsamplesize(beta = 0.2, kMax = 2,
informationRates = c(0.8, 1),
alpha = 0.025, typeAlphaSpending = "sfOF",
accrualTime = seq(0, 8),
accrualIntensity = 26/9*seq(1, 9),
piecewiseSurvivalTime = c(0, 6),
lambda1 = c(0.0533, 0.0309),
lambda2 = c(0.0533, 0.0533),
gamma1 = -log(1-0.05)/12,
gamma2 = -log(1-0.05)/12,
accrualDuration = 22,
followupTime = 18, fixedFollowup = FALSE)
Run the code above in your browser using DataLab