This function is deprecated, please use derive_param_extreme_event()
instead with the order
argument instead of the date_var
argument.
Usage
derive_param_first_event(
dataset,
dataset_adsl,
dataset_source,
filter_source,
date_var,
subject_keys = vars(STUDYID, USUBJID),
set_values_to,
check_type = "warning"
)
Arguments
- dataset
Input dataset
The
PARAMCD
variable is expected.- dataset_adsl
ADSL input dataset
The variables specified for
subject_keys
are expected. For each observation of the specified dataset a new observation is added to the input dataset.- dataset_source
Source dataset
All observations in the specified dataset fulfilling the condition specified by
filter_source
are considered as event.The variables specified by the
subject_keys
anddate_var
parameter are expected.- filter_source
Source filter
All observations in
dataset_source
fulfilling the specified condition are considered as event.For subjects with at least one event
AVALC
is set to"Y"
,AVAL
to1
, andADT
to the first date where the condition is fulfilled.For all other subjects
AVALC
is set to"N"
,AVAL
to0
, andADT
toNA
.- date_var
Date variable
Date variable in the source dataset (
dataset_source
). The variable is used to sort the source dataset.ADT
is set to the specified variable for events.- subject_keys
Variables to uniquely identify a subject
A list of symbols created using
vars()
is expected.- set_values_to
Variables to set
A named list returned by
vars()
defining the variables to be set for the new parameter, e.g.vars(PARAMCD = "PD", PARAM = "Disease Progression")
is expected. The values must be symbols, character strings, numeric values, orNA
.- check_type
Check uniqueness?
If
"warning"
or"error"
is specified, a message is issued if the observations of the input dataset restricted to the source parameter (source_param
) are not unique with respect to the subject keys (subject_key
parameter) andADT
.Permitted Values:
"none"
,"warning"
,"error"
Details
The input dataset is restricted to observations fulfilling
filter_source
.For each subject (with respect to the variables specified for the
subject_keys
parameter) the first observation (with respect todate_var
) where the event condition (filter_source
parameter) is fulfilled is selected.For each observation in
dataset_adsl
a new observation is created. For subjects with eventAVALC
is set to"Y"
,AVAL
to1
, andADT
to the first date where the event condition is fulfilled. For all other subjectsAVALC
is set to"N"
,AVAL
to0
, andADT
toNA
. For subjects with event all variables fromdataset_source
are kept. For subjects without event all variables which are in bothdataset_adsl
anddataset_source
are kept.The variables specified by the
set_values_to
parameter are added to the new observations.The new observations are added to input dataset.
See also
Other deprecated:
derive_derived_param()
,
derive_var_aendy()