Process data for Event Analysis
Usage
process_event_analysis(
datain,
a_subset = NA_character_,
summary_by = "Events",
hterm,
ht_val,
ht_scope,
lterm,
lt_val,
lt_scope
)
Arguments
- datain
Input dataset can be any
ADaM
data.- a_subset
Analysis subset condition.
- summary_by
Set to
'Events'
or'Patients'
.- hterm
MedDRA
queries or high level variables; valid values :"FMQ_NAM"
,"AEBODSYS"
- ht_val
Queries/term name captured in the
hl_var
variable, e.g."Erythema"
- ht_scope
Scope of the
MedDRA
queries; Valid values :"Narrow"
or"Broad"
- lterm
MedDRA
variable; Valid value :"AEDECOD"
- lt_val
MedDRA
value, e.g.,"Erythema"
- lt_scope
Scope of the
MedDRA
queries; Valid values :"Narrow"
or"Broad"
Examples
data(adae)
data(FMQ_Consolidated_List)
## process `ADAE` with `ae_pre_processor()`
prep_ae <- adae |>
ae_pre_processor(
ae_filter = "ANY",
obs_residual = 0,
fmq_data = FMQ_Consolidated_List
)
prep_entry <- prep_ae[["data"]] |>
mentry(
trtvar = "TRTA",
trtsort = "TRTAN",
trttotalyn = "N",
byvar = "FMQ_NAM"
)
## prepare data for plot
prep_event_analysis <- prep_entry |>
process_event_analysis(
a_subset = glue::glue("AOCCPFL == 'Y' & {prep_ae$a_subset}"),
summary_by = "Events",
hterm = "FMQ_NAM",
ht_val = "ABDOMINAL PAIN",
ht_scope = "Narrow",
lterm = "AEDECOD",
lt_val = "ABDOMINAL DISCOMFORT",
lt_scope = "Narrow"
)
#> mcatstat success
prep_event_analysis[["pt_df"]]
#> # A tibble: 3 × 16
#> BYVAR1 TRTVAR DPTVAR DPTVAL CVALUE DENOMN FREQ DPTVALN BYVAR1N PCT CPCT
#> <chr> <fct> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr>
#> 1 Abdomina… "Plac… AEDEC… ABDOM… 0 213 0 1 2 0 0.00
#> 2 Abdomina… "Xano… AEDEC… ABDOM… 0 313 0 1 2 0 0.00
#> 3 Abdomina… "Xano… AEDEC… ABDOM… 1 (0.… 318 1 1 2 0.314 0.31
#> # ℹ 5 more variables: XVAR <chr>, DPTVARN <dbl>, CN <chr>, PCT_N <dbl>,
#> # Percent <chr>
prep_event_analysis[["query_df"]]
#> # A tibble: 9 × 20
#> BYVAR1 TRTVAR DPTVAR DPTVAL CVALUE DENOMN FREQ DPTVALN BYVAR1N PCT CPCT
#> <chr> <fct> <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr>
#> 1 Abdomina… "Plac… AEDEC… ABDOM… 1 (0.… 213 1 2 1 0.469 0.47
#> 2 Abdomina… "Plac… AEDEC… ABDOM… 0 213 0 1 2 0 0.00
#> 3 Abdomina… "Plac… AEDEC… STOMA… 0 213 0 130 1 0 0.00
#> 4 Abdomina… "Xano… AEDEC… ABDOM… 3 (0.… 313 3 2 1 0.958 0.96
#> 5 Abdomina… "Xano… AEDEC… ABDOM… 0 313 0 1 2 0 0.00
#> 6 Abdomina… "Xano… AEDEC… STOMA… 0 313 0 130 1 0 0.00
#> 7 Abdomina… "Xano… AEDEC… ABDOM… 1 (0.… 318 1 2 1 0.314 0.31
#> 8 Abdomina… "Xano… AEDEC… STOMA… 1 (0.… 318 1 130 1 0.314 0.31
#> 9 Abdomina… "Xano… AEDEC… ABDOM… 1 (0.… 318 1 1 2 0.314 0.31
#> # ℹ 9 more variables: XVAR <chr>, DPTVARN <dbl>, CN <chr>, HTERM <chr>,
#> # HVAL <chr>, LVAL <chr>, Percent <chr>, PCT_N <dbl>, DECODh <dbl>