test_that("cummulative hazard", {
t1 <- 3
p1 <- c(0, 1, 2, 3)
lambda <- c(0.1, 0.2, 0.3)
t2 <- c(0.2, 0.7)
p2 <- c(0, 0.5, 1, 1.5)
expect_equal(cum_h(t1, p1, lambda), 0.1 + 0.2 + 0.3)
expect_equal(
cum_h(t2, p2, lambda),
c(
0.2 * 0.1,
0.5 * 0.1 + 0.2 * 0.2
)
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.