simADHCE {hce}R Documentation

Simulate adhce object with given event rates of time-to-event outcomes (Weibull), mean and SD of the continuous outcome (normal or log-normal) by treatment group

Description

Simulate adhce object with given event rates of time-to-event outcomes (Weibull), mean and SD of the continuous outcome (normal or log-normal) by treatment group

Usage

simADHCE(
  n,
  n0 = n,
  TTE_A,
  TTE_P,
  CM_A,
  CM_P,
  CSD_A = 1,
  CSD_P = CSD_A,
  fixedfy = 1,
  yeardays = 360,
  pat = 100,
  shape = 1,
  logC = FALSE,
  seed = NULL,
  dec = 2
)

Arguments

n

sample size in the active treatment group.

n0

sample size in the placebo group.

TTE_A

event rates per year in the active group for the time-to-event outcomes.

TTE_P

event rates per year in the placebo group for the time-to-event outcomes. Should have the same length as TTE_A.

CM_A

mean value for the continuous outcome of the active group.

CM_P

mean value for the continuous outcome of the placebo group.

CSD_A

standard deviation for the continuous outcome of the active group.

CSD_P

standard deviation for the continuous outcome of the placebo group.

fixedfy

length of follow-up in years.

yeardays

number of days in a year.

pat

scale of provided event rates (per pat-years).

shape

shape of the Weibull distribution for time-to-event outcomes. Default is exponential distribution with shape = 1.

logC

logical, whether to use log-normal distribution for the continuous outcome.

seed

for generating random numbers.

dec

decimal places for the continuous outcome used for rounding. The default is dec = 2.

Value

an object of class adhce containing an hce object with its source datasets ADET (event-time dataset for all time-to-event outcomes per patient) and BDS (basic data structure for the continuous outcome for all patients). The hce object has the following columns:

See Also

simHCE() for directly simulating hce objects.

Examples

# Example 1
Rates_A <- c(1.72, 1.74, 0.58, 1.5, 1)
Rates_P <- c(2.47, 2.24, 2.9, 4, 6)
l <- simADHCE(n = 2500, TTE_A = Rates_A, TTE_P = Rates_P,
              CM_A = -3, CM_P = -6, CSD_A = 16, CSD_P = 15, fixedfy = 3, seed = 2024)
names(l)
head(l$HCE)
head(l$ADET)
head(l$BDS)

# Example 2
Rates_A <- 10
Rates_P <- 15
l <- simADHCE(n = 1000, n0 = 500, TTE_A = Rates_A, TTE_P = Rates_P, 
CM_A = 0.1, CM_P = 0, seed = 5, shape = 0.2, logC = TRUE, dec = 0)
summaryWO(l$HCE)

[Package hce version 0.6.7 Index]