View source: R/derive_param_tte.R
| derive_param_tte | R Documentation |
Add a time-to-event parameter to the input dataset.
derive_param_tte(
dataset = NULL,
dataset_adsl,
source_datasets,
by_vars = NULL,
start_date = TRTSDT,
event_conditions,
censor_conditions,
create_datetime = FALSE,
set_values_to,
subject_keys = get_admiral_option("subject_keys"),
check_type = "warning"
)
dataset |
Input dataset
|
dataset_adsl |
ADSL input dataset The variables specified for |
source_datasets |
Source datasets A named list of datasets is expected. The |
by_vars |
By variables If the parameter is specified, separate time to event parameters are derived for each by group. The by variables must be in at least one of the source datasets. Each source dataset must contain either all by variables or none of the by variables. The by variables are not included in the output dataset. |
start_date |
Time to event origin date The variable If the event or censoring date is before the origin date, |
event_conditions |
Sources and conditions defining events A list of |
censor_conditions |
Sources and conditions defining censorings A list of |
create_datetime |
Create datetime variables? If set to |
set_values_to |
Variables to set A named list returned by |
subject_keys |
Variables to uniquely identify a subject A list of symbols created using |
check_type |
Check uniqueness If |
The following steps are performed to create the observations of the new parameter:
Deriving the events:
For each event source dataset the observations as
specified by the filter element are selected. Then for each subject the
first observation (with respect to date and order) is selected.
The ADT variable is set to the variable specified by the
date element. If the date variable is a datetime variable, only
the datepart is copied.
The CNSR variable is added and set to the censor element.
The variables specified by the set_values_to element are
added.
The selected observations of all event source datasets are combined into a single dataset.
For each subject the first observation (with respect to the
ADT/ADTM variable) from the single dataset is selected. If there is
more than one event with the same date, the first event with respect to the
order of events in event_conditions is selected.
Deriving the censoring observations:
For each censoring source dataset the observations as
specified by the filter element are selected. Then for each subject the
last observation (with respect to date and order) is selected.
The ADT variable is set to the variable specified by the
date element. If the date variable is a datetime variable, only
the datepart is copied.
The CNSR variable is added and set to the censor element.
The variables specified by the set_values_to element are
added.
The selected observations of all censoring source datasets are combined into a single dataset.
For each subject the last observation (with respect to the
ADT/ADTM variable) from the single dataset is selected. If there is
more than one censoring with the same date, the last censoring with respect
to the order of censorings in censor_conditions is selected.
For each subject (as defined by the subject_keys parameter) an
observation is selected. If an event is available, the event observation is
selected. Otherwise the censoring observation is selected.
Finally:
The variable specified for start_date is joined from the
ADSL dataset. Only subjects in both datasets are kept,
i.e., subjects with both an event or censoring and an observation in
dataset_adsl.
The variables as defined by the set_values_to parameter are added.
The ADT/ADTM variable is set to the maximum of ADT/ADTM and
STARTDT/STARTDTM (depending on the create_datetime parameter).
The new observations are added to the output dataset.
The input dataset with the new parameter added
event_source(), censor_source()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.