derive_var_confirmation_flag {admiral} | R Documentation |
This function is deprecated, please use derive_var_joined_exist_flag()
instead.
derive_var_confirmation_flag(
dataset,
by_vars,
order,
new_var,
tmp_obs_nr_var = NULL,
join_vars,
join_type,
first_cond = NULL,
filter,
true_value = "Y",
false_value = NA_character_,
check_type = "warning"
)
dataset |
Input dataset The variables specified by the |
by_vars |
By variables The specified variables are used as by variables for joining the input dataset with itself. |
order |
Order The observations are ordered by the specified order. |
new_var |
New variable The specified variable is added to the input dataset. |
tmp_obs_nr_var |
Temporary observation number The specified variable is added to the input dataset and set to the
observation number with respect to |
join_vars |
Variables to keep from joined dataset The variables needed from the other observations should be specified
for this parameter. The specified variables are added to the joined dataset
with suffix ".join". For example to flag all observations with The |
join_type |
Observations to keep after joining The argument determines which of the joined observations are kept with
respect to the original observation. For example, if For example for confirmed response or BOR in the oncology setting or
confirmed deterioration in questionnaires the confirmatory assessment must
be after the assessment to be flagged. Thus Whereas, sometimes you might allow for confirmatory observations to occur
prior to the observation to be flagged. For example, to flag AEs occurring
on or after seven days before a COVID AE. Thus Permitted Values: |
first_cond |
Condition for selecting range of data If this argument is specified, the other observations are restricted up to the first observation where the specified condition is fulfilled. If the condition is not fulfilled for any of the other observations, no observations are considered, i.e., the observation is not flagged. This parameter should be specified if |
filter |
Condition for selecting observations The filter is applied to the joined dataset for flagging the confirmed
observations. The condition can include summary functions. The joined
dataset is grouped by the original observations. I.e., the summary function
are applied to all observations up to the confirmation observation. For
example, |
true_value |
Value of Default: |
false_value |
Value of Default: |
check_type |
Check uniqueness? If Default: Permitted Values: |
The following steps are performed to produce the output dataset.
The input dataset is joined with itself by the variables specified for
by_vars
. From the right hand side of the join only the variables
specified for join_vars
are kept. The suffix ".join" is added to these
variables.
For example, for by_vars = USUBJID
, join_vars = exprs(AVISITN, AVALC)
and input dataset
# A tibble: 2 x 4 USUBJID AVISITN AVALC AVAL <chr> <dbl> <chr> <dbl> 1 1 Y 1 1 2 N 0
the joined dataset is
A tibble: 4 x 6 USUBJID AVISITN AVALC AVAL AVISITN.join AVALC.join <chr> <dbl> <chr> <dbl> <dbl> <chr> 1 1 Y 1 1 Y 1 1 Y 1 2 N 1 2 N 0 1 Y 1 2 N 0 2 N
The joined dataset is restricted to observations with respect to
join_type
and order
.
The dataset from the example in the previous step with join_type = "after"
and order = exprs(AVISITN)
is restricted to
A tibble: 4 x 6 USUBJID AVISITN AVALC AVAL AVISITN.join AVALC.join <chr> <dbl> <chr> <dbl> <dbl> <chr> 1 1 Y 1 2 N
If first_cond
is specified, for each observation of the input dataset the
joined dataset is restricted to observations up to the first observation
where first_cond
is fulfilled (the observation fulfilling the condition
is included). If for an observation of the input dataset the condition is
not fulfilled, the observation is removed.
The joined dataset is grouped by the observations from the input dataset
and restricted to the observations fulfilling the condition specified by
filter
.
The first observation of each group is selected
The variable specified by new_var
is added to the input dataset. It is
set to true_value
for all observations which were selected in the
previous step. For the other observations it is set to false_value
.
The input dataset with the variable specified by new_var
added.
Other deprecated:
derive_param_extreme_event()
,
derive_var_basetype()
,
derive_var_last_dose_amt()
,
derive_var_last_dose_date()
,
derive_var_last_dose_grp()
,
derive_var_merged_cat()
,
derive_var_merged_character()
,
derive_vars_last_dose()