Learn R Programming

fixest (version 0.3.1)

setFixest_coefplot: Sets the defaults of coefplot

Description

You can set the default values of most arguments of coefplot with this function.

Usage

setFixest_coefplot(dict, ci.width = 0.1, ci_level = 0.95,
  pt.pch = 20, cex = par("cex"), pt.cex = cex, col = 1,
  pt.col = col, ci.col = col, lwd = par("lwd"), ci.lwd = lwd,
  ci.lty, grid = TRUE, grid.par = list(lty = 3, col = "gray"),
  zero = TRUE, zero.par = list(col = "black", lwd = 1), join = FALSE,
  join.par = list(lwd = lwd), ref.line, ref.line.par = list(col =
  "black", lty = 2), only.inter = TRUE, reset = TRUE)

Arguments

dict

(Tex only.) A named character vector. It changes the original variable names to the ones contained in the dict. E.g. to change the variables named a and b3 to (resp.) “$log(a)$” and to “$bonus^3$”, use dict=c(a="$log(a)$",b3="$bonus^3$"). By default it is equal to getFixest_dict(), a default dictionary which can be set with setFixest_dict.

ci.width

The width of the extremities of the confidence intervals. Default is 0.1.

ci_level

Scalar between 0 and 1: the level of the CI. By default it is equal to 0.95.

pt.pch

The patch of the coefficient estimates. Default is 20 (circle).

cex

Numeric, default is par("cex"). Expansion factor for the points

pt.cex

The size of the coefficient estimates. Default is the other argument cex.

col

The color of the points and the confidence intervals. Default is 1 ("black"). Note that you can set the colors separately for each of them with pt.col and ci.col.

pt.col

The color of the coefficient estimate. Default is equal to the other argument col.

ci.col

The color of the confidence intervals. Default is equal to the other argument col.

lwd

General liwe with. Default is par("lwd").

ci.lwd

The line width of the confidence intervals. Default is equal to the other argument lwd.

ci.lty

The line type of the confidence intervals. Default is 1.

grid

Logical, default is TRUE. Whether a grid should be displayed. You can set the display of the grid with the argument grid.par.

grid.par

List. Parameters of the grid. The default values are: lty = 3 and col = "gray". You can add any graphical parameter that will be passed to abline. You also have two additional arguments: use horiz = FALSE to disable the horizontal lines, and use vert = FALSE to disable the vertical lines. Eg: grid.par = list(vert = FALSE, col = "red", lwd = 2).

zero

Logical, default is TRUE. Whether the 0-line should be emphasized. You can set the parameters of that line with the argument zero.par.

zero.par

List. Parameters of the zero-line. The default values are col = "black" and lwd = 1. You can add any graphical parameter that will be passed to abline. Example: zero.par = list(col = "darkblue", lwd = 3).

join

Logical, default depends on the situation. If TRUE, then the coefficient estimates are joined with a line. By default, it is equal to TRUE only if: i) interactions are plotted, ii) the x values are numeric and iii) a reference is found.

join.par

List. Parameters of the line joining the cofficients. The default values are: col = pt.col and lwd = lwd. You can add any graphical parameter that will be passed to lines. Eg: join.par = list(lty = 2).

ref.line

Logical, default depends on the situation. It is TRUE only if: i) interactions are plotted, ii) the x values are numeric and iii) a reference is found. If TRUE, then a vertical line is drawn at the level of the reference value. You can set the parameters of this line with the argument ref.line.par.

ref.line.par

List. Parameters of the vertical line on the reference. The default values are: col = "black" and lty = 2. You can add any graphical parameter that will be passed to abline. Eg: ref.line.par = list(lty = 1, lwd = 3).

only.inter

Logical, default is TRUE. If an interaction of the type of var::fe (see feols help for details) is found, then only these interactions are plotted. If FALSE, then interactions are treated as regular coefficients.

reset

Logical, default is TRUE. If TRUE, then the arguments that *are not* set during the call are reset to their "factory"-default values. If FALSE, on the other hand, arguments that have already been modified are not changed.

Value

Doesn't return anything.

See Also

coefplot

Examples

Run this code
# NOT RUN {
# coefplot has many arguments, which makes it highly flexible.
# If you don't like the default style of coefplot. No worries,
# you can set *your* default by using the function
# setFixest_coefplot()

# Estimation
est = feols(Petal.Length ~ Petal.Width + Sepal.Length +
                Sepal.Width | Species, iris)

# Plot with default style
coefplot(est)

# Now we permanently change some arguments
dict = c("Petal.Length"="Length (Petal)", "Petal.Width"="Width (Petal)",
         "Sepal.Length"="Length (Sepal)", "Sepal.Width"="Width (Sepal)")

setFixest_coefplot(ci.col = 2, pt.col = "darkblue", ci.lwd = 3,
                   pt.cex = 2, pt.pch = 15, ci.width = 0, dict = dict)

# Tadaaa!
coefplot(est)

# To reset to the default settings:
setFixest_coefplot()
coefplot(est)

# }

Run the code above in your browser using DataLab