A Common Interface for Visualizing and Reporting Sensitivity Analyses for Unmeasured Confounding
Overview
A common interface to established sensitivity analyses for unmeasured confounding in observational studies. Results of impact threshold and robustness of inference to replacement analysis (Frank, 2000, doi:10.1177/0049124100029002001; Frank et al., 2013, doi:10.3102/0162373713493129), partial R-squared omitted-variable bias analysis (Cinelli and Hazlett, 2020, doi:10.1111/rssb.12348), E-values (VanderWeele and Ding, 2017, doi:10.7326/M16-2607), and Rosenbaum bounds for matched pairs (Rosenbaum, 2002, doi:10.1007/978-1-4757-3692-2) are stored in one object that keeps each framework's own parameter. Robustness curves, summary tables, and plain-language reports are available for every framework; two-parameter surfaces, the exact correlation contour, and observed-covariate benchmarks are provided where the corresponding framework defines them. Results can be computed from fitted models or matched-pair differences, or converted from the 'sensemakr', 'konfound', and 'EValue' packages, and agree with those packages.
Scope
- confoundvis is now a common interface to established sensitivity analyses only. The illustration functions
fit_local_quadratic(),plot_local_taylor(),plot_taylor_panels(),plot_figure2_taylor_panels(),simulate_taylor_demo(),plot_reversal_cone(), andplot_cone_comparison()are removed. They did not analyse data and did not correspond to any established framework. - The introductory vignette built on stylized paths is removed; the workflow vignette covers every feature with real data.
- 'grid' is no longer imported and 'gridExtra' is no longer suggested.
New features
sens_path_pairs()computes a sensitivity path for matched-pair studies under Rosenbaum's sensitivity model. For each value of Gamma it stores the deviate equivalent to the upper bound on the one-sided P-value, sorobustness_points(),plot_robustness_curve(),sens_report(), andsens_table()apply unchanged. Two statistics are available: Wilcoxon's signed rank statistic (method = "wilcoxon", agreeing withDOS2::senWilcox()) and the exact bound for McNemar's statistic for binary outcomes (method = "binary", agreeing withsensitivity2x2xk::mh()). The sensitivity value is also found by root finding and stored inmeta$sens_value.
Show all changes in 0.3.0Hide the rest of the changes in 0.3.0
rir_lm()computes the robustness of inference to replacement (RIR; Frank et al., 2013) from a fitted linear model: the threshold for significance, the percent of the estimate that would have to be due to bias, the number of cases that would have to be replaced with null-effect cases, and the corresponding path (estimate after replacing a proportion lambda of the cases). Results agree withkonfound::konfound(index = "RIR")and reproduce the worked example of Frank et al.'s (2025) practical guide. Athresholdargument allows a substantive effect threshold in place of statistical significance.from_konfound()gainsindex = "RIR"to import konfound's RIR output as a path.- ITCV benchmarks following Frank et al.'s (2025) practical guide:
itcv_lm()returnsbenchmark_corr_product(R_XZ * R_YZ, the impact of all covariates together) anditcv_ratio_to_benchmark(eq. 12), andcovariate_impacts()adds each term's zero-order correlations, their productimpact_zero, anditcv_ratio, the unconditional ITCV divided by that impact (eq. 10). sens_surface()returns the two-parameter sensitivity surface of which a path is one slice, andplot_sensitivity_surface()draws it with shaded zones, the null and significance boundaries, and optional benchmarks (sensemakr formal bounds are added automatically). Surfaces are available for partial R2 (Cinelli and Hazlett, 2020), ITCV (exact boundaries), E-values (joint bounding factor of Ding and VanderWeele, 2016), and Rosenbaum bounds (amplification of Rosenbaum and Silber, 2009, agreeing withsensitivitymv::amplify()). Boundaries are computed in closed form or by one-dimensional root finding.sens_table()collects severalconfoundsensobjects into one table: framework, meaning of the sensitivity parameter, the framework's own summary statistic, null and significance crossings, and the rule used. Rows keep their own scales; the printed table says so.plot_sensitivity_contour()gains anitcvargument. Given the output ofitcv_lm(), it draws, in closed form, the exact boundaries at which the magnitude of the confounder-adjusted partial correlation equals the critical value: in the original direction (solid) and in the reversed direction (dotted). It shades the region where the estimate is no longer significant, the region where it becomes significant with the opposite sign, and correlation pairs that cannot occur (non-positive-definite correlation matrix). The product curve is kept as a dashed reference.thresholdmay now be omitted whenitcvis supplied, and a newlimitsargument sets the axis range.- Benchmark labels in
plot_sensitivity_contour()repel one another when **ggrepel** is installed (suggested), instead of overlapping.
Bug fixes
itcv_lm(): for weighted fits, the R-squared values used for the unconditional ITCV were computed around an unweighted mean. They now equal the weighted R-squared reported bysummary.lm(). Unweighted fits are unaffected.sens_report()no longer points tocovariate_impacts()for frameworks that it does not benchmark (E-values, Rosenbaum bounds).robustness_points()now takes the direction of the original conclusion from the stored threshold when there is one. Paths that start on the wrong side of their threshold are therefore reported as not significant at the first grid value instead of returningNA. Results for paths produced by earlier versions are unchanged.
Other changes
- **DOS2** and **sensitivity2x2xk** are suggested for the cross-checks in the test suite.
- The workflow vignette adds the exact contour, a matched-pair example, and
sens_table().
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK7 OK2026-03-31
Documentation
- Help pages
- 23 (2 internal)includes a package overview page
- Examples that run
- 100%21 run in a plain check (3 of them under a condition)
- Exported functions with examples
- 100%
- Documented parameters
- 89%
- Return-value docs
- 100%
- Help pages citing references
- 35%
Downloads
Repository
Commits over time
- github.com/causalfragility-lab/confoundvis · last recorded on 2026-09-30
5 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/subirhait/confoundvis on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Installing confoundvis adds 17 packages (7 with compiled code, 14 MB of source tarballs). Heaviest: ggplot2 6.0 MB, isoband 1.5 MB, farver 1.2 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.3.0Latest2026-10-17 · current release · diff ↗ ·
removed 7 exports
fit_local_quadratic, plot_cone_comparison, plot_figure2_taylor_panels, plot_local_taylor, plot_reversal_cone, plot_taylor_panels, simulate_taylor_demo·added 5 exports
plot_sensitivity_surface, rir_lm, sens_path_pairs, sens_surface, sens_table2 hours in CRAN's queue
Listed in CRAN's incoming queue from 2026-10-17 19:55 to 2026-10-17 21:55 UTC, in 2 readings. - 0.2.02026-09-30 · diff ↗ ·
added 9 exports
covariate_impacts, from_evalue, from_konfound, from_sensemakr, itcv_lm, plot_taylor_panels, robustness_points, sens_path_lm, sens_report - RR 4.6.0 released · 2026-04-24
- 0.1.02026-03-30
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2026-03-30
- Total releases
- 3 / 1 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 136 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("confoundvis")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.