Description Usage Arguments Details Value Author(s)
View source: R/derive_param_tte.R
Select for each subject the first or last observation with respect to a date from a list of sources.
1 2 3 4 5 6 7 8 | filter_date_sources(
sources,
source_datasets,
by_vars,
create_datetime = FALSE,
subject_keys,
mode
)
|
sources |
Sources A list of |
source_datasets |
Source datasets A named list of datasets is expected. The |
by_vars |
By variables If the parameter is specified, for each by group the observations are selected separately. |
create_datetime |
Create datetime variable? If set to |
subject_keys |
Variables to uniquely identify a subject A list of symbols created using |
mode |
Selection mode (first or last) If Permitted Values: |
The following steps are performed to create the output dataset:
For each source dataset the observations as specified by
the filter
element are selected. Then for each patient the first or last
observation (with respect to date
) 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. If the source variable is a character variable, it
is converted to a date. If the date is incomplete, it is imputed as
the first possible date.
The CNSR
is added and set to the value of the censor
element.
The selected observations of all source datasets are combined into a single dataset.
For each patient the first or last observation (with respect to the
ADT
variable) from the single dataset is selected.
A dataset with one observation per subject as described in the "Details" section.
Stefan Bundfuss
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.