Tailor Disproportionality Threshold
Source:R/disproportionality_analysis.R
tailor_disproportionality_threshold.Rd
This function analyzes a data frame of disproportionality metrics and categorizes signals based on specified thresholds.
Usage
tailor_disproportionality_threshold(
disproportionality_df,
minimum_cases = 3,
log2_threshold = 0,
frequentist_threshold = 1,
multiple_comparison = TRUE
)
Arguments
- disproportionality_df
A data frame containing disproportionality metrics. Generated by disproportionality_analysis.
- minimum_cases
An integer specifying the minimum number of cases required to consider the signal. Defaults to 3.
- log2_threshold
A numeric value specifying the threshold for the Information Component (IC) signal. Defaults to 0.
- frequentist_threshold
A numeric value specifying the threshold for the Reporting Odds Ratio (ROR) signal. Defaults to 1.
- multiple_comparison
A logical value indicating whether to apply multiple comparison adjustments (e.g., Bonferroni correction). Defaults to TRUE.
Value
A data frame with two new columns: ROR_signal
and IC_signal
, categorizing the signals based on the provided thresholds.
Details
The function categorizes signals into four levels:
"not enough cases": when the number of cases is less than
minimum_cases
."no SDR": when the signal does not meet the specified threshold.
"weak SDR": when the signal disappear under multiple comparison adjustments.
"SDR": when the signal remain after multiple comparison.
Examples
disproportionality_df <- disproportionality_analysis(
drug_selected = "paracetamol",
reac_selected = "headache",
temp_drug = sample_Drug,
temp_reac = sample_Reac
)
disproportionality_df <- tailor_disproportionality_threshold(disproportionality_df,
minimum_cases = 5
)