Skip to contents

Process data for eDISH plot

Usage

process_edish_data(
  datain,
  xvar = "both",
  alt_paramcd = "ALT",
  ast_paramcd = "AST",
  bili_paramcd = "BILI",
  legendbign = "Y"
)

Arguments

datain

Input dataset.

xvar

To determine how ast and alt should be derived and which should be the x variable for the plot. Possible values are: "both", "ast", "alt". If it is "ast" or "alt", the AVAL for the corresponding "PARAMCD" is used as X variable. Alternatively, if "both" then the max value between ast and alt for each record is used as X variable.

alt_paramcd

PARAMCD value for ALANINE AMINOTRANSFERASE in datain.

ast_paramcd

PARAMCD value for ASPARTATE AMINOTRANSFERASE in datain.

bili_paramcd

PARAMCD value for BILIRUBIN in datain.

legendbign

(string) Display BIGN in Legend (Y/N).

Value

A data.frame required for edish_plot.

Examples

data("adlb")
data("adsl")

merged_data <- adsl_merge(
  adsl = adsl,
  dataset_add = adlb
) |>
  mentry(
    subset = "SAFFL == 'Y'",
    trtvar = "TRT01A",
    trtsort = "TRT01AN"
  )

merged_data |>
  process_edish_data(
    xvar = "both",
    alt_paramcd = "ALT",
    ast_paramcd = "AST",
    bili_paramcd = "BILI"
  )
#> # A tibble: 254 × 9
#> # Groups:   USUBJID, TRTVAR [254]
#>    USUBJID     TRTVAR                 alt   ast  bili  XVAR text     YVAR TRTTXT
#>    <chr>       <ord>                <dbl> <dbl> <dbl> <dbl> <chr>   <dbl> <fct> 
#>  1 01-701-1015 Placebo              1.21  1.18  0.489 1.21  "Subji… 0.489 Place…
#>  2 01-701-1023 Placebo              0.884 0.833 0.57  0.884 "Subji… 0.57  Place…
#>  3 01-701-1028 Xanomeline High Dose 0.943 0.778 0.896 0.943 "Subji… 0.896 Xanom…
#>  4 01-701-1033 Xanomeline Low Dose  1     0.722 0.733 1     "Subji… 0.733 Xanom…
#>  5 01-701-1034 Xanomeline High Dose 0.75  0.765 0.489 0.765 "Subji… 0.489 Xanom…
#>  6 01-701-1047 Placebo              0.688 0.735 0.407 0.735 "Subji… 0.407 Place…
#>  7 01-701-1097 Xanomeline Low Dose  0.558 0.583 0.489 0.583 "Subji… 0.489 Xanom…
#>  8 01-701-1111 Xanomeline Low Dose  0.719 0.824 0.407 0.824 "Subji… 0.407 Xanom…
#>  9 01-701-1115 Xanomeline Low Dose  0.514 0.722 0.407 0.722 "Subji… 0.407 Xanom…
#> 10 01-701-1118 Placebo              0.372 0.5   0.57  0.5   "Subji… 0.57  Place…
#> # ℹ 244 more rows