derive_var_last_dose_amt: Derive Last Dose Amount

View source: R/derive_var_last_dose_amt.R

derive_var_last_dose_amtR Documentation

Derive Last Dose Amount

Description

Add a variable for dose amount from the last dose to the input dataset.

Note: This is a wrapper function for the function derive_vars_last_dose().

[Deprecated]

This function is deprecated, please use derive_vars_joined() instead.

Usage

derive_var_last_dose_amt(
  dataset,
  dataset_ex,
  filter_ex = NULL,
  by_vars = exprs(STUDYID, USUBJID),
  dose_id = exprs(),
  dose_date,
  analysis_date,
  single_dose_condition = (EXDOSFRQ == "ONCE"),
  new_var,
  dose_var = EXDOSE,
  traceability_vars = NULL
)

Arguments

dataset

Input dataset. The variables specified by the by_vars and analysis_date parameters are expected.

dataset_ex

Input EX dataset. The variables specified by the by_vars, dose_date, new_vars parameters, and source variables from traceability_vars parameter are expected.

filter_ex

Filtering condition applied to EX dataset. For example, it can be used to filter for valid dose. Defaults to NULL.

by_vars

Variables to join by (created by rlang::exprs).

dose_id

Variables to identify unique dose (created by rlang::exprs). Defaults to empty exprs().

dose_date

The EX dose date variable. A date or date-time object is expected.

analysis_date

The analysis date variable. A date or date-time object is expected.

single_dose_condition

The condition for checking if dataset_ex is single dose. An error is issued if the condition is not true. Defaults to (EXDOSFRQ == "ONCE").

new_var

The new variable added to dataset.

dose_var

The EX source dose amount variable. Defaults to EXDOSE.

traceability_vars

A named list returned by exprs() listing the traceability variables, e.g. exprs(LDOSEDOM = "EX", LDOSESEQ = EXSEQ). The left-hand side (names of the list elements) gives the names of the traceability variables in the returned dataset. The right-hand side (values of the list elements) gives the values of the traceability variables in the returned dataset. These can be either strings or symbols referring to existing variables.

Details

The last dose amount is derived as the dose amount where the maximum dose_date is lower to or equal to the analysis_date per by_vars for each observation in dataset.

If dose information is aggregated (i.e. is a dosing frequency other than "ONCE" over a period defined by a start and end date) the function create_single_dose_dataset() can be used to generate single doses from aggregate dose information and satisfy single_dose_condition.

Value

Input dataset with additional column new_var.

See Also

Other deprecated: derive_param_extreme_event(), derive_var_basetype(), derive_var_confirmation_flag(), derive_var_last_dose_date(), derive_var_last_dose_grp(), derive_var_merged_cat(), derive_var_merged_character(), derive_vars_last_dose()


admiral documentation built on Oct. 19, 2023, 1:08 a.m.