Closed kaz462 closed 1 year ago
A value level validation use case, where admiral
is used to validate a small chunk of the data:
admiral::derive_param_computed
.ADEX.PARAMCD = ADPCYMG
(Actual Dose per Cycle) based on existing parameters - Actual Dose per Cycle (ADPCYMG) = Total Amount of Dose (TOTDOSE) / Number of Cycles (NUMCYC);admiral::derive_param_computed
can add a parameter computed from the analysis value of other parameters.
In this example, ADEX.AVAL (where ADEX.PARAPMCD = ADPCYMG)
= ADEX.AVAL (where ADEX.PARAPMCD = TOTDOSE) / ADEX.AVAL (where ADEX.PARAPMCD = NUMCYC)
# read in data
path_ads <- "xxxx"
adex <- haven::read_sas(paste0(path_ads, "adex.sas7bdat")) %>%
select(USUBJID, PARAM, PARAMCD, AVAL)
# subset input data to PARAMCD = "TOTDOSE", "NUMCYC"
adex_TOTDOSE_NUMCYC <- adex %>% filter(PARAMCD %in% c("TOTDOSE", "NUMCYC"))
# admiral::derive_param_computed()
val <-
derive_param_computed(
adex_TOTDOSE_NUMCYC,
by_vars = exprs(USUBJID),
parameters = c("TOTDOSE", "NUMCYC"),
analysis_value = AVAL.TOTDOSE / AVAL.NUMCYC,
set_values_to = exprs(
PARAMCD = "ADPCYMG",
PARAM = "Actual Dose per Cycle (mg)"
)
)
# compare with primary
diffdf::diffdf(adex %>% filter(PARAMCD == "ADPCYMG"),
val %>% filter(PARAMCD == "ADPCYMG"),
keys = c("USUBJID", "PARAMCD"))
Love this already - we got a our first post! I was thinking that maybe we should to 4 posts to fill out the site and keep it form looking sad - then switch to 1 every two weeks. @pharmaverse/commswg
derive
andcompute
use_ad_template
(Ben)