Learn R Programming

emcAdr (version 1.3)

run_firth_regression: Firth Penalized Logistic Regression for Drug Cocktails

Description

This function prepares a specific "cocktail" (a set of drugs) and performs a Firth's penalized logistic regression to estimate the interaction effect between the drug present in the combination detected as "at risk".

Usage

run_firth_regression(
  cocktail,
  upper_bound,
  patient_data,
  adr_column = "patientADR"
)

Value

An object of class logistf containing the regression results, including coefficients, p-values, and confidence intervals.

Arguments

cocktail

An integer vector representing the ATC indices of drugs in the combination.

upper_bound

A list or vector defining the hierarchy/bounds (upper_bound column of the ATC_tree).

patient_data

A data frame containing patient-level data, including the ADR outcome.

adr_column

A string specifying the column name in patient_data used as the dependent variable (Y). Defaults to "patientADR".

Details

Firth's method is preferred here as it handles "separation" issues common in sparse clinical data (where a drug combination might perfectly predict an ADR).

Examples

Run this code
if (FALSE) {
# Example using indices for drugs 888, 659
results <- run_firth_regression(
  cocktail = c(888, 659),
  upper_bound = ATC_Tree_UpperBound_2024$upperBound,
  patient_data = FAERS_myopathy
)
summary(results)
}

Run the code above in your browser using DataLab