rms (version 2.0-2)

Rq: rms Package Interface to quantreg Package

Description

The Rq function is the rms front-end to the quantreg package's rq function. print and latex methods are also provided, and a fitting function RqFit is defined for use in bootstrapping, etc. Its result is a function definition.

Usage

Rq(formula, tau = 0.5, data, subset, weights, na.action=na.delete,
   method = "br", model = FALSE, contrasts = NULL,
   se = "nid", hs = TRUE, x = FALSE, y = FALSE, ...)

## S3 method for class 'Rq': print(x, digits=4, \dots)

## S3 method for class 'Rq': latex(object, file = paste(first.word(deparse(substitute(object))), ".tex", sep = ""), append=FALSE, which, varnames, columns=65, inline=FALSE, caption=NULL, ...)

RqFit(fit, wallow=TRUE, passdots=FALSE)

Arguments

formula
model formula
tau
the single quantile to estimate. Unlike rq you cannot estimate more than one quantile at one model fitting.
data
subset
weights
na.action
method
model
contrasts
se
hs
see rq
x
set to TRUE to store the design matrix with the fit. For print is an Rq object.
y
set to TRUE to store the response vector with the fit
...
other arguments passed to one of the rq fitting routines. For latex.Rq these are optional arguments passed to latexrms. Ignored for print.Rq.
digits
number of significant digits used in formatting results in print.Rq.
object
an object created by Rq
file
append
which
varnames
columns
inline
caption
fit
an object created by Rq
wallow
set to TRUE if weights are allowed in the current context.
passdots
set to TRUE if ...may be passed to the fitter

Value

  • Rq returns a list of class "rms", "lassorq" or "scadrq", "Rq", and "rq". RqFit returns a function definition. latex.Rq returns an object of class "latex".

See Also

rq

Examples

Run this code
set.seed(1)
n     <- 30
y     <- rnorm(n)
x1    <- rnorm(n)
w     <- runif(n)
x1[2] <- NA
dd <- datadist(x1); options(datadist='dd')
f <- Rq(y ~ pol(x1,2))
anova(f)
plot(Predict(f, x1=.))

Run the code above in your browser using DataCamp Workspace