| winratiosim | R Documentation |
Simulates replicated two-arm clinical trials and analyzes each trial using a three-layer hierarchical win ratio framework: time to death, annualized recurrent event count, and a continuous quality-of-life score.
winratiosim(
nsim,
N,
Randomization.ratio,
alpha.JFM,
theta.JFM,
lambda_trt,
lambda_ctl,
ann.icr_trt,
ann.icr_ctl,
xbase_trt,
xfinal_trt,
xbase_ctl,
xfinal_ctl,
sd.delta.x_trt,
sd.delta.x_ctl,
censorrate_trt,
censorrate_ctl,
nc = 1,
seed = NULL
)
nsim |
Integer. Number of simulated trials. |
N |
Integer. Total number of subjects in each simulated trial. |
Randomization.ratio |
Numeric vector of length 2 giving the treatment
and control allocation ratio, for example |
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_trt, lambda_ctl |
Numeric. Annual mortality probabilities for the treatment and control arms. |
ann.icr_trt, ann.icr_ctl |
Numeric. Annual recurrent event incidence rates for the treatment and control arms. |
xbase_trt, xfinal_trt |
Numeric. Baseline and expected final continuous outcome values in the treatment arm. |
xbase_ctl, xfinal_ctl |
Numeric. Baseline and expected final continuous outcome values in the control arm. |
sd.delta.x_trt, sd.delta.x_ctl |
Numeric. Standard deviations for the continuous outcome change in the treatment and control arms. |
censorrate_trt, censorrate_ctl |
Numeric. Annual censoring probabilities for the treatment and control arms. |
nc |
Integer. Number of worker processes to use. The default is 1. |
seed |
Optional integer seed. If supplied, results are reproducible
across different values of |
A named list with the following elements:
Finkelstein-Schoenfeld analysis summary for each simulation.
Win ratio analysis summary for each simulation.
Sample sizes used in each simulated trial.
Win, tie, loss, and total probabilities for each simulation.
Win, tie, loss, and total counts for each simulation.
Lee, S. Y. (2025). A note on the sample size formula for a win ratio endpoint. Statistics in Medicine, 44, e70165. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sim.70165")}
result <- winratiosim(
nsim = 1,
N = 20,
Randomization.ratio = c(1, 1),
alpha.JFM = 0,
theta.JFM = 1,
lambda_trt = 0.13,
lambda_ctl = 0.15,
ann.icr_trt = 0.32,
ann.icr_ctl = 0.55,
xbase_trt = 45,
xfinal_trt = 52.5,
xbase_ctl = 45,
xfinal_ctl = 45,
sd.delta.x_trt = 20,
sd.delta.x_ctl = 20,
censorrate_trt = 0.2,
censorrate_ctl = 0.2,
nc = 1,
seed = 2025
)
result$df_WR.analysis.summary
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.