
Adds a Parameter Computed from the Analysis Value of Other Parameters
Source:R/derive_param_computed.R
derive_derived_param.Rd
Usage
derive_derived_param(
dataset,
by_vars,
parameters,
analysis_value,
set_values_to,
filter = NULL,
constant_by_vars = NULL,
constant_parameters = NULL
)
Arguments
- dataset
Input dataset
The variables specified by the
by_vars
parameter,PARAMCD
, andAVAL
are expected.The variable specified by
by_vars
andPARAMCD
must be a unique key of the input dataset after restricting it by the filter condition (filter
parameter) and to the parameters specified byparameters
.- by_vars
Grouping variables
For each group defined by
by_vars
an observation is added to the output dataset. Only variables specified inby_vars
will be populated in the newly created records.Permitted Values: list of variables
- parameters
Required parameter codes
It is expected that all parameter codes (
PARAMCD
) which are required to derive the new parameter are specified for this parameter or theconstant_parameters
parameter.Permitted Values: A character vector of
PARAMCD
values- analysis_value
Definition of the analysis value
An expression defining the analysis value (
AVAL
) of the new parameter is expected. The analysis values of the parameters specified byparameters
can be accessed usingAVAL.<parameter code>
, e.g.,AVAL.SYSBP
.Permitted Values: An unquoted expression
- set_values_to
Variables to be set
The specified variables are set to the specified values for the new observations. For example
vars(PARAMCD = "MAP")
defines the parameter code for the new parameter.Permitted Values: List of variable-value pairs
- filter
Filter condition
The specified condition is applied to the input dataset before deriving the new parameter, i.e., only observations fulfilling the condition are taken into account.
Permitted Values: a condition
- constant_by_vars
By variables for constant parameters
The constant parameters (parameters that are measured only once) are merged to the other parameters using the specified variables. (Refer to Example 2)
Permitted Values: list of variables
- constant_parameters
Required constant parameter codes
It is expected that all the parameter codes (
PARAMCD
) which are required to derive the new parameter and are measured only once are specified here. For example if BMI should be derived and height is measured only once while weight is measured at each visit. Height could be specified in theconstant_parameters
parameter. (Refer to Example 2)Permitted Values: A character vector of
PARAMCD
values
Value
The input dataset with the new parameter added. Note, a variable will only
be populated in the new parameter rows if it is specified in by_vars
.
See also
Other deprecated:
derive_param_first_event()
,
derive_var_aendy()