simHCE {hce}R Documentation

Simulate hce 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 hce 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

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

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

the seed for generating random numbers.

Value

an object of class hce containing the following columns:

See Also

hce(), as_hce() for the helper a coerce function to 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)
dat <- simHCE(n = 2500, TTE_A = Rates_A, TTE_P = Rates_P,
              CM_A = -3, CM_P = -6, CSD_A = 16, CSD_P = 15, fixedfy = 3)
head(dat)

# Example 2
Rates_A <- 10
Rates_P <- 15
dat <- simHCE(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)
summaryWO(dat)

[Package hce version 0.6.0 Index]