Learn R Programming

DTEAssurance (version 1.1.0)

sim_dte: Simulates survival times for a delayed treatment effect (DTE) scenario, where the treatment group experiences a delayed onset of benefit. Control and treatment groups are generated under exponential or Weibull distributions.

Description

Simulates survival times for a delayed treatment effect (DTE) scenario, where the treatment group experiences a delayed onset of benefit. Control and treatment groups are generated under exponential or Weibull distributions.

Usage

sim_dte(
  n_c,
  n_t,
  lambda_c,
  delay_time,
  post_delay_HR,
  dist = "Exponential",
  gamma_c = NULL
)

Value

A data frame with two columns:

time

Simulated survival times

group

Group assignment: "Control" or "Treatment"

Class: data.frame

Arguments

n_c

The number of patients in the control group

n_t

The number of patients in the treatment group

lambda_c

The baseline hazard rate for the control group

delay_time

The length of delay before treatment effect begins

post_delay_HR

The hazard ratio after the delay period

dist

The distribution for the control group; must be one of "Exponential" (default) or "Weibull"

gamma_c

The shape parameter for the Weibull distribution (only used if dist = "Weibull")

Examples

Run this code
set.seed(123)
sim_data <- sim_dte(n_c = 10, n_t = 10, lambda_c = 0.1,
                    delay_time = 6, post_delay_HR = 0.6)
head(sim_data)

Run the code above in your browser using DataLab