| 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 |
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.
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 )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 )
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). |
The expected relative reporting rate under the additive-risk baseline model is (eq. 16 of Noren et al. 2008)
where and is the relative
reporting rate of the event in the stratum exposed to D1 (i) and D2 (j).
The expected count is and
Following the paper, the interval limits are log2 quantiles of the posterior
Gamma(shape = , rate = )
distribution (eq. 20).
The paper uses , a prior with mean 1 that
shrinks Omega towards 0. When , the prior mean
is and Omega is shrunk towards
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
(, , ,
> 0), so that the reporting rates are defined, and when
, and are below 1, so that the odds
in eq. 16 are finite. 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.
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).
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
# 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 )# 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 )
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.
omega_from_table(x, alpha1 = 0.5, alpha2 = 0.5, cred_level = 0.95)omega_from_table(x, alpha1 = 0.5, alpha2 = 0.5, cred_level = 0.95)
x |
A data frame, |
alpha1 |
Shrinkage tuning parameter for the observed count. Passed to |
alpha2 |
Shrinkage tuning parameter for the expected count. Passed to |
cred_level |
Level of the two-sided credibility interval. Passed to
|
A data.table containing the input columns followed by
the results from omega_from_counts().
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)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)