library(tibble)
adeg <- 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 = exprs(USUBJID, VISIT),
method = "Bazett",
set_values_to = exprs(
PARAMCD = "QTCBR",
PARAM = "QTcB - Bazett's Correction Formula Rederived (msec)",
AVALU = "msec"
),
get_unit_expr = AVALU
)
derive_param_qtc(
adeg,
by_vars = exprs(USUBJID, VISIT),
method = "Fridericia",
set_values_to = exprs(
PARAMCD = "QTCFR",
PARAM = "QTcF - Fridericia's Correction Formula Rederived (msec)",
AVALU = "msec"
),
get_unit_expr = extract_unit(PARAM)
)
derive_param_qtc(
adeg,
by_vars = exprs(USUBJID, VISIT),
method = "Sagie",
set_values_to = exprs(
PARAMCD = "QTLCR",
PARAM = "QTlc - Sagie's Correction Formula Rederived (msec)",
AVALU = "msec"
),
get_unit_expr = extract_unit(PARAM)
)
Run the code above in your browser using DataLab