Debian Codegraph @

man/tidy.rq.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/quantreg-rq.R
3 \name{tidy.rq}
4 \alias{tidy.rq}
5 \alias{rq_tidiers}
6 \alias{quantreg_tidiers}
7 \title{Tidy a(n) rq object}
8 \usage{
9 \method{tidy}{rq}(x, se.type = NULL, conf.int = FALSE, conf.level = 0.95, ...)
10 }
11 \arguments{
12 \item{x}{An \code{rq} object returned from \code{\link[quantreg:rq]{quantreg::rq()}}.}
13
14 \item{se.type}{Character specifying the method to use to calculate
15 standard errors. Passed to \code{\link[quantreg:summary.rq]{quantreg::summary.rq()}} \code{se} argument.
16 Defaults to \code{"rank"} if the sample size is less than 1000,
17 otherwise defaults to \code{"nid"}.}
18
19 \item{conf.int}{Logical indicating whether or not to include a confidence
20 interval in the tidied output. Defaults to \code{FALSE}.}
21
22 \item{conf.level}{The confidence level to use for the confidence interval
23 if \code{conf.int = TRUE}. Must be strictly greater than 0 and less than 1.
24 Defaults to 0.95, which corresponds to a 95 percent confidence interval.}
25
26 \item{...}{Additional arguments passed to \code{\link[quantreg:summary.rq]{quantreg::summary.rq()}}.}
27 }
28 \description{
29 Tidy summarizes information about the components of a model.
30 A model component might be a single term in a regression, a single
31 hypothesis, a cluster, or a class. Exactly what tidy considers to be a
32 model component varies across models but is usually self-evident.
33 If a model has several distinct types of components, you will need to
34 specify which components to return.
35 }
36 \details{
37 If \code{se.type = "rank"} confidence intervals are calculated by
38 \code{summary.rq} and \code{statistic} and \code{p.value} values are not returned.
39 When only a single predictor is included in the model,
40 no confidence intervals are calculated and the confidence limits are
41 set to NA.
42 }
43 \examples{
44 \dontshow{if (rlang::is_installed("quantreg")) withAutoprint(\{ # examplesIf}
45
46 # load modeling library and data
47 library(quantreg)
48
49 data(stackloss)
50
51 # median (l1) regression fit for the stackloss data.
52 mod1 <- rq(stack.loss ~ stack.x, .5)
53
54 # weighted sample median
55 mod2 <- rq(rnorm(50) ~ 1, weights = runif(50))
56
57 # summarize model fit with tidiers
58 tidy(mod1)
59 glance(mod1)
60 augment(mod1)
61
62 tidy(mod2)
63 glance(mod2)
64 augment(mod2)
65
66 # varying tau to generate an rqs object
67 mod3 <- rq(stack.loss ~ stack.x, tau = c(.25, .5))
68
69 tidy(mod3)
70 augment(mod3)
71
72 # glance cannot handle rqs objects like `mod3`--use a purrr
73 # `map`-based workflow instead
74 \dontshow{\}) # examplesIf}
75 }
76 \seealso{
77 \code{\link[=tidy]{tidy()}}, \code{\link[quantreg:rq]{quantreg::rq()}}
78
79 Other quantreg tidiers:
80 \code{\link{augment.nlrq}()},
81 \code{\link{augment.rq}()},
82 \code{\link{augment.rqs}()},
83 \code{\link{glance.nlrq}()},
84 \code{\link{glance.rq}()},
85 \code{\link{tidy.nlrq}()},
86 \code{\link{tidy.rqs}()}
87 }
88 \concept{quantreg tidiers}
89 \value{
90 A \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 }