- object
Can be either: i) an estimation object (obtained for example from
feols
, ii) a list of estimation objects (several results will be plotted at
once), iii) a matrix of coefficients table, iv) a numeric vector of the point
estimates -- the latter requiring the extra arguments sd
or ci_low
and ci_high
.
- ...
Other arguments to be passed to summary
, if object
is an estimation,
and/or to the function plot
or lines
(if add = TRUE
).
- style
A character scalar giving the style of the plot to be used. You
can set styles with the function setFixest_coefplot
, setting all the default
values of the function. If missing, then it switches to either "default" or "iplot",
depending on the calling function.
- sd
The standard errors of the estimates. It may be missing.
- ci_low
If sd
is not provided, the lower bound of the confidence interval.
For each estimate.
- ci_high
If sd
is not provided, the upper bound of the confidence interval.
For each estimate.
- df.t
Integer scalar or NULL
(default). The degrees of freedom (DoF) to use
when computing the confidence intervals with the Student t. By default it
tries to capture the DoF from the estimation. To use a Normal law to compute the
confidence interval, use df.t = Inf
.
- x
The value of the x-axis. If missing, the names of the argument estimate
are used.
- x.shift
Shifts the confidence intervals bars to the left or right, depending
on the value of x.shift
. Default is 0.
- horiz
A logical scalar, default is FALSE
. Whether to display the confidence
intervals horizontally instead of vertically.
- dict
A named character vector or a logical scalar. It changes the original variable names
to the ones contained in the dict
ionary. 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
. You can use dict = FALSE
to disable it. By default dict
modifies the
entries in the global dictionary, to disable this behavior, use "reset" as the first element
(ex: dict=c("reset", mpg="Miles per gallon")
).
- keep
Character vector. This element is used to display only a subset of variables. This
should be a vector of regular expressions (see base::regex
help for more info). Each
variable satisfying any of the regular expressions will be kept. This argument is applied post
aliasing (see argument dict
). Example: you have the variable x1
to x55
and want to display
only x1
to x9
, then you could use keep = "x[[:digit:]]$"
. If the first character is an
exclamation mark, the effect is reversed (e.g. keep = "!Intercept" means: every variable that
does not contain “Intercept” is kept). See details.
- drop
Character vector. This element is used if some variables are not to be displayed.
This should be a vector of regular expressions (see base::regex
help for more info). Each
variable satisfying any of the regular expressions will be discarded. This argument is applied
post aliasing (see argument dict
). Example: you have the variable x1
to x55
and want to
display only x1
to x9
, then you could use drop = "x[[:digit:]]{2}
". If the first character
is an exclamation mark, the effect is reversed (e.g. drop = "!Intercept" means: every variable
that does not contain “Intercept” is dropped). See details.
- order
Character vector. This element is used if the user wants the variables to be
ordered in a certain way. This should be a vector of regular expressions (see base::regex
help for more info). The variables satisfying the first regular expression will be placed first,
then the order follows the sequence of regular expressions. This argument is applied post
aliasing (see argument dict
). Example: you have the following variables: month1
to month6
,
then x1
to x5
, then year1
to year6
. If you want to display first the x's, then the
years, then the months you could use: order = c("x", "year")
. If the first character is an
exclamation mark, the effect is reversed (e.g. order = "!Intercept" means: every variable that
does not contain “Intercept” goes first). See details.
- 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.
- add
Default is FALSE
, if the intervals are to be added to an existing
graph. Note that if it is the case, then the argument x
MUST be numeric.
- pt.pch
The patch of the coefficient estimates. Default is 1 (circle).
- pt.bg
The background color of the point estimate (when the pt.pch
is
in 21 to 25). Defaults to NULL.
- cex
Numeric, default is 1. 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 estimates. 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 line with. Default is 1.
- pt.lwd
The line width of the coefficient estimates. Default is equal to
the other argument 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 graphics::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 graphics::abline
. Example: zero.par = list(col = "darkblue", lwd = 3)
.
- pt.join
Logical, default is FALSE
. If TRUE
, then the coefficient estimates
are joined with a line.
- pt.join.par
List. Parameters of the line joining the coefficients. The
default values are: col = pt.col
and lwd = lwd
. You can add any graphical
parameter that will be passed to lines
. Eg: pt.join.par = list(lty = 2)
.
- ci.join
Logical default to FALSE
. Whether to join the extremities of
the confidence intervals. If TRUE
, then you can set the graphical parameters
with the argument ci.join.par
.
- ci.join.par
A list of parameters to be passed to graphics::lines
.
Only used if ci.join=TRUE
. By default it is equal to list(lwd = lwd, col = col, lty = 2)
.
- ci.fill
Logical default to FALSE
. Whether to fill the confidence intervals
with a color. If TRUE
, then you can set the graphical parameters with the argument ci.fill.par
.
- ci.fill.par
A list of parameters to be passed to graphics::polygon
.
Only used if ci.fill=TRUE
. By default it is equal to list(col = "lightgray", alpha = 0.5)
.
Note that alpha
is a special parameter that adds transparency to the color (ranges from 0 to 1).
- ref
Used to add points equal to 0 (typically to visualize reference points).
Either: i) "auto" (default), ii) a character vector of length 1, iii) a list
of length 1, iv) a named integer vector of length 1, or v) a numeric vector.
By default, in iplot
, if the argument ref
has been used in the estimation,
these references are automatically added. If ii), ie a character scalar, then
that coefficient equal to zero is added as the first coefficient. If a list or
a named integer vector of length 1, then the integer gives the position of the
reference among the coefficients and the name gives the coefficient name. A non-named
numeric value of ref
only works if the x-axis is also numeric (which can happen
in iplot
).
- ref.line
Logical or numeric, default is "auto", whose behavior 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. Otherwise, if numeric a vertical
line will be drawn at that specific value.
- 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 graphics::abline
. Eg: ref.line.par = list(lty = 1, lwd = 3)
.
- lab.cex
The size of the labels of the coefficients. Default is missing.
It is automatically set by an internal algorithm which can go as low as lab.min.cex
(another argument).
- lab.min.cex
The minimum size of the coefficients labels, as set by the
internal algorithm. Default is 0.85.
- lab.max.mar
The maximum size the left margin can take when trying to fit
the coefficient labels into it (only when horiz = TRUE
). This is used in the
internal algorithm fitting the coefficient labels. Default is 0.25
.
- lab.fit
The method to fit the coefficient labels into the plotting region
(only when horiz = FALSE
). Can be "auto"
(the default), "simple"
, "multi"
or "tilted"
. If "simple"
, then the classic axis is drawn. If "multi"
, then
the coefficient labels are fit horizontally across several lines, such that they
don't collide. If "tilted"
, then the labels are tilted. If "auto"
, an automatic
choice between the three is made.
- xlim.add
A numeric vector of length 1 or 2. It represents an extension
factor of xlim, in percentage. Eg: xlim.add = c(0, 0.5)
extends xlim
of 50%
on the right. If of length 1, positive values represent the right, and negative
values the left (Eg: xlim.add = -0.5
is equivalent to xlim.add = c(0.5, 0)
).
- ylim.add
A numeric vector of length 1 or 2. It represents an extension
factor of ylim, in percentage. Eg: ylim.add = c(0, 0.5)
extends ylim
of 50%
on the top. If of length 1, positive values represent the top, and negative values
the bottom (Eg: ylim.add = -0.5
is equivalent to ylim.add = c(0.5, 0)
).
- only.params
Logical, default is FALSE
. If TRUE
no graphic is displayed,
only the values of x
and y
used in the plot are returned.
- sep
The distance between two estimates -- only when argument object
is a list of estimation results.
- as.multiple
Logical: default is FALSE
. Only when object
is a single
estimation result: whether each coefficient should have a different color, line
type, etc. By default they all get the same style.
- bg
Background color for the plot. By default it is white.
- group
A list, default is missing. Each element of the list reports the
coefficients to be grouped while the name of the element is the group name. Each
element of the list can be either: i) a character vector of length 1, ii) of
length 2, or ii) a numeric vector. If equal to: i) then it is interpreted as
a pattern: all element fitting the regular expression will be grouped (note that
you can use the special character "^^" to clean the beginning of the names, see
example), if ii) it corresponds to the first and last elements to be grouped,
if iii) it corresponds to the coefficients numbers to be grouped. If equal to
a character vector, you can use a percentage to tell the algorithm to look at
the coefficients before aliasing (e.g. "%varname"
). Example of valid uses:
group=list(group_name=\"pattern\")
, group=list(group_name=c(\"var_start\", \"var_end\"))
,
group=list(group_name=1:2))
. See details.
- group.par
A list of parameters controlling the display of the group. The
parameters controlling the line are: lwd
, tcl
(length of the tick), line.adj
(adjustment of the position, default is 0), tick
(whether to add the ticks),
lwd.ticks
, col.ticks
. Then the parameters controlling the text: text.adj
(adjustment of the position, default is 0), text.cex
, text.font
, text.col
.
- main
The title of the plot. Default is "Effect on __depvar__"
. You can
use the special variable __depvar__
to set the title (useful when you set the
plot default with setFixest_coefplot
).
- value.lab
The label to appear on the side of the coefficient values. If
horiz = FALSE
, the label appears in the y-axis. If horiz = TRUE
, then it
appears on the x-axis. The default is equal to "Estimate and __ci__ Conf. Int."
,
with __ci__
a special variable giving the value of the confidence interval.
- ylab
The label of the y-axis, default is NULL
. Note that if horiz = FALSE
, it overrides the value of the argument value.lab
.
- xlab
The label of the x-axis, default is NULL
. Note that if horiz = TRUE
, it overrides the value of the argument value.lab
.
- sub
A subtitle, default is NULL
.
- i.select
Integer scalar, default is 1. In iplot
, used to select which
variable created with i()
to select. Only used when there are several variables
created with i
. This is an index, just try increasing numbers to hopefully
obtain what you want. Note that it works much better when the variables are "pure"
i()
and not interacted with other variables. For example: i(species, x1)
is good while i(species):x1
isn't. The latter will also work but the index
may feel weird in case there are many i()
variables.