Derive a Disposition Status at a Specific Timepoint
Source:R/derive_var_disposition_status.R
derive_var_disposition_status.Rd
This function is deprecated, Please define your own function and use that as input for the
cat_fun
argument in derive_var_merged_cat()
instead.
Derive a disposition status from the the relevant records in the disposition domain.
Usage
derive_var_disposition_status(
dataset,
dataset_ds,
new_var,
status_var,
format_new_var = format_eoxxstt_default,
filter_ds,
subject_keys = get_admiral_option("subject_keys")
)
Arguments
- dataset
Input dataset.
- dataset_ds
Dataset containing the disposition information (e.g.: ds).
It must contain:
STUDYID
,USUBJID
,The variable(s) specified in the
status_var
The variables used in
filter_ds
.
- new_var
Name of the disposition status variable.
A variable name is expected (e.g.
EOSSTT
).- status_var
The variable used to derive the disposition status.
A variable name is expected (e.g.
DSDECOD
).- format_new_var
The format used to derive the status.
Default:
format_eoxxstt_default()
defined as:format_eoxxstt_default <- function(status) { case_when( status %in% c("SCREEN FAILURE", "SCREENING NOT COMPLETED") ~ "NOT STARTED", status == "COMPLETED" ~ "COMPLETED", !status %in% c("COMPLETED", "SCREEN FAILURE", "SCREENING NOT COMPLETED") & !is.na(status) ~ "DISCONTINUED", TRUE ~ "ONGOING" ) }
where
status
is thestatus_var.
- filter_ds
Filter condition for the disposition data.
one observation per patient. An error is issued otherwise.
Permitted Values: logical expression.
- subject_keys
Variables to uniquely identify a subject
A list of expressions where the expressions are symbols as returned by
exprs()
is expected.
Value
The input dataset with the disposition status (new_var
) added.
new_var
is derived based on the values given in status_var
and according to the format
defined by format_new_var
(e.g. when the default format is used, the function will derive
new_var
as:
"NOT STARTED" if status
is "SCREEN FAILURE" or "SCREENING NOT COMPLETED",
"COMPLETED" if status_var
== "COMPLETED",
"DISCONTINUED" if status
is not in ("COMPLETED","SCREEN FAILURE",
"SCREENING NOT COMPLETED") nor NA,
"ONGOING" otherwise).
See also
Other deprecated:
derive_var_confirmation_flag()
,
derive_var_worst_flag()
,
derive_vars_disposition_reason()
,
format_eoxxstt_default()
,
format_reason_default()