Debian Codegraph @

man/tidy.fixest.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/fixest.R
3 \name{tidy.fixest}
4 \alias{tidy.fixest}
5 \title{Tidy a(n) fixest object}
6 \usage{
7 \method{tidy}{fixest}(x, conf.int = FALSE, conf.level = 0.95, ...)
8 }
9 \arguments{
10 \item{x}{A \code{fixest} object returned from any of the \code{fixest} estimators}
11
12 \item{conf.int}{Logical indicating whether or not to include a confidence
13 interval in the tidied output. Defaults to \code{FALSE}.}
14
15 \item{conf.level}{The confidence level to use for the confidence interval
16 if \code{conf.int = TRUE}. Must be strictly greater than 0 and less than 1.
17 Defaults to 0.95, which corresponds to a 95 percent confidence interval.}
18
19 \item{...}{Additional arguments passed to \code{summary} and \code{confint}. Important
20 arguments are \code{se} and \code{cluster}. Other arguments are \code{dof}, \code{exact_dof},
21 \code{forceCovariance}, and \code{keepBounded}.
22 See \code{\link[fixest:summary.fixest]{summary.fixest}}.}
23 }
24 \description{
25 Tidy summarizes information about the components of a model.
26 A model component might be a single term in a regression, a single
27 hypothesis, a cluster, or a class. Exactly what tidy considers to be a
28 model component varies across models but is usually self-evident.
29 If a model has several distinct types of components, you will need to
30 specify which components to return.
31 }
32 \details{
33 The \code{fixest} package provides a family of functions for estimating
34 models with arbitrary numbers of fixed-effects, in both an OLS and a GLM
35 context. The package also supports robust (i.e. White) and clustered
36 standard error reporting via the generic \code{summary.fixest()} command. In a
37 similar vein, the \code{tidy()} method for these models allows users to specify
38 a desired standard error correction either 1) implicitly via the supplied
39 fixest object, or 2) explicitly as part of the tidy call. See examples
40 below.
41
42 Note that fixest confidence intervals are calculated assuming a normal
43 distribution -- this assumes infinite degrees of freedom for the CI.
44 (This assumption is distinct from the degrees of freedom used to calculate
45 the standard errors. For more on degrees of freedom with clusters and
46 fixed effects, see \url{https://github.com/lrberge/fixest/issues/6} and
47 \url{https://github.com/sgaure/lfe/issues/1#issuecomment-530646990})
48 }
49 \examples{
50 \dontshow{if (rlang::is_installed("fixest") & !broom:::is_cran_check()) withAutoprint(\{ # examplesIf}
51
52 # load libraries for models and data
53 library(fixest)
54
55 gravity <-
56 feols(
57 log(Euros) ~ log(dist_km) | Origin + Destination + Product + Year, trade
58 )
59
60 tidy(gravity)
61 glance(gravity)
62 augment(gravity, trade)
63
64 # to get robust or clustered SEs, users can either:
65
66 # 1) specify the arguments directly in the `tidy()` call
67
68 tidy(gravity, conf.int = TRUE, cluster = c("Product", "Year"))
69
70 tidy(gravity, conf.int = TRUE, se = "threeway")
71
72 # 2) or, feed tidy() a summary.fixest object that has already accepted
73 # these arguments
74
75 gravity_summ <- summary(gravity, cluster = c("Product", "Year"))
76
77 tidy(gravity_summ, conf.int = TRUE)
78
79 # approach (1) is preferred.
80 \dontshow{\}) # examplesIf}
81 }
82 \seealso{
83 \code{\link[=tidy]{tidy()}}, \code{\link[fixest:feglm]{fixest::feglm()}}, \code{\link[fixest:femlm]{fixest::fenegbin()}},
84 \code{\link[fixest:feNmlm]{fixest::feNmlm()}}, \code{\link[fixest:femlm]{fixest::femlm()}}, \code{\link[fixest:feols]{fixest::feols()}}, \code{\link[fixest:feglm]{fixest::fepois()}}
85
86 Other fixest tidiers:
87 \code{\link{augment.fixest}()}
88 }
89 \concept{fixest tidiers}
90 \value{
91 A \code{\link[tibble:tibble]{tibble::tibble()}} with columns:
92 \item{conf.high}{Upper bound on the confidence interval for the estimate.}
93 \item{conf.low}{Lower bound on the confidence interval for the estimate.}
94 \item{estimate}{The estimated value of the regression term.}
95 \item{p.value}{The two-sided p-value associated with the observed statistic.}
96 \item{statistic}{The value of a T-statistic to use in a hypothesis that the regression term is non-zero.}
97 \item{std.error}{The standard error of the regression term.}
98 \item{term}{The name of the regression term.}
99
100 }