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