exp_duration: Expected duration

View source: R/calc_events_and_duration.R

exp_durationR Documentation

Expected duration

Description

Given one or two treatment arms, calculate the time \tau at which the expected number of events equals d.

Usage

exp_duration(
  arm0 = NA,
  arm1 = NA,
  d,
  search_start = 10,
  search_prec = 0.01,
  max_duration = 1000
)

Arguments

arm0

object of class 'arm'.

arm1

object of class 'arm'.

d

vector of number of events.

search_start

value at which the search for duration tau starts.

search_prec

value controlling the desired precision before terminating the search.

max_duration

maximum \tau for consideration.

Value

expected trial duration.

See Also

exp_events for calculating expected events d at time tau, create_arm and create_arm_lachin for creating an object of class 'arm'.

Examples

arm0 <- create_arm(size=120, accr_time=6, surv_scale=0.05, loss_scale=0.005, follow_time=12)
arm1 <- create_arm(size=120, accr_time=6, surv_scale=0.03, loss_scale=0.005, follow_time=12)
exp_duration(arm0, d=61)
exp_duration(arm0, arm1, d=103)
exp_duration(arm0, d=c(35,61))
exp_duration(arm0, arm1, d=c(57,103))

npsurvSS documentation built on May 29, 2024, 11:23 a.m.