Giter Club home page Giter Club logo

Comments (2)

kaz462 avatar kaz462 commented on June 25, 2024 1

A value level validation use case, where admiral is used to validate a small chunk of the data:

  • validate a parameter by using admiral::derive_param_computed.
  • Derivation text: derive new parameter/records for 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"))

from blog.

bms63 avatar bms63 commented on June 25, 2024

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

from blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.