Description Usage Arguments Value Author(s) See Also Examples
View source: R/derive_adeg_params.R
Adds a record for corrected QT using either Bazett's, Fridericia's or Sagie's formula for each by group (e.g., subject and visit) where the source parameters are available.
1 2 3 4 5 6 7 8 9 10 | derive_param_qtc(
dataset,
by_vars,
method,
set_values_to = default_qtc_paramcd(method),
qt_code = "QT",
rr_code = "RR",
get_unit_expr,
filter = NULL
)
|
dataset |
Input dataset The variables specified by the The variable specified by |
by_vars |
Grouping variables Permitted Values: list of variables |
method |
Method used to QT correction Permitted Values: |
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 |
qt_code |
QT parameter code The observations where Permitted Values: character value |
rr_code |
RR parameter code The observations where Permitted Values: character value |
get_unit_expr |
An expression providing the unit of the parameter The result is used to check the units of the input parameters. Permitted Values: A variable of the input dataset or a function call |
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 |
The input dataset with the new parameter added
Stefan Bundfuss
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | adeg <- tibble::tribble(
~USUBJID, ~PARAMCD, ~PARAM, ~AVAL, ~AVALU, ~VISIT,
"01-701-1015", "HR", "Heart Rate (beats/min)", 70.14, "beats/min", "BASELINE",
"01-701-1015", "QT", "QT Duration (msec)", 370, "msec", "WEEK 2",
"01-701-1015", "HR", "Heart Rate (beats/min)", 62.66, "beats/min", "WEEK 1",
"01-701-1015", "RR", "RR Duration (msec)", 710, "msec", "WEEK 2",
"01-701-1028", "HR", "Heart Rate (beats/min)", 85.45, "beats/min", "BASELINE",
"01-701-1028", "QT", "QT Duration (msec)", 480, "msec", "WEEK 2",
"01-701-1028", "QT", "QT Duration (msec)", 350, "msec", "WEEK 3",
"01-701-1028", "HR", "Heart Rate (beats/min)", 56.54, "beats/min", "WEEK 3",
"01-701-1028", "RR", "RR Duration (msec)", 842, "msec", "WEEK 2",
)
derive_param_qtc(
adeg,
by_vars = vars(USUBJID, VISIT),
method = "Bazett",
set_values_to = vars(
PARAMCD = "QTCBR",
PARAM = "QTcB - Bazett's Correction Formula Rederived (msec)",
AVALU = "msec"
),
get_unit_expr = AVALU
)
derive_param_qtc(
adeg,
by_vars = vars(USUBJID, VISIT),
method = "Fridericia",
set_values_to = vars(
PARAMCD = "QTCFR",
PARAM = "QTcF - Fridericia's Correction Formula Rederived (msec)",
AVALU = "msec"
),
get_unit_expr = extract_unit(PARAM)
)
derive_param_qtc(
adeg,
by_vars = vars(USUBJID, VISIT),
method = "Sagie",
set_values_to = vars(
PARAMCD = "QTLCR",
PARAM = "QTlc - Sagie's Correction Formula Rederived (msec)",
AVALU = "msec"
),
get_unit_expr = extract_unit(PARAM)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.