Introduction
This is a neutral description of the r-package bacon. Like-zcurve, bacon is a mixture model that is fitted to a set of null hypothesis tests when all test statistics are converted into z-values. The model is used mostly with genomics datasets that have no publication bias. For this reason, the model is not very useful for meta-analyses of z-values when publication bias is present. Another blog post examines the performance of z-curve and bacon for datasets without selection bias.
Purpose and Overview
The bacon package, introduced by van Iterson et al. (2017), is an R implementation designed to correct systematic bias and variance inflation in test statistics — especially z-scores — from high-throughput studies such as epigenome-wide association studies (EWAS) and transcriptome-wide association studies (TWAS). These types of studies involve testing hundreds of thousands of predictors (e.g., CpG sites, transcripts) for associations with phenotypes, making them particularly vulnerable to small, systematic distortions that can substantially inflate the false positive rate.
Core Functionality
bacon fits a three-component Gaussian mixture model to the full distribution of z-values:
- A central null component, estimated to capture the distribution of test statistics under the null hypothesis,
- Two signal components (positive and negative tails),
- From the central component, it estimates:
- Bias (mean shift from zero),
- Inflation (standard deviation > 1).
These parameters are then used to compute corrected z-values that theoretically reflect what the z-distribution would look like under an ideal, unbiased, and uninflated null.
Application Workflow
Typical use case:
- Collect uncorrected z-scores from EWAS/TWAS/GWAS-style regression results.
- Fit the
baconmodel:bc <- bacon(z = zvals) - Extract corrected z-values:
z.corrected <- es(bc)/se(bc) - Derive corrected p-values and apply FDR procedures:
p.corrected <- 2 * pnorm(-abs(z.corrected)) qvals <- qvalue::qvalue(p.corrected)$qvalues
Evaluation of Strengths
| Feature | Evaluation |
|---|---|
| Bias Correction | Effective at detecting and removing small mean shifts (e.g., 0.05–0.2) in null-centered z-values. Especially useful in meta-analytic and multi-batch settings where residual confounding or batch effects introduce systematic bias. |
| Inflation Adjustment | Accurately detects inflation (σ > 1), which commonly arises from unmodeled correlation or heterogeneity. Can bring inflated distributions (e.g., σ = 1.3) back to approximately N(0,1). |
| Computational Simplicity | Fast to fit, robust under many scenarios, easy to implement in high-dimensional pipelines. |
| Visual Diagnostics | Includes plotting functions that clearly show bias and inflation pre- and post-correction. |
Limitations and Theoretical Concerns
🔸 No Modeling of Selection Bias
bacon assumes that all test statistics are available and have not been filtered (e.g., by p < .05).
This makes it inappropriate for typical psychology or biomedical meta-analyses where publication bias or selective reporting is common.
🔸 Cannot Distinguish Between True Effect Heterogeneity and Noise
- The model does not distinguish whether inflation in the null component arises from real, small effects clustered around zero or artifactual noise.
- This risks over-correcting genuine effects, especially in polygenic traits or low-effect-size domains.
🔸 No Direct FDR Estimation
bacondoes not estimate false discovery rates (FDR) or false positive risk.- It must be paired with other methods (e.g., Storey’s q-value, Benjamini-Hochberg) after correction.
- It offers no framework for estimating expected discovery rate (EDR), expected replication rate (ERR), or maximum false discovery risk (FDRₘₐₓ).
🔸 Minimal Effect on Strong Findings
- For large z-values (e.g., z > 5), corrections are negligible — corrected z-values are still extreme.
- Thus,
bacondoes not meaningfully change the interpretation of strong, replicable effects.
Comparative Perspective
| Model | Bias/Inflation Correction | Selection Bias | Estimates FDR | Models True Heterogeneity |
|---|---|---|---|---|
| bacon | ✅ Yes | ❌ No | ❌ No | ❌ No |
| z-curve | ❌ No | ✅ Yes | ✅ Yes (EDR, ERR, FDRₘₐₓ) | ✅ Yes |
| locfdr | ⚠️ Some | ❌ No | ✅ Local FDR | ⚠️ Some |
| ASH | ❌ No (assumes bias-free data) | ❌ No | ✅ Yes | ✅ Yes |
Conclusion
The bacon package is a well-designed tool for correcting bias and inflation in large-scale omics studies where all z-values are reported and residual technical artifacts are common. Its precision and simplicity make it ideal for applications like EWAS meta-analysis, but its scope is limited.
- It is not designed to evaluate selection bias,
- It does not estimate FDR or replicability metrics,
- And it cannot distinguish noise from small true effects near zero.
In domains where effect sizes are large and replicability is the primary concern, or where p-hacking and selective reporting are possible, models like z-curve offer a more complete framework.
📚 Recommended Use Cases
Use bacon when… | Avoid bacon when… |
|---|---|
| You have full z-values from EWAS/TWAS | You’re working with only significant p-values |
| You’re correcting for technical confounds | You want to estimate false positive risk |
| You’re applying FDR methods post-hoc | You want to interpret the true effect size mix |