Closed bms63 closed 2 years ago
All patients right only have absolute values - lets just update some of those existing values to what we need rather than create new observations.
See admiral.test/inst/data_scripts/update_ds.R for some guidance
# A tibble: 11 × 6
USUBJID PARAMCD AVAL PARAM VISIT DTYPE
<chr> <chr> <dbl> <chr> <chr> <chr>
1 P01 WBC 33 Leukocyte Count (10^9/L) CYCLE 1 DAY 1 NA
2 P01 WBC 38 Leukocyte Count (10^9/L) CYCLE 2 DAY 1 NA
3 P01 LYMLE 0.9 Lymphocytes (fraction of 1) CYCLE 1 DAY 1 NA
4 P01 LYMLE 0.7 Lymphocytes (fraction of 1) CYCLE 2 DAY 1 NA
5 P01 ALB 36 Albumin (g/dL) CYCLE 2 DAY 1 NA
6 P02 WBC 33 Leukocyte Count (10^9/L) CYCLE 1 DAY 1 NA
7 P02 LYMPH 29 Lymphocytes Abs (10^9/L) CYCLE 1 DAY 1 NA
8 P02 LYMLE 0.87 Lymphocytes (fraction of 1) CYCLE 1 DAY 1 NA
9 P03 LYMLE 0.89 Lymphocytes (fraction of 1) CYCLE 1 DAY 1 NA
10 P01 LYMPH 29.7 Lymphocytes Abs (10^9/L) CYCLE 1 DAY 1 CALCULATION
11 P01 LYMPH 26.6 Lymphocytes Abs (10^9/L) CYCLE 2 DAY 1 CALCULATION
Hey @yangc71 and @millerg23 This is the output from the derive_param_wbc_abs
example. Is USUBJID P02 also supposed to have a Calculation done for them?
Also, I'm a little confused on my notes. Can you tell me again what we were updating here? In my notes, I just have update existing values for WBC, but that is it! Looking at the data and this example just makes me a litte more confused :( sorry! Please more guidance...tyty!
Find parameters holding absolute differential lab test results, and replace them with Percent differential lab test results. Would suggest just to do this with a few subjects, and possibly just a subset of visits within these subjects. The function to convert Percent to Absolute should then produce the Absolute values from the percent values (using the percent and the WBC value). Note: the function to convert percent to absolute, will only do so if the Absolute value does not exist at that time point. Updates rquired are:
Thanks @millerg23. I still like to try and make this update with your guidance!
To keep things simple for the newly created Percent Differential lab tests, just set the variables holding the original results to the SI (standard unit) results. ie once LBSTRESN/C created, then set LBORRES = LBSTRESC. Likewise LBORRESU with LBSTRESU, LBORNRLO/LBORNRHI with LBSTNRLO/LBSTNRHI. @bms63 if you let me know what lab tests you decide to choose, I can supply reasonable normal ranges to you.
LYM - Reference Ranges
lbstresu = "fraction of 1"; rrlo = 0.22; rrhi = 0.44;
We will use this in our ad_adlb script.
https://github.com/pharmaverse/admiral/blob/main/R/derive_param_wbc_abs.R