| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/lfe.R |
| 3 |
\name{tidy.felm} |
| 4 |
\alias{tidy.felm} |
| 5 |
\alias{felm_tidiers} |
| 6 |
\alias{lfe_tidiers} |
| 7 |
\title{Tidy a(n) felm object} |
| 8 |
\usage{ |
| 9 |
\method{tidy}{felm}( |
| 10 |
x, |
| 11 |
conf.int = FALSE, |
| 12 |
conf.level = 0.95, |
| 13 |
fe = FALSE, |
| 14 |
se.type = c("default", "iid", "robust", "cluster"), |
| 15 |
... |
| 16 |
) |
| 17 |
} |
| 18 |
\arguments{ |
| 19 |
\item{x}{A \code{felm} object returned from \code{\link[lfe:felm]{lfe::felm()}}.} |
| 20 |
|
| 21 |
\item{conf.int}{Logical indicating whether or not to include a confidence |
| 22 |
interval in the tidied output. Defaults to \code{FALSE}.} |
| 23 |
|
| 24 |
\item{conf.level}{The confidence level to use for the confidence interval |
| 25 |
if \code{conf.int = TRUE}. Must be strictly greater than 0 and less than 1. |
| 26 |
Defaults to 0.95, which corresponds to a 95 percent confidence interval.} |
| 27 |
|
| 28 |
\item{fe}{Logical indicating whether or not to include estimates of |
| 29 |
fixed effects. Defaults to \code{FALSE}.} |
| 30 |
|
| 31 |
\item{se.type}{Character indicating the type of standard errors. Defaults to |
| 32 |
using those of the underlying felm() model object, e.g. clustered errors |
| 33 |
for models that were provided a cluster specification. Users can override |
| 34 |
these defaults by specifying an appropriate alternative: "iid" (for |
| 35 |
homoskedastic errors), "robust" (for Eicker-Huber-White robust errors), or |
| 36 |
"cluster" (for clustered standard errors; if the model object supports it).} |
| 37 |
|
| 38 |
\item{...}{Additional arguments. Not used. Needed to match generic |
| 39 |
signature only. \strong{Cautionary note:} Misspelled arguments will be |
| 40 |
absorbed in \code{...}, where they will be ignored. If the misspelled |
| 41 |
argument has a default value, the default value will be used. |
| 42 |
For example, if you pass \code{conf.lvel = 0.9}, all computation will |
| 43 |
proceed using \code{conf.level = 0.95}. Two exceptions here are: |
| 44 |
\itemize{ |
| 45 |
\item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if |
| 46 |
it will be ignored. |
| 47 |
\item \code{augment()} methods will warn when supplied a \code{newdata} argument if it |
| 48 |
will be ignored. |
| 49 |
}} |
| 50 |
} |
| 51 |
\description{ |
| 52 |
Tidy summarizes information about the components of a model. |
| 53 |
A model component might be a single term in a regression, a single |
| 54 |
hypothesis, a cluster, or a class. Exactly what tidy considers to be a |
| 55 |
model component varies across models but is usually self-evident. |
| 56 |
If a model has several distinct types of components, you will need to |
| 57 |
specify which components to return. |
| 58 |
} |
| 59 |
\examples{ |
| 60 |
\dontshow{if (rlang::is_installed("lfe")) withAutoprint(\{ # examplesIf} |
| 61 |
|
| 62 |
# load libraries for models and data |
| 63 |
library(lfe) |
| 64 |
|
| 65 |
# use built-in `airquality` dataset |
| 66 |
head(airquality) |
| 67 |
|
| 68 |
# no FEs; same as lm() |
| 69 |
est0 <- felm(Ozone ~ Temp + Wind + Solar.R, airquality) |
| 70 |
|
| 71 |
# summarize model fit with tidiers |
| 72 |
tidy(est0) |
| 73 |
augment(est0) |
| 74 |
|
| 75 |
# add month fixed effects |
| 76 |
est1 <- felm(Ozone ~ Temp + Wind + Solar.R | Month, airquality) |
| 77 |
|
| 78 |
# summarize model fit with tidiers |
| 79 |
tidy(est1) |
| 80 |
tidy(est1, fe = TRUE) |
| 81 |
augment(est1) |
| 82 |
glance(est1) |
| 83 |
|
| 84 |
# the "se.type" argument can be used to switch out different standard errors |
| 85 |
# types on the fly. In turn, this can be useful exploring the effect of |
| 86 |
# different error structures on model inference. |
| 87 |
tidy(est1, se.type = "iid") |
| 88 |
tidy(est1, se.type = "robust") |
| 89 |
|
| 90 |
# add clustered SEs (also by month) |
| 91 |
est2 <- felm(Ozone ~ Temp + Wind + Solar.R | Month | 0 | Month, airquality) |
| 92 |
|
| 93 |
# summarize model fit with tidiers |
| 94 |
tidy(est2, conf.int = TRUE) |
| 95 |
tidy(est2, conf.int = TRUE, se.type = "cluster") |
| 96 |
tidy(est2, conf.int = TRUE, se.type = "robust") |
| 97 |
tidy(est2, conf.int = TRUE, se.type = "iid") |
| 98 |
\dontshow{\}) # examplesIf} |
| 99 |
} |
| 100 |
\seealso{ |
| 101 |
\code{\link[=tidy]{tidy()}}, \code{\link[lfe:felm]{lfe::felm()}} |
| 102 |
|
| 103 |
Other felm tidiers: |
| 104 |
\code{\link{augment.felm}()} |
| 105 |
} |
| 106 |
\concept{felm tidiers} |
| 107 |
\value{ |
| 108 |
A \code{\link[tibble:tibble]{tibble::tibble()}} with columns: |
| 109 |
\item{conf.high}{Upper bound on the confidence interval for the estimate.} |
| 110 |
\item{conf.low}{Lower bound on the confidence interval for the estimate.} |
| 111 |
\item{estimate}{The estimated value of the regression term.} |
| 112 |
\item{p.value}{The two-sided p-value associated with the observed statistic.} |
| 113 |
\item{statistic}{The value of a T-statistic to use in a hypothesis that the regression term is non-zero.} |
| 114 |
\item{std.error}{The standard error of the regression term.} |
| 115 |
\item{term}{The name of the regression term.} |
| 116 |
|
| 117 |
} |