| plot.regsensitivity | R Documentation |
Produces a ggplot object visualizing either an identified-set sweep (from
regsen_bounds()) or a breakdown frontier (from regsen_breakdown()).
## S3 method for class 'regsensitivity'
plot(
x,
ywidth = NULL,
ylim = NULL,
show_breakdown = TRUE,
show_legend = TRUE,
xline = NULL,
xline_colour = "grey40",
xline_linetype = "dashed",
xline_linewidth = 0.35,
title = NULL,
subtitle = NULL,
xtitle = NULL,
ytitle = NULL,
base_size = 11,
...
)
x |
A |
ywidth |
Half-width of the y-axis in standard deviations of X.
Ignored when |
ylim |
Optional two-element numeric vector giving the y-axis limits. |
show_breakdown |
Logical; draw a horizontal line at the hypothesis
value. Defaults to |
show_legend |
Logical; show the legend (only relevant when plotting bounds with multiple values of a second sensitivity parameter). |
xline |
Optional numeric vector of x-axis positions at which to draw
reference lines, the equivalent of Stata's |
xline_colour, xline_linetype, xline_linewidth |
Appearance of the
|
title, subtitle, xtitle, ytitle |
Plot annotations. |
base_size |
Base font size passed to |
... |
Ignored. |
A ggplot object. Because it is an ordinary ggplot, every default
here can be overridden by adding scales, themes or annotations to it.
data(bfg2020)
res <- regsen_bounds(
avgrep2000to2016 ~ tye_tfe890_500kNI_100_l6 + log_area_2010 + lat + lon,
data = bfg2020, compare = c("log_area_2010", "lat", "lon"),
cbar = c(0.1, 0.5, 1)
)
plot(res, xline = 1, base_size = 9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.