# Example 1: Obtains follow-up duration given power, accrual intensity,
# and accrual duration for variable follow-up
kmsamplesize1s(beta = 0.2, kMax = 2,
informationRates = c(0.8, 1),
alpha = 0.025, typeAlphaSpending = "sfOF",
milestone = 18, survH0 = 0.30,
accrualTime = seq(0, 8),
accrualIntensity = 26/9*seq(1, 9),
piecewiseSurvivalTime = c(0, 6),
stratumFraction = c(0.2, 0.8),
lambda = c(0.0533, 0.0309, 1.5*0.0533, 1.5*0.0309),
gamma = -log(1-0.05)/12, accrualDuration = 22,
followupTime = NA, fixedFollowup = FALSE)
# Example 2: Obtains accrual intensity given power, accrual duration, and
# follow-up duration for variable follow-up
kmsamplesize1s(beta = 0.2, kMax = 2,
informationRates = c(0.8, 1),
alpha = 0.025, typeAlphaSpending = "sfOF",
milestone = 18, survH0 = 0.30,
accrualTime = seq(0, 8),
accrualIntensity = 26/9*seq(1, 9),
piecewiseSurvivalTime = c(0, 6),
stratumFraction = c(0.2, 0.8),
lambda = c(0.0533, 0.0309, 1.5*0.0533, 1.5*0.0309),
gamma = -log(1-0.05)/12, accrualDuration = 22,
followupTime = 18, fixedFollowup = FALSE)
# Example 3: Obtains accrual duration given power, accrual intensity, and
# follow-up duration for fixed follow-up
kmsamplesize1s(beta = 0.2, kMax = 2,
informationRates = c(0.8, 1),
alpha = 0.025, typeAlphaSpending = "sfOF",
milestone = 18, survH0 = 0.30,
accrualTime = seq(0, 8),
accrualIntensity = 26/9*seq(1, 9),
piecewiseSurvivalTime = c(0, 6),
stratumFraction = c(0.2, 0.8),
lambda = c(0.0533, 0.0309, 1.5*0.0533, 1.5*0.0309),
gamma = -log(1-0.05)/12, accrualDuration = NA,
followupTime = 18, fixedFollowup = TRUE)
Run the code above in your browser using DataLab