Package 'PVomega'

Title: Omega Shrinkage Measure for Drug-Drug Interaction Signal Detection
Description: Implements the Omega interaction disproportionality measure of Noren et al. (2008) <doi:10.1002/sim.3247> for drug-drug interaction signal detection in databases of adverse event reports.
Authors: Valentina Giunchi [aut, cre], Michele Fusaroli [aut], Pablo Maldonado Jimenez [aut], Douglas Potter [aut], Niklas Noren [aut]
Maintainer: Valentina Giunchi <[email protected]>
License: Apache License (>= 2)
Version: 1.0.0
Built: 2026-11-20 21:28:13 UTC
Source: https://github.com/cran/PVomega

Help Index


Compute Omega from report counts

Description

Computes the Omega shrinkage observed-to-expected ratio for a drug-drug-event triplet (Noren et al. 2008), together with its credibility interval and all intermediate quantities. The function is vectorised: every count argument can be a vector, and one row is returned per element.

Usage

omega_from_counts(
  n111,
  n11.,
  n1.1,
  n.11,
  n1..,
  n.1.,
  n..1,
  n...,
  alpha1 = 0.5,
  alpha2 = 0.5,
  cred_level = 0.95
)

Arguments

n111

Reports listing D1, D2 and the event.

n11.

Reports listing D1 and D2.

n1.1

Reports listing D1 and the event.

n.11

Reports listing D2 and the event.

n1..

Reports listing D1.

n.1.

Reports listing D2.

n..1

Reports listing the event.

n...

Total number of reports.

alpha1

Shrinkage added to the observed count: the shape of the Gamma prior (default 0.5, as in the paper). Must be > 0.

alpha2

Shrinkage added to the expected count: the rate of the Gamma prior (default 0.5, as in the paper). Must be > 0.

cred_level

Level of the two-sided credibility interval (default 0.95, giving Omega025 and Omega975).

Details

The expected relative reporting rate under the additive-risk baseline model is (eq. 16 of Noren et al. 2008)

g11=1−1max⁡(o00,o10)+max⁡(o00,o01)−o00+1g_{11} = 1 - \frac{1}{\max(o_{00}, o_{10}) + \max(o_{00}, o_{01}) - o_{00} + 1}

where oij=fij/(1−fij)o_{ij} = f_{ij} / (1 - f_{ij}) and fijf_{ij} is the relative reporting rate of the event in the stratum exposed to D1 (i) and D2 (j). The expected count is E111=g11n11⋅E_{111} = g_{11} n_{11\cdot} and

Ω=log⁡2n111+α1E111+α2\Omega = \log_2 \frac{n_{111} + \alpha_1}{E_{111} + \alpha_2}

Following the paper, the interval limits are log2 quantiles of the posterior Gamma(shape = n111+α1n_{111} + \alpha_1, rate = E111+α2E_{111} + \alpha_2) distribution (eq. 20). The paper uses α1=α2=0.5\alpha_1 = \alpha_2 = 0.5, a prior with mean 1 that shrinks Omega towards 0. When α1≠α2\alpha_1 \neq \alpha_2, the prior mean is α1/α2\alpha_1 / \alpha_2 and Omega is shrunk towards log⁡2(α1/α2)\log_2(\alpha_1 / \alpha_2) instead of 0, which changes the meaning of the omega_lower > 0 signal criterion.

Omega can only be computed when all four D1/D2 strata contain reports (n11⋅n_{11\cdot}, n10⋅n_{10\cdot}, n01⋅n_{01\cdot}, n00⋅n_{00\cdot} > 0), so that the reporting rates are defined, and when f00f_{00}, f10f_{10} and f01f_{01} are below 1, so that the odds in eq. 16 are finite. f11=1f_{11} = 1 is valid. Rows that violate these conditions return NA for g11, E111 and the Omega columns, and a single warning lists the affected rows and the reason. Counts that cannot come from one set of reports (e.g. a negative cell) raise an error.

Value

A data.table with one row per element of the inputs and columns:

  • the input marginal counts n1.1, n.11, n1.., n.1., n..1, n...;

  • the eight cells of the 2x2x2 contingency table, named by presence (1) or absence (0) of D1, D2 and the event: n111, n110, n101, n100, n011, n010, n001, n000 (they sum to n...);

  • the four exposure strata totals n11., n10., n01., n00.;

  • f00, f10, f01, f11, g11, the expected count E111, omega, omega_lower, omega_upper. Each f is NA when its stratum is empty; g11, E111 and the Omega columns are NA for rows where Omega cannot be computed (see Details).

References

Noren GN, Sundberg R, Bate A, Edwards IR. A statistical methodology for drug-drug interaction surveillance. Stat Med. 2008;27(16):3057-70. doi: 10.1002/sim.3247

Examples

# Itraconazole + oral contraceptives, delayed bleeding
# (Table II of Noren et al. 2008)
omega_from_counts(
  n111 = 10, n11. = 23, n1.1 = 10, n.11 = 19,
  n1.. = 39, n.1. = 1489, n..1 = 39, n... = 5503
)

Compute Omega from a table of report counts

Description

Convenience wrapper around omega_from_counts() for tabular input. The input must contain one column for each of the eight report counts required by omega_from_counts(). Computation is vectorised, so one output row is returned for each input row.

Usage

omega_from_table(x, alpha1 = 0.5, alpha2 = 0.5, cred_level = 0.95)

Arguments

x

A data frame, data.table, or other object coercible to a data.frame, containing the required count columns.

alpha1

Shrinkage tuning parameter for the observed count. Passed to omega_from_counts().

alpha2

Shrinkage tuning parameter for the expected count. Passed to omega_from_counts().

cred_level

Level of the two-sided credibility interval. Passed to omega_from_counts().

Value

A data.table containing the input columns followed by the results from omega_from_counts().

See Also

omega_from_counts()

Examples

counts <- data.frame(
  drug1 = "itraconazole",
  drug2 = "oral contraceptives",
  event = "delayed bleeding",
  n111 = 10,
  `n11.` = 23,
  `n1.1` = 10,
  `n.11` = 19,
  `n1..` = 39,
  `n.1.` = 1489,
  `n..1` = 39,
  `n...` = 5503,
  check.names = FALSE
)

omega_from_table(counts)