derive_param_clinbenefit {admiralonco} | R Documentation |
Adds a parameter for clinical benefit/disease control
derive_param_clinbenefit(
dataset,
dataset_adsl,
filter_source,
source_resp,
source_pd = NULL,
source_datasets,
reference_date,
ref_start_window,
aval_fun,
clinben_vals = c("CR", "PR", "SD", "NON-CR/NON-PD"),
set_values_to,
subject_keys = get_admiral_option("subject_keys")
)
dataset |
Input dataset. This is the dataset to which the clinical benefit rate parameter will be added. The variables After applying |
dataset_adsl |
ADSL input dataset. The variables specified for |
filter_source |
Filter condition in |
source_resp |
A |
source_pd |
A |
source_datasets |
A named list of data sets is expected. The list must contain the names provided by the |
reference_date |
Name of variable representing the index date for
|
ref_start_window |
Integer representing number of days from |
aval_fun |
Deprecated, please use Function to map character analysis value ( The (first) argument of the function must expect a character vector and the function must return a numeric vector. |
clinben_vals |
A vector of response values to be considered when determining clinical benefit. |
set_values_to |
A named list returned by |
subject_keys |
A named list returned by |
Clinical benefit/disease control is first identified by looking for subjects
having response status, and then derived for subjects that have at least one
evaluable non-PD response assessment prior to first PD (Progressive Disease)
(i.e., responses inclusive of CR
, PR
, SD
, and NON-CR/NON-PD
) and after a specified
amount of time from a reference date (ref_start_window
).
Note: The user input values they wish to include when determining
clinical benefit using the argument clinben_vals
. The default values for this are
CR
, PR
, SD
, and NON-CR/NON-PD
, as listed above. In the below example,
eligible values be limited to CR
and PR
.
Example: clinben_vals <- c("CR", "PR")
The input dataset (dataset
) is restricted to the observations matching
filter_source
and to observations before or at the date specified by source_pd
.
This dataset is further restricted to include user-generated response
assessments from clinben_vals
or include response assessments of CR
,
PR
, SD
, and NON-CR/NON-PD
, exclude missing response assessments, and
exclude those less than ref_start_window
after reference_date
. The earliest
assessment by ADT
is then selected.
The dataset identified by dataset
in source_resp
is restricted
according to its filter
argument. The variable corresponding to the date
parameter of source_resp
is considered together with ADT
from the
previous step.
For the observations being added to dataset
, ADT
is set to the earlier
of the first assessment date representing an evaluable non-PD assessment prior
to first PD, or the date representing the start of response.
For the observations being added to dataset
, AVALC
is set to
Y
for those subjects in the dataset
meeting the criteria for clinical
benefit above
N
for subjects not meeting the clinical benefit criteria in dataset
or the dataset identified in source_resp
N
for subjects present in dataset_adsl
but not present in dataset
or the dataset identified in source_resp
.
AVAL
is derived using AVALC
as input to the function specified in
aval_fun
.
The variables specified by set_values_to
are added to the new observations
with values equal to the values specified in the same.
The new observations are added to dataset
. Variables held in common
between dataset
and dataset_adsl
are kept for the new observations, and
are populated with their values from dataset_adsl
.
The input dataset with a new parameter for clinical benefit
Andrew Smith
ADRS Functions for adding Parameters:
derive_param_bor()
,
derive_param_confirmed_bor()
,
derive_param_confirmed_resp()
,
derive_param_response()
library(lubridate)
library(dplyr)
library(admiral)
adsl <- tibble::tribble(
~USUBJID, ~TRTSDT,
"01", ymd("2020-01-14"),
"02", ymd("2021-02-16"),
"03", ymd("2021-03-09"),
"04", ymd("2021-04-21")
) %>%
mutate(STUDYID = "AB42")
adrs <- tibble::tribble(
~USUBJID, ~PARAMCD, ~AVALC, ~ADT,
"01", "RSP", "Y", ymd("2021-03-14"),
"02", "RSP", "N", ymd("2021-05-07"),
"03", "RSP", "N", NA,
"04", "RSP", "N", NA,
"01", "PD", "N", NA,
"02", "PD", "Y", ymd("2021-05-07"),
"03", "PD", "N", NA,
"04", "PD", "N", NA,
"01", "OVR", "SD", ymd("2020-03-14"),
"01", "OVR", "PR", ymd("2021-04-13"),
"02", "OVR", "PR", ymd("2021-04-08"),
"02", "OVR", "PD", ymd("2021-05-07"),
"02", "OVR", "CR", ymd("2021-06-20"),
"03", "OVR", "SD", ymd("2021-03-30"),
"04", "OVR", "NE", ymd("2021-05-21"),
"04", "OVR", "NA", ymd("2021-06-30"),
"04", "OVR", "NE", ymd("2021-07-24"),
"04", "OVR", "ND", ymd("2021-09-04"),
) %>%
mutate(STUDYID = "AB42", ANL01FL = "Y") %>%
derive_vars_merged(
dataset_add = adsl,
by_vars = exprs(STUDYID, USUBJID),
new_vars = exprs(TRTSDT)
)
pd <- date_source(
dataset_name = "adrs",
date = ADT,
filter = PARAMCD == "PD" & AVALC == "Y" & ANL01FL == "Y"
)
resp <- date_source(
dataset_name = "adrs",
date = ADT,
filter = PARAMCD == "RSP" & AVALC == "Y" & ANL01FL == "Y"
)
derive_param_clinbenefit(
dataset = adrs,
dataset_adsl = adsl,
filter_source = PARAMCD == "OVR" & ANL01FL == "Y",
source_resp = resp,
source_pd = pd,
source_datasets = list(adrs = adrs),
reference_date = TRTSDT,
ref_start_window = 28,
set_values_to = exprs(
PARAMCD = "CBR"
)
) %>%
filter(PARAMCD == "CBR")