Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sadchla-codes opened this issue Apr 10, 2023 · 0 comments
Assignees

Comments

@sadchla-codes
Copy link
Collaborator

          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"))

Originally posted by @kaz462 in #2 (comment)

kaz462 pushed a commit that referenced this issue Apr 24, 2023
kaz462 pushed a commit that referenced this issue May 3, 2023
kaz462 pushed a commit that referenced this issue May 3, 2023
bms63 added a commit that referenced this issue Jun 12, 2023
Merge remote-tracking branch 'origin/main' into 12_admiral_derive_param_computed

# Conflicts:
#	_freeze/posts/2023-01-09_CICD-spelling/index/execute-results/html.json
#	_freeze/posts/2023-01-09_welcome/index/execute-results/html.json
#	inst/WORDLIST.txt
#	inst/WORDLIST_EXAMPLE.txt
#	posts/2023-01-09_CICD-spelling/WORDLIST.txt
bms63 added a commit that referenced this issue Jun 12, 2023
bms63 added a commit that referenced this issue Jun 12, 2023
bms63 added a commit that referenced this issue Jun 12, 2023
bms63 added a commit that referenced this issue Jun 12, 2023
kaz462 pushed a commit that referenced this issue Jun 12, 2023
kaz462 pushed a commit that referenced this issue Jun 12, 2023
bms63 added a commit that referenced this issue Jun 16, 2023
Merge remote-tracking branch 'origin/12_admiral_derive_param_computed' into 9_scope_of_blog_site
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@bms63 bms63 closed this as completed in d2f5961 Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants