forked from pharmaverse/admiral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathderive_param_qtc.Rd
141 lines (116 loc) · 4.15 KB
/
derive_param_qtc.Rd
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/derive_adeg_params.R
\name{derive_param_qtc}
\alias{derive_param_qtc}
\title{Adds a Parameter for Corrected QT (an ECG measurement)}
\usage{
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
)
}
\arguments{
\item{dataset}{Input dataset
The variables specified by the \code{by_vars} and the \code{unit_var} parameter,
\code{PARAMCD}, and \code{AVAL} are expected.
The variable specified by \code{by_vars} and \code{PARAMCD} must be a unique key of
the input dataset after restricting it by the filter condition (\code{filter}
parameter) and to the parameters specified by \code{qt_code} and \code{rr_code}.}
\item{by_vars}{Grouping variables
Only variables specified in \code{by_vars} will be populated
in the newly created records.
Permitted Values: list of variables}
\item{method}{Method used to QT correction
Permitted Values: \code{"Bazett"}, \code{"Fridericia"}, \code{"Sagie"}}
\item{set_values_to}{Variables to be set
The specified variables are set to the specified values for the new
observations. For example \code{vars(PARAMCD = "MAP")} defines the parameter
code for the new parameter.
\emph{Permitted Values:} List of variable-value pairs}
\item{qt_code}{QT parameter code
The observations where \code{PARAMCD} equals the specified value are considered
as the QT interval assessments. It is expected that QT is measured in msec.
Permitted Values: character value}
\item{rr_code}{RR parameter code
The observations where \code{PARAMCD} equals the specified value are considered
as the RR interval assessments. It is expected that RR is measured in msec.
Permitted Values: character value}
\item{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}
\item{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.
\emph{Permitted Values:} a condition}
}
\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 \code{by_vars}.
}
\description{
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.
}
\examples{
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)
)
}
\seealso{
\code{\link[=compute_qtc]{compute_qtc()}}
}
\author{
Stefan Bundfuss
}
\keyword{adeg}
\keyword{derivation}