View source: R/SimData_per_group.R
| SimData_per_group | R Documentation |
Generates individual-level simulated data for a treatment or control arm in a hierarchical win ratio trial. The simulation includes frailty-adjusted time to death, recurrent event counts, censoring times, and a continuous quality-of-life change score.
SimData_per_group(
treatment,
ngroup,
alpha.JFM,
theta.JFM,
lambda,
ann.icr,
censorrate,
xbase,
xfinal,
sd.delta.x
)
treatment |
Integer. Treatment group indicator, usually 1 for the active treatment arm and 0 for the control arm. |
ngroup |
Integer. Number of subjects to simulate in this arm. |
alpha.JFM |
Numeric. Alpha parameter for the joint frailty model. |
theta.JFM |
Numeric. Frailty variance parameter for the joint frailty model. Must be positive. |
lambda |
Numeric. Annual mortality probability. Must be in
|
ann.icr |
Numeric. Annual incidence rate of recurrent events. |
censorrate |
Numeric. Annual censoring probability. Must be in
|
xbase |
Numeric. Baseline value of the continuous outcome. |
xfinal |
Numeric. Expected final value of the continuous outcome among subjects followed through 360 days. |
sd.delta.x |
Numeric. Standard deviation of the change in the continuous outcome. |
A named list. If treatment = 1, the list contains
surv_1; otherwise, it contains surv_0. The data frame has
one row per subject and includes subject ID, treatment indicator, death
time, censoring time, death indicator, recurrent event count, and
continuous outcome value.
set.seed(1)
sim <- SimData_per_group(
treatment = 1, ngroup = 5,
alpha.JFM = 0, theta.JFM = 1,
lambda = 0.13, ann.icr = 0.32,
censorrate = 0.2, xbase = 45, xfinal = 52.5,
sd.delta.x = 20
)
str(sim$surv_1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.