derive_param_bsa: Adds a Parameter for BSA (Body Surface Area) Using the...

Description Usage Arguments Value Author(s) Examples

View source: R/derive_advs_params.R

Description

Adds a record for BSA (Body Surface Area) using the specified derivation method for each by group (e.g., subject and visit) where the source parameters are available.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
derive_param_bsa(
  dataset,
  by_vars,
  method,
  set_values_to = vars(PARAMCD = "BSA"),
  height_code = "HEIGHT",
  weight_code = "WEIGHT",
  get_unit_expr,
  filter = NULL
)

Arguments

dataset

Input dataset

The variables specified by the by_vars parameter, PARAMCD, and AVAL are expected.

The variable specified by by_vars and PARAMCD must be a unique key of the input dataset after restricting it by the filter condition (filter parameter) and to the parameters specified by HEIGHT and WEIGHT.

by_vars

Grouping variables

For each group defined by by_vars an observation is added to the output dataset.

Permitted Values: list of variables

method

Derivation method to use. Note that HEIGHT is expected in cm and WEIGHT is expected in kg:

Mosteller: sqrt(height * weight / 3600)

DuBois-DuBois: 0.20247 * (height/100) ^ 0.725 * weight ^ 0.425

Haycock: 0.024265 * height ^ 0.3964 * weight ^ 0.5378

Gehan-George: 0.0235 * height ^ 0.42246 * weight ^ 0.51456

Boyd: 0.0003207 * (height ^ 0.3) * (1000 * weight) ^ (0.7285 - (0.0188 * log10(1000 * weight)))

Fujimoto: 0.008883 * height ^ 0.663 * weight ^ 0.444

Takahira: 0.007241 * height ^ 0.725 * weight ^ 0.425

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 vars(PARAMCD = "MAP") defines the parameter code for the new parameter.

Permitted Values: List of variable-value pairs

height_code

HEIGHT parameter code

The observations where PARAMCD equals the specified value are considered as the HEIGHT assessments. It is expected that HEIGHT is measured in cm.

Permitted Values: character value

weight_code

WEIGHT parameter code

The observations where PARAMCD equals the specified value are considered as the WEIGHT assessments. It is expected that WEIGHT is measured in kg.

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

Value

The input dataset with the new parameter added

Author(s)

Eric Simms

Examples

 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
advs <- tibble::tribble(
  ~USUBJID,      ~PARAMCD, ~PARAM,        ~AVAL, ~AVALU, ~VISIT,
  "01-701-1015", "HEIGHT", "Height (cm)", 170,   "cm",   "BASELINE",
  "01-701-1015", "WEIGHT", "Weight (kg)",  75,   "kg",   "BASELINE",
  "01-701-1015", "WEIGHT", "Weight (kg)",  78,   "kg",   "MONTH 1",
  "01-701-1015", "WEIGHT", "Weight (kg)",  80,   "kg",   "MONTH 2",
  "01-701-1028", "HEIGHT", "Height (cm)", 185,   "cm",   "BASELINE",
  "01-701-1028", "WEIGHT", "Weight (kg)",  90,   "kg",   "BASELINE",
  "01-701-1028", "WEIGHT", "Weight (kg)",  88,   "kg",   "MONTH 1",
  "01-701-1028", "WEIGHT", "Weight (kg)",  85,   "kg",   "MONTH 2",
)

derive_param_bsa(
  advs,
  by_vars = vars(USUBJID, VISIT),
  method = "Mosteller",
  get_unit_expr = AVALU
)

derive_param_bsa(
  advs,
  by_vars = vars(USUBJID, VISIT),
  method = "Fujimoto",
  get_unit_expr = extract_unit(PARAM)
)

epijim/admiral documentation built on Feb. 13, 2022, 12:15 a.m.