Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.rqs

Visualizing sequences of quantile regressions


Description

A sequence of coefficient estimates for quantile regressions with varying tau parameters is visualized.

Usage

## S3 method for class 'rqs'
plot(x, parm = NULL, ols = TRUE,
  mfrow = NULL, mar = NULL, ylim = NULL, main = NULL, col = 1:2, lty = 1:2,
  cex = 0.5, pch = 20, type = "b", xlab = "", ylab = "", ...)

Arguments

x

an object of class "rqs" as produce by rq (with a vector of tau values).

parm

a specification of which parameters are to be plotted, either a vector of numbers or a vector of names. By default, all parameters are considered.

ols

logical. Should a line for the OLS coefficient (as estimated by lm) be added?

mfrow, mar, ylim, main

graphical parameters. Suitable defaults are chosen based on the coefficients to be visualized.

col, lty

graphical parameters. For each parameter, the first element corresponds to the rq coefficients and the second to the lm coefficients.

cex, pch, type, xlab, ylab, ...

further graphical parameters passed.

Details

The plot method for "rqs" objects visualizes the coefficients only, confidence bands can be added by using the plot method for the associated "summary.rqs" object.

Value

A matrix with all coefficients visualized is returned invisibly.

See Also

Examples

## fit Engel models (in levels) for tau = 0.1, ..., 0.9
data("engel")
fm <- rq(foodexp ~ income, data = engel, tau = 1:9/10)

## visualizations
plot(fm)
plot(fm, parm = 2, mar = c(5.1, 4.1, 2.1, 2.1), main = "", xlab = "tau", 
  ylab = "income coefficient", cex = 1, pch = 19)

quantreg

Quantile Regression

v5.85
GPL (>= 2)
Authors
Roger Koenker [cre, aut], Stephen Portnoy [ctb] (Contributions to Censored QR code), Pin Tian Ng [ctb] (Contributions to Sparse QR code), Blaise Melly [ctb] (Contributions to preprocessing code), Achim Zeileis [ctb] (Contributions to dynrq code essentially identical to his dynlm code), Philip Grosjean [ctb] (Contributions to nlrq code), Cleve Moler [ctb] (author of several linpack routines), Yousef Saad [ctb] (author of sparskit2), Victor Chernozhukov [ctb] (contributions to extreme value inference code), Ivan Fernandez-Val [ctb] (contributions to extreme value inference code), Brian D Ripley [trl, ctb] (Initial (2001) R port from S (to my everlasting shame -- how could I have been so slow to adopt R!) and for numerous other suggestions and useful advice)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.