errbar {fixest} | R Documentation |
This function draws confidence intervals in a graph.
errbar(estimate, sd, ci_low, ci_top, x, x.shift = 0, w = 0.1, ci_level = 0.95, style = c("bar", "interval", "tube"), add = FALSE, col = 1, bar.col = col, bar.lwd = par("lwd"), bar.lty, grid = TRUE, grid.par = list(lty = 1), bar.join = FALSE, only.params = FALSE, ...)
estimate |
Numeric vector. The point estimates. |
sd |
The standard errors of the estimates. It may be missing. |
ci_low |
If |
ci_top |
If |
x |
The value of the x-axis. If missing, the names of the argument |
x.shift |
Shifts the confidence intervals bars to the left or right, depending on the value of |
w |
The width of the confidence intervals. |
ci_level |
Scalar between 0 and 1: the level of the CI. By default it is equal to 0.95. |
style |
If “interval”: it plots a confidence interval. If “bar”, it plots simply error bars. If “tube”: as interval, but with a grayed area. |
add |
Default is |
col |
Color of the point estimate and of the line joining them (if |
bar.col |
Color of the bars of the confidence interval. Defaults to |
bar.lwd |
Line width of the confidence intervals, defaults to |
bar.lty |
Line type of the confidence intervals, defaults to |
grid |
Whether to add an horizontal grid. Default is |
grid.par |
Graphical parameters used when plotting the grid in the background. Default is |
bar.join |
Logical, default is |
only.params |
Logical, default is |
... |
Other arguments to be passed to the function |
Laurent Berge
did_estimate_yearly_effects
, did_plot_yearly_effects
.
a = rnorm(100) b = 0.5*a + rnorm(100) c = -0.5*b + rnorm(100) est = summary(lm(a ~ c + b)) errbar(est$coefficients, x.shift = -.2) errbar(est$coefficients, , x.shift = .2, add = TRUE, col = 2, bar.lty = 2, pch=15)