Convert average follow-up to a constant dropout hazard
Source:R/dropout_rate_from_followup.R
dropout_rate_from_followup.RdCalibrates an exponential dropout model when every participant could be followed for the same duration in the absence of dropout.
Value
A non-negative dropout hazard per unit time, suitable for the
dropout_rate argument of sample_size_nbinom().
Details
For dropout time \(D\) with exponential hazard \(\delta\) and a common follow-up cap \(F\), the mean observed time is \(E[\min(D,F)] = (1 - \exp(-\delta F))/\delta\). This function solves that equation, returning zero when the mean equals the cap. Both inputs must be scalars in the same time unit.
A mean alone does not identify the dropout distribution. This conversion assumes independent exponential dropout and a common potential follow-up; it does not adjust for staggered enrollment with an earlier calendar cutoff. In an NB regression, the offset is the logarithm of each participant's observed exposure, not the logarithm of the overall average.
Examples
# Mean 0.9 years, with one year of potential follow-up for everyone
delta <- dropout_rate_from_followup(0.9, 1)
sample_size_nbinom(
lambda1 = 0.66, lambda2 = 0.528, dispersion = 0.8, power = 0.9,
accrual_rate = 100, accrual_duration = 1, trial_duration = 2,
max_followup = 1, dropout_rate = delta
)
#> Sample size for negative binomial outcome
#> ==========================================
#>
#> Sample size: n1 = 1162, n2 = 1162, total = 2324
#> Expected events: 1242.4 (n1: 690.2, n2: 552.2)
#> Power: 90%, Alpha: 0.025 (1-sided)
#> Rates: control = 0.6600, treatment = 0.5280 (RR = 0.8000)
#> Dispersion: 0.8000, Avg exposure (calendar): 0.90
#> Dropout rate: 0.2146
#> Accrual: 1.0, Trial duration: 2.0
#> Max follow-up: 1.0