tests/testthat/test-inc_prop.R

test_that("inc_prop 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 <- inc_prop(data = df, tau = 4)
  expected <- c(ae_prob = 0.24, ae_prob_var = 0.0073)
  expect_equal(result, expected, tolerance = 1e-4)
})

Try the savvyr package in your browser

Any scripts or data that you put into this service are public.

savvyr documentation built on June 8, 2025, 10:19 a.m.