tests/testthat/test-survival_curves.R

test_that("survival_curves outputs the right element", {
  mat <- matrix(c(1, 2, 3, 4), nrow = 2)
  h0 <- c(1, 2, 3)
  est_coef <- matrix(c(1, 0), ncol = 1)
  result <- survival_curves(mat, h0, est_coef)
  k <- -exp(matrix(c(1, 2), ncol = 1))
  expected <- surv_prob(k, as.matrix(h0))[[1]]
  expect_equal(result, expected)
})

Try the bonsaiforest package in your browser

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

bonsaiforest documentation built on Sept. 30, 2024, 9:46 a.m.