one_simulation <- merge(
assumptions_delayed_effect(),
design_fixed_followup(),
by=NULL
) |>
head(1) |>
generate_delayed_effect()
# apply censoring to dataset
censored_sim <- random_censoring_exp(one_simulation, 0.01)
# plot
# uncensored (blue) observations are the same for original and modified
# dataset
# censored (red) observations are smaller than the uncensored ones
plot(
one_simulation$t,
censored_sim$t,
col=ifelse(censored_sim$evt, "blue", "red"),
xlab = "uncensored times",
ylab = "censored times"
)
abline(0,1)
Run the code above in your browser using DataLab