# Define enroll rate without stratum
define_enroll_rate(
duration = c(2, 2, 10),
rate = c(3, 6, 9)
)
# Define enroll rate with stratum
define_enroll_rate(
duration = rep(c(2, 2, 2, 18), 3),
rate = c((1:4) / 3, (1:4) / 2, (1:4) / 6),
stratum = c(array("High", 4), array("Moderate", 4), array("Low", 4))
)
Run the code above in your browser using DataLab