tests/testthat/test-surv-term.R

library(survival)
test_that("marker_term fails with singular design matrices", {
  ti <- 1:10
  y <- numeric(length(ti))
  y[1:3] <- 1
  dat <- data.frame(ti = ti, y = y)

  expect_error(
    surv_term(Surv(ti, y) ~ 1, id = ti, data = dat,
                time_fixef = poly_term(ti, intercept = TRUE)),
    regexp = "Design matrix does not have full rank. Perhaps remove an intercept or a time-varying term from 'formula'")
})

Try the VAJointSurv package in your browser

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

VAJointSurv documentation built on Aug. 14, 2022, 9:05 a.m.