Debian Codegraph @

man/tidy.coeftest.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/lmtest.R
3 \name{tidy.coeftest}
4 \alias{tidy.coeftest}
5 \alias{lmtest_tidiers}
6 \alias{coeftest_tidiers}
7 \title{Tidy a(n) coeftest object}
8 \usage{
9 \method{tidy}{coeftest}(x, conf.int = FALSE, conf.level = 0.95, ...)
10 }
11 \arguments{
12 \item{x}{A \code{coeftest} object returned from \code{\link[lmtest:coeftest]{lmtest::coeftest()}}.}
13
14 \item{conf.int}{Logical indicating whether or not to include a confidence
15 interval in the tidied output. Defaults to \code{FALSE}.}
16
17 \item{conf.level}{The confidence level to use for the confidence interval
18 if \code{conf.int = TRUE}. Must be strictly greater than 0 and less than 1.
19 Defaults to 0.95, which corresponds to a 95 percent confidence interval.}
20
21 \item{...}{Additional arguments. Not used. Needed to match generic
22 signature only. \strong{Cautionary note:} Misspelled arguments will be
23 absorbed in \code{...}, where they will be ignored. If the misspelled
24 argument has a default value, the default value will be used.
25 For example, if you pass \code{conf.lvel = 0.9}, all computation will
26 proceed using \code{conf.level = 0.95}. Two exceptions here are:
27 \itemize{
28 \item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if
29 it will be ignored.
30 \item \code{augment()} methods will warn when supplied a \code{newdata} argument if it
31 will be ignored.
32 }}
33 }
34 \description{
35 Tidy summarizes information about the components of a model.
36 A model component might be a single term in a regression, a single
37 hypothesis, a cluster, or a class. Exactly what tidy considers to be a
38 model component varies across models but is usually self-evident.
39 If a model has several distinct types of components, you will need to
40 specify which components to return.
41 }
42 \examples{
43 \dontshow{if (rlang::is_installed("lmtest")) withAutoprint(\{ # examplesIf}
44
45 # load libraries for models and data
46 library(lmtest)
47
48 m <- lm(dist ~ speed, data = cars)
49
50 coeftest(m)
51 tidy(coeftest(m))
52 tidy(coeftest(m, conf.int = TRUE))
53
54 # a very common workflow is to combine lmtest::coeftest with alternate
55 # variance-covariance matrices via the sandwich package. The lmtest
56 # tidiers support this workflow too, enabling you to adjust the standard
57 # errors of your tidied models on the fly.
58 library(sandwich)
59
60 # "HC3" (default) robust SEs
61 tidy(coeftest(m, vcov = vcovHC))
62
63 # "HC2" robust SEs
64 tidy(coeftest(m, vcov = vcovHC, type = "HC2"))
65
66 # N-W HAC robust SEs
67 tidy(coeftest(m, vcov = NeweyWest))
68
69 # the columns of the returned tibble for glance.coeftest() will vary
70 # depending on whether the coeftest object retains the underlying model.
71 # Users can control this with the "save = TRUE" argument of coeftest().
72 glance(coeftest(m))
73 glance(coeftest(m, save = TRUE))
74 \dontshow{\}) # examplesIf}
75 }
76 \seealso{
77 \code{\link[=tidy]{tidy()}}, \code{\link[lmtest:coeftest]{lmtest::coeftest()}}
78 }
79 \concept{coeftest tidiers}
80 \value{
81 A \code{\link[tibble:tibble]{tibble::tibble()}} with columns:
82 \item{conf.high}{Upper bound on the confidence interval for the estimate.}
83 \item{conf.low}{Lower bound on the confidence interval for the estimate.}
84 \item{estimate}{The estimated value of the regression term.}
85 \item{p.value}{The two-sided p-value associated with the observed statistic.}
86 \item{statistic}{The value of a T-statistic to use in a hypothesis that the regression term is non-zero.}
87 \item{std.error}{The standard error of the regression term.}
88 \item{term}{The name of the regression term.}
89
90 }