iplot_data {ggfixest} | R Documentation |
Internal function for grabbing and preparing iplot data.
Description
Grabs the underlying data used to construct fixest::iplot
,
with some added functionality and tweaks for the ggiplot
equivalents.
Usage
iplot_data(
object,
.ci_level = 0.95,
.keep = NULL,
.drop = NULL,
.dict = fixest::getFixest_dict(),
.internal.only.i = TRUE,
.i.select = 1,
.aggr_es = NULL,
.group = "auto",
.vcov = NULL,
.cluster = NULL,
.se = NULL
)
coefplot_data(
object,
.ci_level = 0.95,
.keep = NULL,
.drop = NULL,
.group = "auto",
.dict = fixest::getFixest_dict(),
.internal.only.i = FALSE,
.i.select = 1,
.aggr_es = "none",
.vcov = NULL,
.cluster = NULL,
.se = NULL
)
Arguments
object |
A model object of class |
.ci_level |
A number between 0 and 1 indicating the desired confidence level, Defaults to 0.95. |
.keep |
Character vector used to subset the coefficients of interest.
Passed down to |
.drop |
Character vector used to subset the coefficients of interest
(complement of |
.dict |
A dictionary (i.e. named character vector or a logical scalar).
Used for changing coefficient names. Defaults to the values in
|
.internal.only.i |
Logical variable used for some internal function handling when passing on to coefplot/iplot. |
.i.select |
Integer scalar, default is 1. In (gg)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. Passed down to
|
.aggr_es |
A keyword string or numeric sequence indicating whether the
aggregated mean treatment effects for some subset of the model should be
added as a column to the returned data frame. Passed to
|
.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. Passed down to
|
.vcov , .cluster , .se |
Alternative options for adjusting the standard
errors of the model object on the fly. See |
Details
This function is a wrapper around
fixest::iplot(..., only.params = TRUE)
, but with various checks and tweaks
to better facilitate plotting with ggplot2
and handling of complex object
types (e.g. lists of fixest_multi models)
Value
A data frame consisting of estimate values, confidence intervals, relative x-axis positions, and other aesthetic information needed to draw a ggplot2 object.
Functions
-
coefplot_data()
: Internal function for grabbing and preparing coefplot data
See Also
Examples
library(fixest)
est_did = feols(y ~ x1 + i(period, treat, 5) | id+period,
data = base_did)
iplot(est_did, only.params = TRUE) # The "base" version
iplot_data(est_did) # The wrapper provided by this package
# Illustrative fixest_multi case, where the sample has been split by odd and
# even ID numbers.
est_split = feols(y ~ x1 + i(period, treat, 5) | id+period,
data = base_did, split = ~id%%2)
iplot(est_split, only.params = TRUE) # The "base" version
iplot_data(est_split) # The wrapper provided by this package