tests/testthat/test-crr.R

# Test for the assigned class of output
test_that("The model is a cmprsk object", {
  expect_equal(inherits(prostate.crr, "cmprsk"), TRUE)
})

# Test that the model was refit with the design
test_that("The design (x) was added", {
  expect_equal("x" %in% names(prostate.crr$cph.f), TRUE)
})

# Test that the supplied statuses must be present
test_that("The supplied 'failcode' value must be in the status column", {
  expect_error(crr.fit(prostate.f, cencode = 0, failcode = 5))
})

Try the QHScrnomo package in your browser

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

QHScrnomo documentation built on May 29, 2024, 9:21 a.m.