tests/testthat/test-behavior-DR-coxph.R

test_that("DR_coxph returns finite residuals with right-censoring", {
  skip_if_not_installed("survival")
  dat <- sim_surv_data(n = 60, p = 4, beta = c(1.1, 0, 0, 0), seed = 99)
  res <- DR_coxph(time = dat$time, event = dat$event, type = "right", typeres = "deviance")
  expect_type(res, "double")
  expect_length(res, length(dat$time))
  expect_true(all(is.finite(res)))
})

Try the plsRcox package in your browser

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

plsRcox documentation built on Feb. 28, 2026, 9:06 a.m.