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

ranks

Quantile Regression Ranks


Description

Function to compute ranks from the dual (regression rankscore) process.

Usage

ranks(v, score="wilcoxon", tau=0.5, trim = NULL)

Arguments

v

object of class "rq.process" generated by rq()

score

The score function desired. Currently implemented score functions are "wilcoxon", "normal", and "sign" which are asymptotically optimal for the logistic, Gaussian and Laplace location shift models respectively. The "normal" score function is also sometimes called van der Waerden scores. Also implemented are the "tau" which generalizes sign scores to an arbitrary quantile, "interquartile" which is appropriate for tests of scale shift, normalscale for Gaussian scale shift, halfnormalscale for Gaussian scale shift only to the right of the median, and lehmann for Lehmann local alternatives. See Koenker (2010) for further details on the last three of these scores.

tau

the optional value of tau if the "tau" score function is used.

trim

optional trimming proportion parameter(s) – only applicable for the Wilcoxon score function – when one value is provided there is symmetric trimming of the score integral to the interval (trim, 1-trim), when there are two values provided, then the trimming restricts the integration to (trim[1], trim[2]).

Details

See GJKP(1993) for further details.

Value

The function returns two components. One is the ranks, the other is a scale factor which is the L_2 norm of the score function. All score functions should be normalized to have mean zero.

References

Gutenbrunner, C., J. Jureckova, Koenker, R. and Portnoy, S. (1993) Tests of linear hypotheses based on regression rank scores, Journal of Nonparametric Statistics, (2), 307–331.

Koenker, R. Rank Tests for Heterogeneous Treatment Effects with Covariates, preprint.

See Also

Examples

data(stackloss)
ranks(rq(stack.loss ~ stack.x, tau=-1))

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.