| regsen_multi | R Documentation |
Runs regsen_breakdown() (or regsen_bounds()) once per candidate
treatment and collects the breakdown points into one table. This is the
applied question "which of my regressors would survive an unobservable,
and which would not?", answered in a single call.
regsen_multi(
formula,
data,
treatments,
compare = NULL,
fun = regsen_breakdown,
...,
ncores = NULL
)
## S3 method for class 'regsensitivity_multi'
print(x, ...)
## S3 method for class 'regsensitivity_multi'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
## S3 method for class 'regsensitivity_multi'
summary(object, ...)
## S3 method for class 'summary.regsensitivity_multi'
print(x, ...)
## S3 method for class 'regsensitivity_multi'
plot(x, base_size = 11, ...)
formula |
A model formula. Its right-hand side must contain every
name in |
data |
A data frame. |
treatments |
Character vector of variables to treat as the treatment in turn. |
compare |
Passed to the underlying analysis. A variable currently
acting as the treatment is removed from |
fun |
The analysis to run: |
... |
Passed to |
ncores |
Number of cores to spread the treatments over. |
x |
A |
row.names, optional |
Ignored, present for S3 compatibility with
|
object |
A |
base_size |
Base font size, passed to |
Each treatment is analysed in the same model: the variable of interest moves to the front of the formula and every other right-hand-side term stays a control, including the other candidate treatments. That is deliberate – dropping the others would change the specification and the breakdown points would no longer be comparable across rows.
A data.frame of class regsensitivity_multi, one row per
treatment, with columns treatment, estimate (the medium-regression
coefficient), breakdown, and n. Rows where the analysis failed
carry NA and an error column explaining why, rather than aborting
the whole sweep.
summary() returns an object of class
summary.regsensitivity_multi: the treatments ordered from most to
least fragile, with the count of those whose breakdown point is below
1, the benchmark at which the omitted variable is no more important
than the comparison controls.
data(bfg2020)
w1 <- c("log_area_2010", "lat", "lon")
regsen_multi(
avgrep2000to2016 ~ tye_tfe890_500kNI_100_l6 + log_area_2010 + lat + lon,
data = bfg2020,
treatments = c("tye_tfe890_500kNI_100_l6", "lat"),
compare = w1, cbar = 1
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.