ms_events: Expected numbers of patients, events and dropouts over...

View source: R/ms_events.R

ms_eventsR Documentation

Expected numbers of patients, events and dropouts over calendar time

Description

Expected numbers of patients, events and dropouts over calendar time

Usage

ms_events(scenario, n, calendar_time, endpoint = c("os", "pfs"))

Arguments

scenario

An ms_scenario object.

n

Total sample size.

calendar_time

Calendar times from the start of the study.

endpoint

"os" or "pfs".

Details

For group g with allocation probability p_g, the expected number of events by calendar time t is n p_g times the integral from 0 to t of A(t - s) f_g(s) G_g(s), where A is the enrolled fraction, f_g the density of the endpoint and G_g the probability of no dropout. The expected number of dropouts is obtained in the same way with the dropout density. For PFS, the dropouts include the censoring of PFS only (dropout_pfs of ms_model) and, with pfs_switch = "censor" in ms_scenario, the censoring at a switch before progression.

Value

A data frame with time, the numbers enrolled (enrolled, enrolled_control, enrolled_treatment), the expected events (events_control, events_treatment, events) and the expected dropouts (dropouts_control, dropouts_treatment).

See Also

ms_event_time, lr_moments

Examples

ctl <- ms_model(death = log(2) / 12, dropout = 0.005)
trt <- ms_model(death = 0.7 * log(2) / 12, dropout = 0.005)
scn <- ms_scenario(ctl, trt, accrual = ms_accrual(rate = 20))
ms_events(scn, n = 400, calendar_time = c(12, 24, 36))


DesignComplexSurvival documentation built on Nov. 23, 2026, 5:07 p.m.