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
PARAMCDvariable is expected.- dataset_adsl
ADSL input dataset
The variables specified for
subject_keysare 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_sourceare considered as event.The variables specified by the
subject_keysanddate_varparameter are expected.- filter_source
Source filter
All observations in
dataset_sourcefulfilling the specified condition are considered as event.For subjects with at least one event
AVALCis set to"Y",AVALto1, andADTto the first date where the condition is fulfilled.For all other subjects
AVALCis set to"N",AVALto0, andADTtoNA.- date_var
Date variable
Date variable in the source dataset (
dataset_source). The variable is used to sort the source dataset.ADTis 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_keyparameter) 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_keysparameter) the first observation (with respect todate_var) where the event condition (filter_sourceparameter) is fulfilled is selected.For each observation in
dataset_adsla new observation is created. For subjects with eventAVALCis set to"Y",AVALto1, andADTto the first date where the event condition is fulfilled. For all other subjectsAVALCis set to"N",AVALto0, andADTtoNA. For subjects with event all variables fromdataset_sourceare kept. For subjects without event all variables which are in bothdataset_adslanddataset_sourceare kept.The variables specified by the
set_values_toparameter are added to the new observations.The new observations are added to input dataset.
See also
Other deprecated:
derive_derived_param(),
derive_var_aendy()
