define_enroll_rate: Define enrollment rate

View source: R/define.R

define_enroll_rateR Documentation

Define enrollment rate

Description

Define the enrollment rate of subjects for a study as following a piecewise exponential distribution.

Usage

define_enroll_rate(duration, rate, stratum = "All")

Arguments

duration

A numeric vector of ordered piecewise study duration interval.

rate

A numeric vector of enrollment rate in each duration.

stratum

A character vector of stratum name.

Details

The duration are ordered piecewise for a duration equal to t_i - t_{i-1}, where 0 = t_0 < t_i < \cdots < t_M = \infty. The enrollment rates are defined in each duration with the same length.

For a study with multiple strata, different duration and rates can be specified in each stratum.

Value

An enroll_rate data frame.

Examples

# 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))
)

gsDesign2 documentation built on April 3, 2025, 9:39 p.m.