regsensitivity 0.1.2
Plots
The Oster equality identified-set plot no longer draws a false vertical connector where the numerically ordered solution branches swap arms across an asymptote. Branches are now split exactly where a step would cross a vertical asymptote of
delta(beta), computed from the model rather than guessed from the drawing. With severalr2longvalues the curves are now drawn (and coloured) perr2longinstead of being interleaved into one line.plot()gainsxline, drawing vertical reference lines. This closes a gap against the Stata package, whose vignette usesxline()to mark values such asrmaxor a breakdown point; those figures could not be reproduced in R before.New
theme_regsen()andscale_colour_regsen()(withscale_color_regsen()andscale_fill_regsen()aliases), exported so a plot can be rebuilt with the same look. Defaults are aimed at print: a faint y-grid, a thin panel border, legend on top, and the colourblind-safe Okabe-Ito palette, which also survives greyscale printing.Axis and legend titles now use plotmath, so they read as the symbols in the papers rather than as parameter names.
plot()gainsbase_size; use9for a two-column journal figure.Passing
NAtotitle,subtitle,xtitleorytitledrops the annotation. The auto-generated subtitle is no longer applied by default, since a journal figure carries its description in the caption.
Calibration
- New
calibrate_rho()andcalibrate_partial_r2(), computing the point-identified reference values of DMP (2026) Section 3.4 (Table 4) and Table 3, so the sensitivity parameters can be read against the observed covariates they are calibrated to.
Verification
- The Oster (2019) implementation is now checked against the paper rather than against its own past output. A test round-trips Proposition 3 into Proposition 2: the delta reported as the breakdown for a target beta, fed back through the identified set, must return that beta. It does, to machine precision, for several targets.
-
results$breakdownis documented as signed. The sign carries the direction of selection; passingabs()of it back intoregsen_bounds()lands on a different branch of the Oster cubic. The scalar$breakdownreports the magnitude and exists onregsen_bounds()output only – aregsen_breakdown()result carries the value inresults$breakdownalone.
Replication fidelity
- The DMP (2026) Figure 1 reproduction now matches the published figure. The left panel gains the dashed bounds under the common-maximal-impact restriction
rybar = rxbarand the Table 4 calibration tick marks; both zero crossings are reported and agree with the published 0.804 and 0.959. The right panel previously plotted the breakdown point againstcbar, a different object from the paper’s, which is the breakdown frontier in (rxbar, rybar) space; it is now that frontier, one curve percbar. -
plot()no longer paints a line along the panel edge when a stretch of the sweep is unbounded. Only the first point of each unbounded run is routed off-panel and the rest are blank, so the curve leaves the plot once instead of running along its boundary. Runs are detected per series, so one beginning at a group boundary still gets its own exit.
Bug fixes
-
regsen_bounds(analysis = "oster", delta_type = "bound")reported a bounded identified set where the set is in fact unbounded. The solver correctly returns-Inf/Inffor|delta| <= dbarwithdbar >= 1, but the routine accumulating bounds across the grid discarded infinite values alongsideNAand carried the last finite bound forward. On the bundled data,delta = c(0.5, 1, 2)reported[1.31, 2.98]at every point instead of(-Inf, Inf)fromdbar = 1on.NAstill carries over, since it means the solver failed and carries no information; an infinity is a bound and now propagates. This is the one direction a sensitivity analysis must not err in, since it made results look more robust than they are. Previously validated numbers are unchanged – the snapshot tests pass untouched.
Interactive
- New
regsen_explore(), a shiny application for moving the sensitivity parameters by hand and watching the identified set respond. is a Suggests, so the rest of the package works without it. Inputs are validated and the model is fitted once before the app opens, so a bad call reports at the console rather than as a banner in a browser tab.
Several treatments
- New
regsen_multi(), running the analysis once per candidate treatment and collecting the breakdown points into one table, with aplot()method ordering treatments by fragility. Every treatment is analysed in the same specification – the others stay as controls – so the rows are comparable. A treatment whose analysis fails yields anNArow with the reason rather than aborting the sweep.
Inference
-
regsen_boot()gainsncores, running replications in parallel: forking on macOS and Linux, a PSOCK cluster on Windows. A progress bar is not shown in parallel, since it cannot report meaningfully from several workers. - Results for a given
seedare now identical regardless ofncores. Each replicate seeds itself from a vector drawn once up front, rather than relying on parallel RNG substreams, which would have made the numbers depend on how the work happened to be divided.
Documentation
- New vignette “Publication-ready plots and tables”, covering figure sizing for journals, greyscale and colour-vision safety, and the LaTeX / HTML / Markdown table output.
- New vignette “Coming from the Stata package”, mapping every command and option in the Stata package’s own vignette onto its R equivalent. It doubles as a coverage check: a gap would show as a missing row rather than going unnoticed.
Interoperability
- New
regsen_tidy()andregsen_glance(), broom-style tidiers. They are registered ongenerics::tidy()/glance()when is installed, so results flow into and anything else speaking that vocabulary;genericsstays a Suggests. - New
autoplot()method, forwarding toplot().
Replication
- The DMP (2026) vignette now checks its numbers against the published values in a table, and
stopifnot()s the comparison, so a regression stops the build instead of quietly shipping a wrong replication. - Calibration labels in the Figure 1 overlay are staggered across three x positions; at a single x they collided into an unreadable stack.
Tables
- New
as.data.frame()method returning the results as a plain data frame, so they can be passed to any table package (kableExtra, gt, modelsummary, huxtable, tinytable, xtable). - New
regsen_table()rendering results as LaTeX, HTML or Markdown, so the same call works in an Rmd/Qmd knitting to PDF, HTML or Markdown. LaTeX output usesbooktabsand puts notes in athreeparttable, withnotes = TRUEgenerating a note recording the analysis, hypothesis and sample size. Infinite bounds render as the correct symbol per format rather than being blanked out.
regsensitivity 0.1.1
- Fix a Windows-only crash when the DIRECT optimizer (DMP analysis with
rybar < Infandcbar > 0) explored parameter points wherevarx_bounds()returned NA endpoints. The downstreamquad_ineq_bounds()did unguardedif (b1 <= r1 && b2 <= r1)comparisons which evaluated toNAand triggered “missing value where TRUE/FALSE needed”. Symptoms: BFG2020 vignette failed to build on Windows (Status: 1 ERROR on win-builder), but built clean on macOS due to floating-point determinism differences in nloptr’s DIRECT-L. - Audit all bare
if (...)numeric comparisons indmp.Rand guard against NA propagation. Every comparison now usesisTRUE()/isFALSE()so a single NA cannot poison the dispatch logic. - Add 13 NA-robustness regression tests pinning the failure mode (
tests/testthat/test-na-robustness.R).
regsensitivity 0.1.0
- Initial CRAN-ready release.
- Implements:
- DMP (2026) identified set and breakdown frontier (
rybar = Infanalytic,rybar < Inf, cbar = 0analytic,rybar < Inf, cbar > 0via DIRECT global optimization (nloptr)). - Oster (2019) identified set (
eqandboundmodes) and breakdown points. - Masten & Poirier (2026)
maxovbextension.
- DMP (2026) identified set and breakdown frontier (
- User API:
regsen_bounds(),regsen_breakdown(),regsen_summary(),regsensitivity()dispatcher, hypothesis helpers (bnd_lb(),bnd_ub(),bnd_eq()). - Visualization:
plot.regsensitivity()(ggplot2). - Vignettes:
-
regsensitivity: end-to-end tour with the BFG2020 application. -
dmp2022-replication: reproduces every table and figure of Diegert, Masten & Poirier (2026) that uses the bundled data. -
mp2022-stylized: reproduces the stylized Oster examples from Masten & Poirier (2026).
-
- Bundled data:
bfg2020(Bazzi, Fiszbein, Gebresilasse 2020, subset).
