tidy.fixest | R Documentation |
Tidy summarizes information about the components of a model. A model component might be a single term in a regression, a single hypothesis, a cluster, or a class. Exactly what tidy considers to be a model component varies across models but is usually self-evident. If a model has several distinct types of components, you will need to specify which components to return.
## S3 method for class 'fixest'
tidy(x, conf.int = FALSE, conf.level = 0.95, ...)
x |
A |
conf.int |
Logical indicating whether or not to include a confidence
interval in the tidied output. Defaults to |
conf.level |
The confidence level to use for the confidence interval
if |
... |
Additional arguments passed to |
The fixest
package provides a family of functions for estimating
models with arbitrary numbers of fixed-effects, in both an OLS and a GLM
context. The package also supports robust (i.e. White) and clustered
standard error reporting via the generic summary.fixest()
command. In a
similar vein, the tidy()
method for these models allows users to specify
a desired standard error correction either 1) implicitly via the supplied
fixest object, or 2) explicitly as part of the tidy call. See examples
below.
Note that fixest confidence intervals are calculated assuming a normal distribution – this assumes infinite degrees of freedom for the CI. (This assumption is distinct from the degrees of freedom used to calculate the standard errors. For more on degrees of freedom with clusters and fixed effects, see https://github.com/lrberge/fixest/issues/6 and https://github.com/sgaure/lfe/issues/1#issuecomment-530646990)
A tibble::tibble()
with columns:
conf.high |
Upper bound on the confidence interval for the estimate. |
conf.low |
Lower bound on the confidence interval for the estimate. |
estimate |
The estimated value of the regression term. |
p.value |
The two-sided p-value associated with the observed statistic. |
statistic |
The value of a T-statistic to use in a hypothesis that the regression term is non-zero. |
std.error |
The standard error of the regression term. |
term |
The name of the regression term. |
tidy()
, fixest::feglm()
, fixest::fenegbin()
,
fixest::feNmlm()
, fixest::femlm()
, fixest::feols()
, fixest::fepois()
Other fixest tidiers:
augment.fixest()
# load libraries for models and data
library(fixest)
gravity <-
feols(
log(Euros) ~ log(dist_km) | Origin + Destination + Product + Year, trade
)
tidy(gravity)
glance(gravity)
augment(gravity, trade)
# to get robust or clustered SEs, users can either:
# 1) specify the arguments directly in the `tidy()` call
tidy(gravity, conf.int = TRUE, cluster = c("Product", "Year"))
tidy(gravity, conf.int = TRUE, se = "threeway")
# 2) or, feed tidy() a summary.fixest object that has already accepted
# these arguments
gravity_summ <- summary(gravity, cluster = c("Product", "Year"))
tidy(gravity_summ, conf.int = TRUE)
# approach (1) is preferred.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.