From 3ab7dd3f74b4b98984f7a89491b37925a51937d0 Mon Sep 17 00:00:00 2001 From: Ryan O'Dea <70209371+ryan-odea@users.noreply.github.com> Date: Mon, 27 Oct 2025 19:15:51 +0100 Subject: [PATCH 1/2] set deviation as WIP --- SEQTaRget/R/SEQopts.R | 3 +++ SEQTaRget/tests/testthat/test_deviation.R | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 SEQTaRget/tests/testthat/test_deviation.R diff --git a/SEQTaRget/R/SEQopts.R b/SEQTaRget/R/SEQopts.R index 1e8d390..5997298 100644 --- a/SEQTaRget/R/SEQopts.R +++ b/SEQTaRget/R/SEQopts.R @@ -86,6 +86,9 @@ SEQopts <- function(bootstrap = FALSE, bootstrap.nboot = 100, bootstrap.sample = weight.upper <- as.numeric(weight.upper) weight.eligible_cols <- as.list(weight.eligible_cols) + # Temporarily disabling deviation - work in progress method + if (deviation) stop("Deviation is currently under further development and is currently not suitable for analysis. + We apologize for this inconvenience") deviation.col <- as.character(deviation.col) deviation.conditions <- as.list(deviation.conditions) deviation.excused_cols <- as.list(deviation.excused_cols) diff --git a/SEQTaRget/tests/testthat/test_deviation.R b/SEQTaRget/tests/testthat/test_deviation.R new file mode 100644 index 0000000..c1c2a10 --- /dev/null +++ b/SEQTaRget/tests/testthat/test_deviation.R @@ -0,0 +1,12 @@ +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) + )) +}) From 70ccca92d0640a62c9ba65e7c6abb99bfca8b027 Mon Sep 17 00:00:00 2001 From: Ryan O'Dea <70209371+ryan-odea@users.noreply.github.com> Date: Mon, 27 Oct 2025 19:16:34 +0100 Subject: [PATCH 2/2] bump version --- SEQTaRget/DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SEQTaRget/DESCRIPTION b/SEQTaRget/DESCRIPTION index a2bd9d4..78b6737 100644 --- a/SEQTaRget/DESCRIPTION +++ b/SEQTaRget/DESCRIPTION @@ -1,7 +1,7 @@ Package: SEQTaRget Type: Package Title: Sequential Trial Emulation -Version: 1.1.0 +Version: 1.1.1 Authors@R: c(person(given = "Ryan", family = "O'Dea", role = c("aut", "cre"),