Skip to content

Commit

Permalink
Merge branch 'main' into 2561_update_adeg_template
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyad authored Nov 15, 2024
2 parents 2c48204 + ebdb2f1 commit 5451c94
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: admiral
Title: ADaM in R Asset Library
Version: 1.1.1.9022
Version: 1.1.1.9024
Authors@R: c(
person("Ben", "Straub", , "[email protected]", role = c("aut", "cre")),
person("Stefan", "Bundfuss", role = "aut",
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,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)

</details>
Expand Down
6 changes: 2 additions & 4 deletions R/derive_advs_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#'
Expand Down Expand Up @@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion man/compute_bsa.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/test-derive_advs_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down Expand Up @@ -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 ----
Expand Down
8 changes: 8 additions & 0 deletions vignettes/bds_finding.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 5451c94

Please sign in to comment.