View source: R/Onesample.generate.sequential.R
| Onesample.generate.sequential | R Documentation |
Simulate one-sample composite endpoints data with recurrent events and a terminal event
under two time scales: event time t and calendar time s. A uniform recruitment period is assumed,
and the function returns all observed data available at a specified calendar time. Recurrent event occurrences
are generated from an underlying Poisson process with subject-specific Gamma frailty.
Onesample.generate.sequential(
beta = c(0, 0),
lambda_0 = 1.15,
size,
recruitment = 3,
calendar = 5,
random.censor.rate,
seed
)
beta |
Regression coefficient vector for the proportional mean functions, the default is |
lambda_0 |
Rate parameter for the underlying Poisson process, default is |
size |
Total sample size. |
recruitment |
Length of the recruitment period (in years), default is |
calendar |
Calendar time of the end of the trial (in years), default is |
random.censor.rate |
Rate parameter for independent random right censoring. |
seed |
Seed for reproducibility. |
A data frame in long format containing simulated composite endpoint data. Each subject may contributing multiple rows corresponding to recurrent events, a terminal event (death), or censoring. The data include:
id: Subject identifier.
e: Enrollment time on the calendar scale.
event_time_cal: Cumulative event time on the calendar scale.
status: Event indicator with values
2=recurrent event, 1=death, and 0=censoring.
Z1, Z2: Simulated covariates used in the proportional mean model.
tau_star: Subject-specific stopping time, the last event observed in [0, tau_star] is classified as death.
death: Binary indicator for death.
recurrent: Binary indicator for recurrent events.
event: Binary event indicator, event = death + recurrent.
calendar: Calendar time cutoff used to generate the returned data.
lambda_0: Baseline Poisson process rate parameter.
lambda_star: Rate parameter of an exponential distribution in generating tau_star.
gamma_scale, gamma_shape: Parameters of the Gamma distribution used to generate subject-specific frailty terms.
Mao L, Lin DY. Semiparametric regression for the weighted composite endpoint of recurrent and terminal events. Biostatistics. 2016 Apr; 17(2) :390-403.
# Generate one-sample composite endpoint data
df <- Onesample.generate.sequential(size = 200,
recruitment = 3, calendar = 5,
random.censor.rate = 0.05, seed = 1123)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.