| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/quantreg-rq.R |
| 3 |
\name{glance.rq} |
| 4 |
\alias{glance.rq} |
| 5 |
\title{Glance at a(n) rq object} |
| 6 |
\usage{ |
| 7 |
\method{glance}{rq}(x, ...) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{x}{An \code{rq} object returned from \code{\link[quantreg:rq]{quantreg::rq()}}.} |
| 11 |
|
| 12 |
\item{...}{Additional arguments. Not used. Needed to match generic |
| 13 |
signature only. \strong{Cautionary note:} Misspelled arguments will be |
| 14 |
absorbed in \code{...}, where they will be ignored. If the misspelled |
| 15 |
argument has a default value, the default value will be used. |
| 16 |
For example, if you pass \code{conf.lvel = 0.9}, all computation will |
| 17 |
proceed using \code{conf.level = 0.95}. Two exceptions here are: |
| 18 |
\itemize{ |
| 19 |
\item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if |
| 20 |
it will be ignored. |
| 21 |
\item \code{augment()} methods will warn when supplied a \code{newdata} argument if it |
| 22 |
will be ignored. |
| 23 |
}} |
| 24 |
} |
| 25 |
\description{ |
| 26 |
Glance accepts a model object and returns a \code{\link[tibble:tibble]{tibble::tibble()}} |
| 27 |
with exactly one row of model summaries. The summaries are typically |
| 28 |
goodness of fit measures, p-values for hypothesis tests on residuals, |
| 29 |
or model convergence information. |
| 30 |
|
| 31 |
Glance never returns information from the original call to the modeling |
| 32 |
function. This includes the name of the modeling function or any |
| 33 |
arguments passed to the modeling function. |
| 34 |
|
| 35 |
Glance does not calculate summary measures. Rather, it farms out these |
| 36 |
computations to appropriate methods and gathers the results together. |
| 37 |
Sometimes a goodness of fit measure will be undefined. In these cases |
| 38 |
the measure will be reported as \code{NA}. |
| 39 |
|
| 40 |
Glance returns the same number of columns regardless of whether the |
| 41 |
model matrix is rank-deficient or not. If so, entries in columns |
| 42 |
that no longer have a well-defined value are filled in with an \code{NA} |
| 43 |
of the appropriate type. |
| 44 |
} |
| 45 |
\details{ |
| 46 |
Only models with a single \code{tau} value may be passed. |
| 47 |
For multiple values, please use a \code{\link[purrr:map]{purrr::map()}} workflow instead, e.g. |
| 48 |
|
| 49 |
\if{html}{\out{<div class="sourceCode">}}\preformatted{taus |> |
| 50 |
map(function(tau_val) rq(y ~ x, tau = tau_val)) |> |
| 51 |
map_dfr(glance) |
| 52 |
}\if{html}{\out{</div>}} |
| 53 |
} |
| 54 |
\examples{ |
| 55 |
\dontshow{if (rlang::is_installed("quantreg")) withAutoprint(\{ # examplesIf} |
| 56 |
|
| 57 |
# load modeling library and data |
| 58 |
library(quantreg) |
| 59 |
|
| 60 |
data(stackloss) |
| 61 |
|
| 62 |
# median (l1) regression fit for the stackloss data. |
| 63 |
mod1 <- rq(stack.loss ~ stack.x, .5) |
| 64 |
|
| 65 |
# weighted sample median |
| 66 |
mod2 <- rq(rnorm(50) ~ 1, weights = runif(50)) |
| 67 |
|
| 68 |
# summarize model fit with tidiers |
| 69 |
tidy(mod1) |
| 70 |
glance(mod1) |
| 71 |
augment(mod1) |
| 72 |
|
| 73 |
tidy(mod2) |
| 74 |
glance(mod2) |
| 75 |
augment(mod2) |
| 76 |
|
| 77 |
# varying tau to generate an rqs object |
| 78 |
mod3 <- rq(stack.loss ~ stack.x, tau = c(.25, .5)) |
| 79 |
|
| 80 |
tidy(mod3) |
| 81 |
augment(mod3) |
| 82 |
|
| 83 |
# glance cannot handle rqs objects like `mod3`--use a purrr |
| 84 |
# `map`-based workflow instead |
| 85 |
\dontshow{\}) # examplesIf} |
| 86 |
} |
| 87 |
\seealso{ |
| 88 |
\code{\link[=glance]{glance()}}, \code{\link[quantreg:rq]{quantreg::rq()}} |
| 89 |
|
| 90 |
Other quantreg tidiers: |
| 91 |
\code{\link{augment.nlrq}()}, |
| 92 |
\code{\link{augment.rq}()}, |
| 93 |
\code{\link{augment.rqs}()}, |
| 94 |
\code{\link{glance.nlrq}()}, |
| 95 |
\code{\link{tidy.nlrq}()}, |
| 96 |
\code{\link{tidy.rq}()}, |
| 97 |
\code{\link{tidy.rqs}()} |
| 98 |
} |
| 99 |
\concept{quantreg tidiers} |
| 100 |
\value{ |
| 101 |
A \code{\link[tibble:tibble]{tibble::tibble()}} with exactly one row and columns: |
| 102 |
\item{AIC}{Akaike's Information Criterion for the model.} |
| 103 |
\item{BIC}{Bayesian Information Criterion for the model.} |
| 104 |
\item{df.residual}{Residual degrees of freedom.} |
| 105 |
\item{logLik}{The log-likelihood of the model. [stats::logLik()] may be a useful reference.} |
| 106 |
\item{tau}{Quantile.} |
| 107 |
|
| 108 |
} |