Calculate Risk Statistics for treatment pairs from pre-processed Adverse Events data
Source:R/risk_stat.R
risk_stat.Rd
Calculate Risk Statistics for treatment pairs from pre-processed Adverse Events data
Usage
risk_stat(
datain,
a_subset = NA_character_,
summary_by = "Patients",
eventvar,
ctrlgrp,
trtgrp,
statistics = "Risk Ratio",
alpha = 0.05,
cutoff_where = NA,
sort_opt = "Ascending",
sort_var = "Count",
g_sort_by_ht = "N",
riskdiff_pct = "N",
sigdec = 1,
pctsyn = "Y",
hoveryn = "Y"
)
Arguments
- datain
Input data from
mentry()
output to get counts for each category- a_subset
Analysis Subset condition specific to categorical analysis.
- summary_by
Measure to construct the summary by. Values:
'Patients' or 'Events'
.- eventvar
Event Variable to review by. Example:
'AEDECOD', 'AEBODSYS'
.- ctrlgrp
Treatment Control value.
- trtgrp
Treatment(s) to create pairs. Only 1 value for Volcano/table, can be multiple for
forest_plot()
.- statistics
Statistic to be calculated. Values:
'Risk Ratio' or 'Risk Difference'
.- alpha
Alpha value to determine confidence interval for risk calculation. Default:
0.05
- cutoff_where
Filter condition for incidence/pct. Consider only terms with eg: "FREQ > 5" or "PCT <3". Must contain FREQ or PCT (count or percent)
- sort_opt
How to sort terms, only for table/forest plot. Values:
'Ascending','Descending','Alphabetical'
.- sort_var
Metric to sort by. Values:
'Count','Percent','RiskValue'
.- g_sort_by_ht
For Forest Plot only - include sorting by high term/BYVAR1? Values: "Y"/"N". In the output, terms will be sorted by group first, then term. To be used along with
ht_dispyn
= Y inae_forest_plot()
- riskdiff_pct
To display risk and CI as % if
statistic
= risk difference (Y/N)- sigdec
Number of decimal places for % displayed in output
- pctsyn
Display Percentage Sign in table or not. Values:
"Y"/"N"
- hoveryn
Include hover information (for graphs) Y/N
Examples
## Pre-processed AE data
data("ae_pre_process")
ae_entry <- mentry(
datain = ae_pre_process$data,
subset = NA,
byvar = "AEBODSYS",
trtvar = "TRTA",
trtsort = "TRTAN",
subgrpvar = NA,
trttotalyn = "N",
add_grpmiss = "N",
sgtotalyn = "N",
pop_fil = "SAFFL"
)
risk_stat(
datain = ae_entry,
a_subset = ae_pre_process$a_subset,
summary_by = "Patients",
eventvar = "AEDECOD",
ctrlgrp = "Placebo",
trtgrp = "Xanomeline High Dose",
statistics = "Risk Ratio",
alpha = 0.05,
cutoff_where = "PCT > 2",
sort_opt = "Ascending",
sort_var = "Count"
)
#> mcatstat success
#> # A tibble: 80 × 30
#> BYVAR1 TRTVAR DPTVAR DPTVAL CVALUE DENOMN FREQ DPTVALN BYVAR1N PCT CPCT
#> <chr> <ord> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>
#> 1 CARDIAC… Place… AEDEC… ATRIA… 1 ( 1… 69 1 30 1 1.45 " 1.…
#> 2 GENERAL… Place… AEDEC… APPLI… 1 ( 1… 69 1 25 6 1.45 " 1.…
#> 3 GENERAL… Place… AEDEC… FATIG… 1 ( 1… 69 1 110 6 1.45 " 1.…
#> 4 INJURY,… Place… AEDEC… CONTU… 1 ( 1… 69 1 71 10 1.45 " 1.…
#> 5 INJURY,… Place… AEDEC… HIP F… 1 ( 1… 69 1 129 10 1.45 " 1.…
#> 6 MUSCULO… Place… AEDEC… BACK … 1 ( 1… 69 1 35 13 1.45 " 1.…
#> 7 CARDIAC… Xanom… AEDEC… ATRIA… 3 ( 3… 79 3 30 1 3.80 " 3.…
#> 8 GENERAL… Xanom… AEDEC… APPLI… 6 ( 7… 79 6 25 6 7.59 " 7.…
#> 9 GENERAL… Xanom… AEDEC… FATIG… 5 ( 6… 79 5 110 6 6.33 " 6.…
#> 10 INJURY,… Xanom… AEDEC… CONTU… 2 ( 2… 79 2 71 10 2.53 " 2.…
#> # ℹ 70 more rows
#> # ℹ 19 more variables: XVAR <chr>, DPTVARN <dbl>, CN <chr>, CUTFL <chr>,
#> # CTRL_N <int>, CTRL_PCT <dbl>, PVALUE <dbl>, RISK <dbl>, RISKCIL <dbl>,
#> # RISKCIU <dbl>, ADJPVALUE <dbl>, RISK_CI <chr>, TRTPAIR <chr>, CTRL <chr>,
#> # ACTIVE <chr>, TOTAL_N <dbl>, HOVER_PCT <chr>, HOVER_RISK <chr>,
#> # HOVER_TEXT <chr>