Nothing
test_that("one_minus_kaplan_meier works as expected", {
set.seed(23)
df <- generate_data(
n = 25,
cens = c(0.2, 3),
haz_ae = 0.2,
haz_death = 0.3,
haz_soft = 0.5
)
result <- one_minus_kaplan_meier(data = df, tau = 4)
expected <- c(ae_prob = 0.5865, ae_prob_var = 0.0394)
expect_equal(result, expected, tolerance = 1e-4)
})
test_that("one_minus_kaplan_meier also works without competing events", {
set.seed(23)
df <- generate_data(
n = 10,
cens = c(0.2, 3),
haz_ae = 0.2,
haz_death = 0.3,
haz_soft = 0.5
)
df <- df[df$type_of_event != 1, ]
result <- one_minus_kaplan_meier(data = df, tau = 4)
expected <- c("ae_prob" = 0, "ae_prob_var" = 0)
expect_identical(result, expected)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.