| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/fixest.R |
| 3 |
\name{glance.fixest} |
| 4 |
\alias{glance.fixest} |
| 5 |
\title{Glance at a(n) fixest object} |
| 6 |
\usage{ |
| 7 |
\method{glance}{fixest}(x, ...) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{x}{A \code{fixest} object returned from any of the \code{fixest} estimators} |
| 11 |
|
| 12 |
\item{...}{Additional arguments passed to \code{summary} and \code{confint}. Important |
| 13 |
arguments are \code{se} and \code{cluster}. Other arguments are \code{dof}, \code{exact_dof}, |
| 14 |
\code{forceCovariance}, and \code{keepBounded}. |
| 15 |
See \code{\link[fixest:summary.fixest]{summary.fixest}}.} |
| 16 |
} |
| 17 |
\description{ |
| 18 |
Glance accepts a model object and returns a \code{\link[tibble:tibble]{tibble::tibble()}} |
| 19 |
with exactly one row of model summaries. The summaries are typically |
| 20 |
goodness of fit measures, p-values for hypothesis tests on residuals, |
| 21 |
or model convergence information. |
| 22 |
|
| 23 |
Glance never returns information from the original call to the modeling |
| 24 |
function. This includes the name of the modeling function or any |
| 25 |
arguments passed to the modeling function. |
| 26 |
|
| 27 |
Glance does not calculate summary measures. Rather, it farms out these |
| 28 |
computations to appropriate methods and gathers the results together. |
| 29 |
Sometimes a goodness of fit measure will be undefined. In these cases |
| 30 |
the measure will be reported as \code{NA}. |
| 31 |
|
| 32 |
Glance returns the same number of columns regardless of whether the |
| 33 |
model matrix is rank-deficient or not. If so, entries in columns |
| 34 |
that no longer have a well-defined value are filled in with an \code{NA} |
| 35 |
of the appropriate type. |
| 36 |
} |
| 37 |
\note{ |
| 38 |
All columns listed below will be returned, but some will be \code{NA}, |
| 39 |
depending on the type of model estimated. \code{sigma}, \code{r.squared}, |
| 40 |
\code{adj.r.squared}, and \code{within.r.squared} will be NA for any model other than |
| 41 |
\code{feols}. \code{pseudo.r.squared} will be NA for \code{feols}. |
| 42 |
} |
| 43 |
\examples{ |
| 44 |
\dontshow{if (rlang::is_installed("fixest") & !broom:::is_cran_check()) withAutoprint(\{ # examplesIf} |
| 45 |
|
| 46 |
# load libraries for models and data |
| 47 |
library(fixest) |
| 48 |
|
| 49 |
gravity <- |
| 50 |
feols( |
| 51 |
log(Euros) ~ log(dist_km) | Origin + Destination + Product + Year, trade |
| 52 |
) |
| 53 |
|
| 54 |
tidy(gravity) |
| 55 |
glance(gravity) |
| 56 |
augment(gravity, trade) |
| 57 |
|
| 58 |
# to get robust or clustered SEs, users can either: |
| 59 |
|
| 60 |
# 1) specify the arguments directly in the `tidy()` call |
| 61 |
|
| 62 |
tidy(gravity, conf.int = TRUE, cluster = c("Product", "Year")) |
| 63 |
|
| 64 |
tidy(gravity, conf.int = TRUE, se = "threeway") |
| 65 |
|
| 66 |
# 2) or, feed tidy() a summary.fixest object that has already accepted |
| 67 |
# these arguments |
| 68 |
|
| 69 |
gravity_summ <- summary(gravity, cluster = c("Product", "Year")) |
| 70 |
|
| 71 |
tidy(gravity_summ, conf.int = TRUE) |
| 72 |
|
| 73 |
# approach (1) is preferred. |
| 74 |
\dontshow{\}) # examplesIf} |
| 75 |
} |
| 76 |
\value{ |
| 77 |
A \code{\link[tibble:tibble]{tibble::tibble()}} with exactly one row and columns: |
| 78 |
\item{adj.r.squared}{Adjusted R squared statistic, which is like the R squared statistic except taking degrees of freedom into account.} |
| 79 |
\item{AIC}{Akaike's Information Criterion for the model.} |
| 80 |
\item{BIC}{Bayesian Information Criterion for the model.} |
| 81 |
\item{logLik}{The log-likelihood of the model. [stats::logLik()] may be a useful reference.} |
| 82 |
\item{nobs}{Number of observations used.} |
| 83 |
\item{pseudo.r.squared}{Like the R squared statistic, but for situations when the R squared statistic isn't defined.} |
| 84 |
\item{r.squared}{R squared statistic, or the percent of variation explained by the model. Also known as the coefficient of determination.} |
| 85 |
\item{sigma}{Estimated standard error of the residuals.} |
| 86 |
\item{within.r.squared}{R squared within fixed-effect groups.} |
| 87 |
|
| 88 |
} |