derive_param_ratio {admiralmetabolic} | R Documentation |
Adds a Ratio Parameter Computed from the Analysis Value of Other Parameters
Description
Adds a record for a generic Ratio parameter using two existing parameter (numerator and denominator) each by group (e.g., subject and visit) where the source parameters are available.
Note: This is a wrapper function for the more generic admiral::derive_param_computed()
.
Usage
derive_param_ratio(
dataset,
by_vars,
numerator_code,
denominator_code,
set_values_to,
constant_numerator = FALSE,
constant_denominator = FALSE,
filter = NULL,
constant_by_vars = NULL,
get_unit_expr = NULL,
unit_conversion = FALSE
)
Arguments
dataset |
Input dataset The variables specified by the The variable specified by |
by_vars |
Grouping variables Grouping variables uniquely identifying a set of records for which
Permitted Values: list of variables created by exprs() |
numerator_code |
Numerator parameter code The observations where Permitted Values: character value |
denominator_code |
Denominator parameter code The observations where Permitted Values: character value |
set_values_to |
Variables to be set The specified variables are set to the specified values for the new
observations. For example Permitted Values: List of variable-value pairs |
constant_numerator |
Is numerator parameter constant? It is expected that the parameter code (PARAMCD) specified in Permitted Values: logical scalar |
constant_denominator |
Is denominator parameter constant? It is expected that the parameter code (PARAMCD) specified in Permitted Values: logical scalar |
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 when numerator and/or denominator is constant When numerator and/or denominator is constant, the parameters (measured only once) are merged to the other parameters using the specified variables. If numerator and/or denominator is constant (e.g. only measured once at screening or baseline)
then use Permitted Values: list of variables created by |
get_unit_expr |
An expression providing the unit of the parameter The result is used to check the units of the input parameters. If the units are not consistent within each parameter, an error will be thrown. Additionally, if the input parameters are measured in different units but are mutually convertible (e.g., centimeters for one parameter and inches for another), an automatic conversion will be performed in order to uniform the values before calculating the ratio. Note: Conversion factors come from unit definitions as per CDISC standards.
Permitted Values: A variable of the input dataset or a function call |
unit_conversion |
Enable/Disable unit conversion Unit conversion is disabled by default. Ignored if Permitted Values: logical scalar |
Details
The analysis value of the new parameter is derived as
RATIO = \frac{NUMERATOR}{DENOMINATOR}
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 internal:
admiralmetabolic-package