regsensitivity: Regression sensitivity analysis

View source: R/api.R

regsensitivityR Documentation

Regression sensitivity analysis

Description

Top-level dispatcher that mirrors the Stata regsensitivity command. For most users, calling regsen_bounds() or regsen_breakdown() directly is clearer.

Usage

regsensitivity(
  formula,
  data,
  subcommand = c("bounds", "breakdown", "summary"),
  ...
)

Arguments

formula

Two-sided formula: y ~ x + w1 + w2 + .... The first right-hand-side variable is the primary independent variable; the rest are controls.

data

A data.frame.

subcommand

One of "bounds" (the default), "breakdown", "summary".

...

Additional arguments forwarded to the underlying function.

Details

Versions before 0.3.0 took subcommand first, following the Stata syntax. A call in that order, regsensitivity("bounds", y ~ x, data), still runs, with a deprecation warning.

Value

An object of class regsensitivity, or for subcommand = "summary" one of class regsensitivity_summary.

See Also

regsen_bounds(), regsen_breakdown(), regsen_summary()

Examples

data(bfg2020)
regsensitivity(
  avgrep2000to2016 ~ tye_tfe890_500kNI_100_l6 +
    log_area_2010 + lat + lon,
  data = bfg2020,
  subcommand = "bounds",
  cbar = 0.1
)

regsensitivity documentation built on Nov. 23, 2026, 9:08 a.m.