SafetyMA

Pharmacovigilance Meta-Analysis — Peto OR, MH, DL, RR, Knapp-Hartung, Profile Likelihood, Arcsine Diff, Beta-Binomial, Bayesian BB, RD/NNH, ARI, Exact Tests, Peters'/Harbord's Bias, Doi Plot, LFK, Galbraith, Trim-and-Fill, GRADE, LOO, Influence Diagnostics, Clopper-Pearson, Prediction Intervals

Data Input
Results
Forest Plot
L'Abbe Plot
Cumulative Safety
Funnel Plot
Doi Plot
Sensitivity
LOO
Advanced
Guide

Load Example

Study Data (2×2 tables)

Enter one study per line: Study name, events_treatment, n_treatment, events_control, n_control. Tab/comma separated.

Summary

Method Comparison

MethodOR95% CIP-valueStudiesNote

Heterogeneity

MethodQdfPτ²

Zero-Cell Summary

Study Details

StudyE_trtN_trtE_ctrlN_ctrlOR95% CIWeight (MH%)Rate_trt (CP 95%)Rate_ctrl (CP 95%)Flag

Forest Plot

L'Abbe Plot

Treatment event rate vs control event rate. Points above diagonal = treatment has higher risk.

Cumulative Safety Monitoring (Peto OR)

Studies added chronologically. O'Brien-Fleming monitoring boundaries shown.

Study AddedCumulative OR95% CIZOBF BoundarySignal?

Funnel Plot (log OR vs SE)

Galbraith (Radial) Plot

X-axis: 1/SE (precision). Y-axis: logOR/SE (Z-score). Slope through origin = pooled logOR. Studies outside the 95% band (dashed) are heterogeneity drivers.

Doi Plot & LFK Index (Furuya-Kanamori et al. 2018)

Alternative to funnel plot for publication bias. X-axis: Z-score (effect/SE). Y-axis: |Z|. LFK index quantifies asymmetry: |LFK| < 1 = no asymmetry, 1-2 = minor, > 2 = major. More powerful than Egger's for small samples.

Sensitivity: Continuity Correction Robustness

MH OR computed with varying continuity corrections (0, 0.1, 0.25, 0.5, 1.0). Demonstrates robustness or fragility of the pooled estimate to the zero-cell correction choice. Large variation = fragile result.
CorrectionMH OR95% CIP-valueStudies included

Leave-One-Out Sensitivity Analysis (Peto OR)

Each row shows the pooled Peto OR with that study removed. Identifies the most influential study and flags if any single removal reverses significance.
Study RemovedPeto OR95% CIP-valuekSignificance Change?

Arcsine Difference (Rucker et al. 2009)

Variance-stabilizing transformation for rare events. Variance = 1/(4n_t) + 1/(4n_c) -- does NOT depend on event rate. No zero-cell correction needed.
StudyAS DiffVarianceWeight (%)95% CI

Risk Difference & Number Needed to Harm

Absolute risk measure. NNH = 1/pooled_RD provides direct clinical interpretation of harm magnitude.
StudyRDVarianceWeight (%)95% CI

Beta-Binomial Model (Kuss 2015)

One-stage random effects for rare events. Estimates mu_t, mu_c, phi via maximum likelihood. More appropriate than DL for very sparse data.

Exact Conditional Tests

Exact p-value for MH OR using hypergeometric distribution. Mid-p correction for less conservative inference. Important when normal approximation fails with sparse data.

Peters' Test for Publication Bias

Regression of 1/n_total on effect, weighted by inverse total events. More appropriate than Egger's for binary OR outcomes (Peters et al. 2006).

Prediction Interval

The prediction interval estimates the range of true effects in a new study. Uses t_{k-2} distribution, NOT t_{k-1}. Undefined for k < 3.

Harbord's Test (Harbord et al. 2006)

Modified Egger's test for log OR using score-based formulation. Less biased than standard Egger's for binary outcomes. Regresses (Z - E[Z]) / sqrt(Var) on 1/sqrt(Var).

Risk Ratio (RR) Pooling — Log-Binomial

RR is more interpretable than OR, especially when events are common (OR overestimates RR). Pooled on log scale with DL random effects.
StudyRRlog(RR)VarianceWeight (%)95% CI

Absolute Risk Increase with Baseline Risk Adjustment

ARI = (pooled RR - 1) x baseline risk. More clinically meaningful than trial-derived RD. NNH = 1/ARI. Adjust assumed baseline risk to your population.

Trim-and-Fill (Duval & Tweedie 2000)

Sensitivity analysis only — never the primary result. Estimates missing studies and recalculates pooled OR. Imputed studies shown as filled circles on funnel plot.

GRADE-style Certainty Assessment for Safety Outcomes

Automated GRADE domains: Risk of Bias, Inconsistency (I²), Indirectness, Imprecision (CI crosses OR=1.25), Publication Bias (Peters' P < 0.1). Overall: High / Moderate / Low / Very Low.

Knapp-Hartung Adjustment (Knapp & Hartung 2003)

Replaces z-based CI with t_{k-1} distribution. SE inflated by sqrt(max(1, Q/(k-1))) — the HKSJ floor prevents paradoxical narrowing when Q < k-1. Critical for k < 20.

Profile Likelihood CI (Hardy & Thompson 1996)

Instead of Wald CI, finds beta where -2*log(L(beta)) = -2*log(L(beta_hat)) + chi-sq(1, alpha). Grid search at 200 points. Typically asymmetric and more accurate than Wald for small k.

Influence Diagnostics (Viechtbauer 2010)

Cook's distance, DFBETAS (standardized influence on pooled logOR), hat values (leverage), and studentized residuals. Flags: Cook's > 4/k, |DFBETAS| > 1, hat > 3*mean(hat), |rstudent| > 2.
StudyCook's DDFBETASHatRstudentFlags

Bayesian Conjugate Beta-Binomial

Prior: Beta(1,1) (uniform) per arm. Posterior: Beta(1+events, 1+non-events). Posterior OR via 10,000 Monte Carlo draws (seeded PRNG). Handles zero cells naturally — no correction needed. Reports posterior median + 95% HPD CrI.

Pharmacovigilance MA — Method Guide

Why safety MA is different: Adverse events are often rare (<5%), many studies report zero events, and even small risk increases matter for population-level safety. Standard DerSimonian-Laird can fail with sparse data.
Peto ORGold standard for rare events (<1%). Unbiased, no zero-cell correction needed. Breaks down when treatment groups are very unbalanced or events are common.
Mantel-HaenszelGood for rare events. Needs correction for zero cells. More robust than IV methods with sparse data.
DL Random EffectsStandard random-effects. Can be biased with rare events. Use with caution for safety data.
Zero-cell handlingAdd 0.5 is traditional but biases OR→1. Reciprocal and empirical (Sweeting) corrections are less biased. Double-zero studies are uninformative for OR.
Sequential monitoringO'Brien-Fleming boundaries detect safety signals early without inflating type I error. Critical for post-marketing surveillance.
Arcsine DifferenceRucker et al. 2009. Variance-stabilizing transform: arcsin(sqrt(e/n)). Variance = 1/(4n) -- independent of event rate. No zero-cell correction needed. Superior to Peto for very rare events.
Risk Difference / NNHAbsolute risk measure. RD = e_t/n_t - e_c/n_c. NNH = 1/RD gives the number of patients treated per additional harm event. Essential for clinical interpretation.
Beta-Binomial modelKuss 2015. One-stage random effects using beta-binomial likelihood. Avoids continuity corrections entirely. More appropriate than DL for very sparse 2x2 tables.
Exact Conditional TestMehta-Patel / Conditional MH. Uses hypergeometric distribution for exact p-value. Mid-p correction available for less conservative inference.
Peters' TestPeters et al. 2006. Publication bias test for binary outcomes. Regresses 1/n on effect, weighted by inverse total events. Less affected by OR-SE correlation than Egger's.
Prediction IntervalRange of true effects expected in a new study. Uses t_{k-2} (NOT t_{k-1}). Wider than CI -- reflects between-study heterogeneity.
Risk Ratio (RR)log(RR) = log(et/nt) - log(ec/nc). Pooled on log scale with DL. OR ≠ RR when events common; RR more interpretable for clinicians.
Doi Plot / LFK IndexFuruya-Kanamori 2018. Alternative to funnel plot. Z-score vs |Z|. LFK index: |LFK| < 1 = symmetric, 1-2 = minor asymmetry, > 2 = major. More powerful than Egger's for small k.
Harbord's TestHarbord et al. 2006. Score-based test for small-study effects specific to log OR. Less biased than Egger's for binary outcomes.
Trim-and-FillDuval & Tweedie 2000. Estimates missing studies, imputes them, recalculates pooled OR. Sensitivity analysis only — never the primary result.
ARI (Baseline-adjusted)Absolute Risk Increase = (pooled RR - 1) × baseline risk. NNH = 1/ARI. More clinically meaningful than trial-derived RD.
GRADE CertaintyAutomated assessment: Inconsistency (I² > 50%), Imprecision (CI crosses OR=1.25), Publication bias (Peters' P < 0.1). Traffic-light display.
CC SensitivityContinuity correction robustness: MH OR at cc = 0, 0.1, 0.25, 0.5, 1.0. Large variation = fragile estimate.
Knapp-HartungKnapp & Hartung 2003. Replaces z-based CI with t_{k-1}. SE inflated by sqrt(max(1, Q/(k-1))). The floor prevents paradoxical CI narrowing. Critical for k < 20 where z is liberal.
Profile Likelihood CIHardy & Thompson 1996. Grid search on profile log-likelihood at 200 points. Typically asymmetric and more accurate than Wald CI for small k. Finds beta where -2*logL = -2*logL_max + chi-sq.
Leave-One-OutRecomputes Peto OR omitting each study in turn. Identifies most influential study. Flags significance reversals — critical for fragility assessment.
Influence DiagnosticsViechtbauer 2010. Cook's distance, DFBETAS, hat values, studentized residuals. Flags studies that disproportionately affect the pooled estimate.
Bayesian Conjugate BBBeta(1,1) uniform prior per arm. Posterior OR via 10,000 MC draws (seeded PRNG). Reports median + HPD CrI. Handles zero cells naturally — no correction needed.
Clopper-Pearson CIExact binomial CI for individual study rates. Lower: qbeta(alpha/2, x, n-x+1). More conservative than Wald but correct for small counts.
Galbraith PlotRadial plot: 1/SE vs logOR/SE. Slope = pooled logOR. Outliers outside 95% band are heterogeneity drivers. Complements the funnel plot.