Package {PVomega}


Title: Omega Shrinkage Measure for Drug-Drug Interaction Signal Detection
Version: 1.0.0
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.
License: Apache License (≥ 2)
URL: https://uppsala-monitoring-centre.github.io/PVomega/, https://github.com/Uppsala-Monitoring-Centre/PVomega
Depends: R (≥ 4.1)
Imports: data.table, stats, utils
Suggests: devtools, knitr, styler, testthat (≥ 3.0.0)
VignetteBuilder: knitr
Config/Needs/website: rmarkdown
Config/roxygen2/version: 8.1.1
Config/testthat/edition: 3
Encoding: UTF-8
NeedsCompilation: no
Packaged: 2026-11-02 09:54:13 UTC; MicheleF
Author: Valentina Giunchi [aut, cre], Michele Fusaroli [aut], Pablo Maldonado Jimenez [aut], Douglas Potter [aut], Niklas Noren [aut]
Maintainer: Valentina Giunchi <valentina.giunchi@who-umc.org>
Repository: CRAN
Date/Publication: 2026-11-20 12:20:02 UTC

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)

g_{11} = 1 - \frac{1}{\max(o_{00}, o_{10}) + \max(o_{00}, o_{01}) - o_{00} + 1}

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

\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 = n_{111} + \alpha_1, rate = E_{111} + \alpha_2) distribution (eq. 20). The paper uses \alpha_1 = \alpha_2 = 0.5, a prior with mean 1 that shrinks Omega towards 0. When \alpha_1 \neq \alpha_2, the prior mean is \alpha_1 / \alpha_2 and Omega is shrunk towards \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 (n_{11\cdot}, n_{10\cdot}, n_{01\cdot}, n_{00\cdot} > 0), so that the reporting rates are defined, and when f_{00}, f_{10} and f_{01} are below 1, so that the odds in eq. 16 are finite. f_{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:

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)