-
Notifications
You must be signed in to change notification settings - Fork 301
Expand file tree
/
Copy pathglance.fixest.Rd
More file actions
94 lines (77 loc) · 3.81 KB
/
Copy pathglance.fixest.Rd
File metadata and controls
94 lines (77 loc) · 3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fixest.R
\name{glance.fixest}
\alias{glance.fixest}
\title{Glance at a(n) fixest object}
\usage{
\method{glance}{fixest}(x, ...)
}
\arguments{
\item{x}{A \code{fixest} object returned from any of the \code{fixest} estimators}
\item{...}{Additional arguments passed to \code{\link[fixest:summary.fixest]{summary.fixest}}
and \code{\link[fixest:confint.fixest]{confint.fixest}}. Important arguments are
\code{vcov} (a VCOV type string like \code{"hetero"}, or a one-sided formula like
\code{~Product + Year} for clustering), \code{cluster}, and \code{ssc} (small sample
correction). The \code{se} argument is accepted but deprecated in recent
\code{fixest} versions; use \code{vcov} instead. Other arguments include
\code{forceCovariance} and \code{keepBounded}.
See \code{\link[fixest:summary.fixest]{summary.fixest}} for details.}
}
\description{
Glance accepts a model object and returns a \code{\link[tibble:tibble]{tibble::tibble()}}
with exactly one row of model summaries. The summaries are typically
goodness of fit measures, p-values for hypothesis tests on residuals,
or model convergence information.
Glance never returns information from the original call to the modeling
function. This includes the name of the modeling function or any
arguments passed to the modeling function.
Glance does not calculate summary measures. Rather, it farms out these
computations to appropriate methods and gathers the results together.
Sometimes a goodness of fit measure will be undefined. In these cases
the measure will be reported as \code{NA}.
Glance returns the same number of columns regardless of whether the
model matrix is rank-deficient or not. If so, entries in columns
that no longer have a well-defined value are filled in with an \code{NA}
of the appropriate type.
}
\note{
All columns listed below will be returned, but some will be \code{NA},
depending on the type of model estimated. \code{sigma}, \code{r.squared},
\code{adj.r.squared}, and \code{within.r.squared} will be NA for any model other than
\code{feols}. \code{pseudo.r.squared} will be NA for \code{feols}.
}
\examples{
\dontshow{if (rlang::is_installed("fixest") & !broom:::is_cran_check()) withAutoprint(\{ # examplesIf}
# 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, vcov = ~Product + Year)
tidy(gravity, conf.int = TRUE, vcov = "hetero")
# 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.
\dontshow{\}) # examplesIf}
}
\value{
A \code{\link[tibble:tibble]{tibble::tibble()}} with exactly one row and columns:
\item{adj.r.squared}{Adjusted R squared statistic, which is like the R squared statistic except taking degrees of freedom into account.}
\item{AIC}{Akaike's Information Criterion for the model.}
\item{BIC}{Bayesian Information Criterion for the model.}
\item{logLik}{The log-likelihood of the model. [stats::logLik()] may be a useful reference.}
\item{nobs}{Number of observations used.}
\item{pseudo.r.squared}{Like the R squared statistic, but for situations when the R squared statistic isn't defined.}
\item{r.squared}{R squared statistic, or the percent of variation explained by the model. Also known as the coefficient of determination.}
\item{sigma}{Estimated standard error of the residuals.}
\item{within.r.squared}{R squared within fixed-effect groups.}
}