tests/testthat/test_deviation.R

library(data.table)

test_that("Post-Expansion Excused Censoring", {
  data <- copy(SEQdata)
  data[N > 10, deviation := TRUE]
  model <- expect_error(SEQuential(data, "ID", "time", "eligible", "tx_init", "outcome",
                                       list("N", "L", "P"), list("sex"),
                                       method = "censoring",
                                       options = SEQopts(
                                         weighted = TRUE, deviation = TRUE,
                                         deviation.col = "deviation",
                                         weight.preexpansion = FALSE)
  ))
})

Try the SEQTaRget package in your browser

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

SEQTaRget documentation built on Feb. 16, 2026, 5:10 p.m.