From 5eb6fbb7cfb54efc71f2bea261fc226e8d001cef Mon Sep 17 00:00:00 2001 From: jim Date: Fri, 15 Nov 2024 06:26:05 -0800 Subject: [PATCH 1/4] Closes #2532 Update Forumula for Body Surface Area (#2541) * Made small change in BuBois-DuBois formula for surface area (derive_advs_params.R) * ran document() * use new DuBois-DuBois equation in test_that * run styler::styler_pkg() * Add to NEWS.md * Put news under "Updates of Existing Functions" * With revised DuBois-DuBois formula using meters, change units from "cm" to "m" But the example data is still in "cm" * undo (restore) incorrect changes to derive_advs_params.R units should be cm. * Correct comments (HEIGHT units are in cm); NEWS.md * Correct NEWS.md conflict * Update NEWS.md Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> --------- Co-authored-by: Ben Straub Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com> --- NEWS.md | 1 + R/derive_advs_params.R | 6 ++---- man/compute_bsa.Rd | 2 +- tests/testthat/test-derive_advs_params.R | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index a9cc08ec4f..1837515d16 100644 --- a/NEWS.md +++ b/NEWS.md @@ -71,6 +71,7 @@ example, `">2.5 x ULN"` changed to `">2.5"` for grade 3. (#2534) - Created unit tests for developer internal function `restricted_imputed_dtc_dt()` (#2495) - Adopted `data-raw/data` R Package Convention (#2427) +- `compute_bsa()` now uses the more common (but equivalent) version of the DuBois-DuBois formula for BSA. The results have not changed. (#2532) - Removed `.devcontainer` file (codespace) (#2524) diff --git a/R/derive_advs_params.R b/R/derive_advs_params.R index 7c95af4b86..14f17980e3 100644 --- a/R/derive_advs_params.R +++ b/R/derive_advs_params.R @@ -462,7 +462,7 @@ derive_param_bsa <- function(dataset, #' #' Mosteller: sqrt(height * weight / 3600) #' -#' DuBois-DuBois: 0.20247 * (height/100) ^ 0.725 * weight ^ 0.425 +#' DuBois-DuBois: 0.007184 * height ^ 0.725 * weight ^ 0.425 #' #' Haycock: 0.024265 * height ^ 0.3964 * weight ^ 0.5378 #' @@ -519,9 +519,7 @@ compute_bsa <- function(height = height, if (method == "Mosteller") { bsa <- sqrt(height * weight / 3600) } else if (method == "DuBois-DuBois") { - # The DuBois & DuBois formula expects the value of height in meters - # We need to convert from cm - bsa <- 0.20247 * (height / 100)^0.725 * weight^0.425 + bsa <- 0.007184 * height^0.725 * weight^0.425 } else if (method == "Haycock") { bsa <- 0.024265 * height^0.3964 * weight^0.5378 } else if (method == "Gehan-George") { diff --git a/man/compute_bsa.Rd b/man/compute_bsa.Rd index 86cc48b7ac..0a31db8d28 100644 --- a/man/compute_bsa.Rd +++ b/man/compute_bsa.Rd @@ -23,7 +23,7 @@ It is expected that WEIGHT is in kg. Mosteller: sqrt(height * weight / 3600) -DuBois-DuBois: 0.20247 * (height/100) ^ 0.725 * weight ^ 0.425 +DuBois-DuBois: 0.007184 * height ^ 0.725 * weight ^ 0.425 Haycock: 0.024265 * height ^ 0.3964 * weight ^ 0.5378 diff --git a/tests/testthat/test-derive_advs_params.R b/tests/testthat/test-derive_advs_params.R index 70c8c5d77e..5bd5b2911e 100644 --- a/tests/testthat/test-derive_advs_params.R +++ b/tests/testthat/test-derive_advs_params.R @@ -54,7 +54,7 @@ test_that("compute_bsa Test 6: Mosteller method - height & weight vectors - miss }) ## compute_bsa: DuBois-DuBois method ---- -# FORMULA : 0.20247 x (HGT/100)^0.725 x WGT^0.425 +# FORMULA : 0.007184 x (HGT)^0.725 x WGT^0.425 ## Test 7: DuBois-DuBois method - single height & weight values ---- test_that("compute_bsa Test 7: DuBois-DuBois method - single height & weight values", { @@ -604,7 +604,7 @@ test_that("derive_param_bsa Test 44: BSA parameter (Mosteller Method) is correct }) dubois <- function(hgt, wgt) { - 0.20247 * (hgt / 100)^0.725 * wgt^0.425 + 0.007184 * hgt^0.725 * wgt^0.425 } ## Test 45: BSA parameter (DuBois-DuBois method) is correctly added ---- From 82bcec2b169e1fd108a3d7f4f747692ba783f6b5 Mon Sep 17 00:00:00 2001 From: bms63 Date: Fri, 15 Nov 2024 14:26:56 +0000 Subject: [PATCH 2/4] [skip actions] Bump version to 1.1.1.9023 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index f68f97cb59..2a3dfdde55 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: admiral Title: ADaM in R Asset Library -Version: 1.1.1.9022 +Version: 1.1.1.9023 Authors@R: c( person("Ben", "Straub", , "ben.x.straub@gsk.com", role = c("aut", "cre")), person("Stefan", "Bundfuss", role = "aut", From 2679c9c510acfbb1008bfdd3bc33d1b6976af1da Mon Sep 17 00:00:00 2001 From: steventing12 Date: Fri, 15 Nov 2024 22:52:50 +0800 Subject: [PATCH 3/4] Closes 2549 Added output dataframe to Derive Shift (SHIFT1) (#2558) --- vignettes/bds_finding.Rmd | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vignettes/bds_finding.Rmd b/vignettes/bds_finding.Rmd index ea28cb87f0..89255a017f 100644 --- a/vignettes/bds_finding.Rmd +++ b/vignettes/bds_finding.Rmd @@ -701,6 +701,14 @@ advs <- derive_var_shift(advs, ) ``` +```{r, eval=TRUE, echo=FALSE} +dataset_vignette( + advs, + display_vars = exprs(USUBJID, SHIFT1, BNRIND, ANRIND, VISIT), + filter = PARAMCD == "DIABP" & VISIT %in% c("WEEK 2", "WEEK 8") +) +``` + If the variables should not be derived for all records, e.g., for post-baseline records only, `restrict_derivation()` can be used. From ebdb2f11ecba17d6cc36e1fef151e3011c1164cc Mon Sep 17 00:00:00 2001 From: bundfussr Date: Fri, 15 Nov 2024 14:53:44 +0000 Subject: [PATCH 4/4] [skip actions] Bump version to 1.1.1.9024 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2a3dfdde55..89d408dbba 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: admiral Title: ADaM in R Asset Library -Version: 1.1.1.9023 +Version: 1.1.1.9024 Authors@R: c( person("Ben", "Straub", , "ben.x.straub@gsk.com", role = c("aut", "cre")), person("Stefan", "Bundfuss", role = "aut",