mb_delayed_effect {simtrial} | R Documentation |
Simulated survival dataset with delayed treatment effect
Description
Magirr and Burman (2019) considered several scenarios for their
modestly weighted logrank test.
One of these had a delayed treatment effect with a hazard ratio
of 1 for 6 months followed by a hazard ratio of 1/2 thereafter.
The scenario enrolled 200 patients uniformly over 12 months and
cut data for analysis 36 months after enrollment was opened.
This dataset was generated by the sim_pw_surv()
function
under the above scenario.
Usage
mb_delayed_effect
Format
A data frame with 200 rows and 4 columns:
-
tte
: Time to event.
References
Magirr, Dominic, and CarlāFredrik Burman. 2019. "Modestly weighted logrank tests." Statistics in Medicine 38 (20): 3782–3790.
Examples
library(survival)
fit <- survfit(Surv(tte, event) ~ treatment, data = mb_delayed_effect)
# Plot survival
plot(fit, lty = 1:2)
legend("topright", legend = c("control", "experimental"), lty = 1:2)
# Set up time, event, number of event dataset for testing
# with arbitrary weights
ten <- mb_delayed_effect |> counting_process(arm = "experimental")
head(ten)
# MaxCombo with logrank, FH(0,1), FH(1,1)
mb_delayed_effect |>
maxcombo(rho = c(0, 0, 1), gamma = c(0, 1, 1), return_corr = TRUE)
# Generate another dataset
ds <- sim_pw_surv(
n = 200,
enroll_rate = data.frame(rate = 200 / 12, duration = 12),
fail_rate = data.frame(
stratum = c("All", "All", "All"),
period = c(1, 1, 2),
treatment = c("control", "experimental", "experimental"),
duration = c(42, 6, 36),
rate = c(log(2) / 15, log(2) / 15, log(2) / 15 * 0.6)
),
dropout_rate = data.frame(
stratum = c("All", "All"),
period = c(1, 1),
treatment = c("control", "experimental"),
duration = c(42, 42),
rate = c(0, 0)
)
)
# Cut data at 24 months after final enrollment
mb_delayed_effect_2 <- ds |> cut_data_by_date(max(ds$enroll_time) + 24)
[Package simtrial version 0.4.1 Index]