
Default Format for Disposition Status
Source:R/derive_var_disposition_status.R
format_eoxxstt_default.Rd
Define a function to map the disposition status. To be used as an input for
derive_var_disposition_status()
.
Value
A character
vector derived based on the values given in status
:
"NOT STARTED" if status
is "SCREEN FAILURE" or "SCREENING NOT COMPLETED",
"COMPLETED" if status
is "COMPLETED",
"DISCONTINUED" if status
is not in ("COMPLETED","SCREEN FAILURE",
"SCREENING NOT COMPLETED") nor NA,
"ONGOING" otherwise.
See also
derive_var_disposition_status()
Utilities for Formatting Observations:
convert_blanks_to_na()
,
convert_na_to_blanks()
,
format_reason_default()
,
yn_to_numeric()
Examples
library(dplyr, warn.conflicts = FALSE)
library(admiral.test)
data("admiral_dm")
data("admiral_ds")
admiral_dm %>%
derive_var_disposition_status(
dataset_ds = admiral_ds,
new_var = EOSSTT,
status_var = DSDECOD,
format_new_var = format_eoxxstt_default,
filter_ds = DSCAT == "DISPOSITION EVENT"
) %>%
select(STUDYID, USUBJID, EOSSTT)
#> # A tibble: 306 x 3
#> STUDYID USUBJID EOSSTT
#> <chr> <chr> <chr>
#> 1 CDISCPILOT01 01-701-1015 COMPLETED
#> 2 CDISCPILOT01 01-701-1023 DISCONTINUED
#> 3 CDISCPILOT01 01-701-1028 COMPLETED
#> 4 CDISCPILOT01 01-701-1033 DISCONTINUED
#> 5 CDISCPILOT01 01-701-1034 COMPLETED
#> 6 CDISCPILOT01 01-701-1047 DISCONTINUED
#> 7 CDISCPILOT01 01-701-1057 NOT STARTED
#> 8 CDISCPILOT01 01-701-1097 COMPLETED
#> 9 CDISCPILOT01 01-701-1111 DISCONTINUED
#> 10 CDISCPILOT01 01-701-1115 DISCONTINUED
#> # … with 296 more rows