forked from pharmaverse/admiral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
derive_var_atoxgr.Rd
77 lines (71 loc) · 2.55 KB
/
derive_var_atoxgr.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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/derive_var_atoxgr.R
\name{derive_var_atoxgr}
\alias{derive_var_atoxgr}
\title{Derive Lab High toxicity Grade 0 - 4 and Low Toxicity Grades 0 - (-4)}
\usage{
derive_var_atoxgr(
dataset,
lotox_description_var = ATOXDSCL,
hitox_description_var = ATOXDSCH
)
}
\arguments{
\item{dataset}{Input data set
The columns \code{ATOXGRL}, \code{ATOXGRH} and specified by \code{lotox_description_var},
and \code{hitox_description_var} parameters are expected.}
\item{lotox_description_var}{Variable containing the toxicity grade description
for low values, eg. "Anemia"}
\item{hitox_description_var}{Variable containing the toxicity grade description
for low values, eg. "Hemoglobin Increased".}
}
\value{
The input data set with the character variable added
}
\description{
Derives character lab grade based on high and low severity/toxicity grade(s).
}
\details{
Created variable \code{ATOXGR} will contain values "-4", "-3", "-2", "-1" for low values
and "1", "2", "3", "4" for high values, and will contain "0" if value is gradable
and does not satisfy any of the criteria for high or low values. ATOXGR is set to
missing if information not available to give a grade.
Function applies the following rules:
\itemize{
\item High and low missing - overall missing
\item Low grade not missing and > 0 - overall holds low grade
\item High grade not missing and > 0 - overall holds high grade
\item (Only high direction OR low direction is NORMAL) and high grade normal - overall NORMAL
\item (Only low direction OR high direction is NORMAL) and low grade normal - overall NORMAL
\item otherwise set to missing
}
}
\examples{
library(tibble)
adlb <- tribble(
~ATOXDSCL, ~ATOXDSCH, ~ATOXGRL, ~ATOXGRH,
"Hypoglycemia", "Hyperglycemia", NA_character_, "0",
"Hypoglycemia", "Hyperglycemia", "0", "1",
"Hypoglycemia", "Hyperglycemia", "0", "0",
NA_character_, "INR Increased", NA_character_, "0",
"Hypophosphatemia", NA_character_, "1", NA_character_
)
derive_var_atoxgr(adlb)
}
\seealso{
BDS-Findings Functions that returns variable appended to dataset:
\code{\link{derive_var_analysis_ratio}()},
\code{\link{derive_var_anrind}()},
\code{\link{derive_var_atoxgr_dir}()},
\code{\link{derive_var_basetype}()},
\code{\link{derive_var_base}()},
\code{\link{derive_var_chg}()},
\code{\link{derive_var_ontrtfl}()},
\code{\link{derive_var_pchg}()},
\code{\link{derive_var_shift}()}
}
\author{
Gordon Miller
}
\concept{der_bds_findings}
\keyword{der_bds_findings}