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