The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
This article describes how to apply a data cut, when the date to apply is not the more common singular date, but a different date per patient. An example would be to cut all patients data at their week 24 visit date. The below is an example how this can be done utilizing datacutr
.
To start, all SDTM data needs to be stored in a list.
library(datacutr)
library(admiraldev)
library(dplyr)
library(lubridate)
library(stringr)
library(purrr)
library(rlang)
<- list(ds = datacutr_ds, dm = datacutr_dm, ae = datacutr_ae, sc = datacutr_sc, lb = datacutr_lb, fa = datacutr_fa, ts = datacutr_ts) source_data
The next step is to create the DCUT
dataset containing the description, and a fixed date that ensures all data necessary from ds
is included into DCUT
. An example would be today’s date.
<- create_dcut(
dcut dataset_ds = source_data$ds,
ds_date_var = DSSTDTC,
filter = DSDECOD == "RANDOMIZATION",
cut_date = as.character(lubridate::today()),
cut_description = "Week 24 Cut"
)
USUBJID | DCUTDTC | DCUTDTM | DCUTDESC |
---|---|---|---|
AB12345-001 | 2023-03-27 | 2023-03-27 23:59:59 | Week 24 Cut |
AB12345-002 | 2023-03-27 | 2023-03-27 23:59:59 | Week 24 Cut |
AB12345-003 | 2023-03-27 | 2023-03-27 23:59:59 | Week 24 Cut |
AB12345-004 | 2023-03-27 | 2023-03-27 23:59:59 | Week 24 Cut |
AB12345-005 | 2023-03-27 | 2023-03-27 23:59:59 | Week 24 Cut |
The next step is to update DCUT
with the required date per patient required for the variable cut. An example is below using the trial visits as source. If the required event has not been observed, keeping DCUT.DCUTDTC
as the future/today date ensures all data is kept within the cut for that patient.
<- tibble::tribble(
sv ~USUBJID, ~VISIT, ~SVSTDTC,
"AB12345-001", "WEEK24", "2022-06-01",
"AB12345-002", "WEEK24", "2022-06-30",
"AB12345-003", "WEEK24", "2022-07-01",
"AB12345-004", "WEEK24", "2022-05-04",
)
<- dcut %>%
dcut left_join(sv %>% filter(VISIT == "WEEK24") %>% select(USUBJID, SVSTDTC)) %>%
mutate(DCUTDTC = as.character(ifelse(!is.na(SVSTDTC), SVSTDTC, as.character(DCUTDTC)))) %>%
impute_dcutdtc(dsin = ., varin = DCUTDTC, varout = DCUTDTM)
USUBJID | DCUTDTC | DCUTDTM | DCUTDESC |
---|---|---|---|
AB12345-001 | 2022-06-01 | 2022-06-01 23:59:59 | Week 24 Cut |
AB12345-002 | 2022-06-30 | 2022-06-30 23:59:59 | Week 24 Cut |
AB12345-003 | 2022-07-01 | 2022-07-01 23:59:59 | Week 24 Cut |
AB12345-004 | 2022-05-04 | 2022-05-04 23:59:59 | Week 24 Cut |
AB12345-005 | 2023-03-27 | 2023-03-27 23:59:59 | Week 24 Cut |
Now that DCUT
is prepared, the rest of the process follows the same as previously prescribed using either the wrapped function approach Link or modular approach Link
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.