one_simulation <- merge(
assumptions_subgroup(),
design_fixed_followup(),
by=NULL
) |>
head(1) |>
generate_subgroup()
head(one_simulation)
tail(one_simulation)
Design <- assumptions_subgroup()
Design
my_design <- merge(
assumptions_subgroup(),
design_fixed_followup(),
by=NULL
)
my_design <- true_summary_statistics_subgroup(my_design)
my_design
my_design <- merge(
assumptions_subgroup(),
design_fixed_followup(),
by=NULL
)
my_design$hazard_trt <- NA
my_design$hazard_subgroup <- NA
my_design$hr_subgroup_relative <- 0.9
my_design$final_events <- ceiling((my_design$n_ctrl + my_design$n_trt) * 0.75)
my_design <- hazard_subgroup_from_PH_effect_size(my_design, target_power_ph=0.9)
my_design
design <- expand.grid(
hazard_ctrl=0.2, # hazard under control and before treatment effect
hazard_trt=0.02, # hazard after onset of treatment effect
hazard_subgroup=0.01, # hazard in the subgroup in treatment
prevalence = c(0.2, 0.5), # subgroup prevalence
censoring_prop=c(0.1, 0.25, 0.01), # 10%, 25%, 1% random censoring
followup=100, # followup of 100 days
n_trt=50, # 50 patients treatment
n_ctrl=50 # 50 patients control
)
cen_rate_from_cen_prop_subgroup(design)
Run the code above in your browser using DataLab