Hello admiralmetabolic!
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Introduction
The 
Package Contents
For this first 0.1 release, 
- Obesity-specific SDTM test data (to be moved to SDTM Test Data for the Pharmaverse Family of Packages • pharmaversesdtm {pharmaversesdtm} at the next release of the package);
- Two brand-new functions: Adds a Parameter for Waist to Height Ratio — derive_param_waisthgt • admiralmetabolic admiralmetabolic::derive_param_waisthgt() andAdds a Parameter for Waist to Hip Ratio — derive_param_waisthip • admiralmetabolic admiralmetabolic::derive_param_waisthip() ;
- Two vignettes for an obesity vital signs ADaM ADVS and a Control of Eating Questionnaire ADaM ADCOEQ;
- Two template programs for ADVS and ADCOEQ matching the corresponding vignettes.
New Functions
The first function, 
library(tibble)
library(admiral)
library(admiralmetabolic)
# Derive Waist to Height Ratio. In this example height is measured only once per subject.
advs <- tribble(
  ~USUBJID,      ~PARAMCD, ~PARAM,                     ~AVAL, ~AVALU, ~VISIT,
  "01-101-1001", "HEIGHT", "Height (cm)",              147,   "cm",   "SCREENING",
  "01-101-1001", "WSTCIR", "Waist Circumference (cm)", 110,   "cm",   "SCREENING",
  "01-101-1001", "WSTCIR", "Waist Circumference (cm)", 108,   "cm",   "WEEK 2",
  "01-101-1001", "WSTCIR", "Waist Circumference (cm)", 107,   "cm",   "WEEK 3",
  "01-101-1002", "HEIGHT", "Height (cm)",              163,   "cm",   "SCREENING",
  "01-101-1002", "WSTCIR", "Waist Circumference (cm)", 120,   "cm",   "SCREENING",
  "01-101-1002", "WSTCIR", "Waist Circumference (cm)", 118,   "cm",   "WEEK 2",
  "01-101-1002", "WSTCIR", "Waist Circumference (cm)", 117,   "cm",   "WEEK 3",
)
derive_param_waisthgt(
  advs,
  by_vars = exprs(USUBJID, VISIT),
  wstcir_code = "WSTCIR",
  height_code = "HEIGHT",
  set_values_to = exprs(
    PARAMCD = "WAISTHGT",
    PARAM = "Waist to Height Ratio"
  ),
  constant_by_vars = exprs(USUBJID),
  get_unit_expr = admiral::extract_unit(PARAM)
)
# A tibble: 14 × 6 USUBJID PARAMCD PARAM AVAL AVALU VISIT <chr> <chr> <chr> <dbl> <chr> <chr> 1 01-101-1001 HEIGHT Height (cm) 147 cm SCREENING 2 01-101-1001 WSTCIR Waist Circumference (cm) 110 cm SCREENING 3 01-101-1001 WSTCIR Waist Circumference (cm) 108 cm WEEK 2 4 01-101-1001 WSTCIR Waist Circumference (cm) 107 cm WEEK 3 5 01-101-1002 HEIGHT Height (cm) 163 cm SCREENING 6 01-101-1002 WSTCIR Waist Circumference (cm) 120 cm SCREENING 7 01-101-1002 WSTCIR Waist Circumference (cm) 118 cm WEEK 2 8 01-101-1002 WSTCIR Waist Circumference (cm) 117 cm WEEK 3 9 01-101-1001 WAISTHGT Waist to Height Ratio 0.748 <NA> SCREENING 10 01-101-1001 WAISTHGT Waist to Height Ratio 0.735 <NA> WEEK 2 11 01-101-1001 WAISTHGT Waist to Height Ratio 0.728 <NA> WEEK 3 12 01-101-1002 WAISTHGT Waist to Height Ratio 0.736 <NA> SCREENING 13 01-101-1002 WAISTHGT Waist to Height Ratio 0.724 <NA> WEEK 2 14 01-101-1002 WAISTHGT Waist to Height Ratio 0.718 <NA> WEEK 3
Note that this function has built-in support for:
- Unit conversion in cases where units differ across the numerator and denominator (allowed units: m, mm, ft, in);
- Single or multiple height measurement by modifying the argument constant_by_vars. Please visit the function’s reference page for more details.
advs2 <- tribble(
  ~USUBJID,      ~PARAMCD, ~PARAM,                     ~AVAL, ~AVALU, ~VISIT,
  "01-101-1001", "HIPCIR", "Hip Circumference (cm)",   125,   "cm",   "SCREENING",
  "01-101-1001", "HIPCIR", "Hip Circumference (cm)",   124,   "cm",   "WEEK 2",
  "01-101-1001", "WSTCIR", "Waist Circumference (in)", 43.31, "in",   "SCREENING",
  "01-101-1001", "WSTCIR", "Waist Circumference (in)", 42.52, "in",   "WEEK 2",
  "01-101-1002", "HIPCIR", "Hip Circumference (cm)",   135,   "cm",   "SCREENING",
  "01-101-1002", "HIPCIR", "Hip Circumference (cm)",   133,   "cm",   "WEEK 2",
  "01-101-1002", "WSTCIR", "Waist Circumference (in)", 47.24, "in",   "SCREENING",
  "01-101-1002", "WSTCIR", "Waist Circumference (in)", 46.46, "in",   "WEEK 2"
)
derive_param_waisthip(
  advs2,
  by_vars = exprs(USUBJID, VISIT),
  wstcir_code = "WSTCIR",
  hipcir_code = "HIPCIR",
  set_values_to = exprs(
    PARAMCD = "WAISTHIP",
    PARAM = "Waist to Hip Ratio"
  ),
  get_unit_expr = admiral::extract_unit(PARAM)
)
ℹ Unit conversion performed for "HIPCIR". Values converted from "cm" to "in".
# A tibble: 12 × 6 USUBJID PARAMCD PARAM AVAL AVALU VISIT <chr> <chr> <chr> <dbl> <chr> <chr> 1 01-101-1001 HIPCIR Hip Circumference (cm) 125 cm SCREENING 2 01-101-1001 HIPCIR Hip Circumference (cm) 124 cm WEEK 2 3 01-101-1001 WSTCIR Waist Circumference (in) 43.3 in SCREENING 4 01-101-1001 WSTCIR Waist Circumference (in) 42.5 in WEEK 2 5 01-101-1002 HIPCIR Hip Circumference (cm) 135 cm SCREENING 6 01-101-1002 HIPCIR Hip Circumference (cm) 133 cm WEEK 2 7 01-101-1002 WSTCIR Waist Circumference (in) 47.2 in SCREENING 8 01-101-1002 WSTCIR Waist Circumference (in) 46.5 in WEEK 2 9 01-101-1001 WAISTHIP Waist to Hip Ratio 0.880 <NA> SCREENING 10 01-101-1001 WAISTHIP Waist to Hip Ratio 0.871 <NA> WEEK 2 11 01-101-1002 WAISTHIP Waist to Hip Ratio 0.889 <NA> SCREENING 12 01-101-1002 WAISTHIP Waist to Hip Ratio 0.887 <NA> WEEK 2
Vignettes and Template
On the 
Of course, this vignette is coupled with the obesity ADVS template program, which users can use as a starting point for their ADaM scripts. The template can also be loaded and saved directly from the R console by running:
admiral::use_ad_template("ADVS", package = "admiralmetabolic")
The Control of Eating Questionnaire (COEQ) is used in many obesity trials as an endpoint. As such, 
Once again, this vignette comes hand-in-hand with the ADCOEQ program, which can be accessed through the link above or directly from the R console by running:
admiral::use_ad_template("ADCOEQ", package = "admiralmetabolic")
Conclusion
We love growing the 
Finally, if you have any suggestions for new extension packages, or would like to drive one yourself, please reach out to the 
Last updated
2025-01-21 14:38:35.140162
Details
Reuse
Citation
@online{askeland2025,
  author = {Askeland, Anders and Mancini, Edoardo},
  title = {Hello Admiralmetabolic!},
  date = {2025-01-21},
  url = {https://pharmaverse.github.io/blog/posts/2025-01-21_hello_admiralmetabolic/hello_admiralmetabolic.html},
  langid = {en}
}
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
 
