

rq(quantreg)                                 R Documentation

_Q_u_a_n_t_i_l_e _R_e_g_r_e_s_s_i_o_n

_D_e_s_c_r_i_p_t_i_o_n_:

     Perform a quantile regression on a design matrix, x, of
     explanatory variables and a vector, y, of responses.

_U_s_a_g_e_:

     rq(x, y, tau=-1, alpha=.1, dual=TRUE, int=TRUE, tol=1e-4, ci = TRUE,
              method="score", interpolate=TRUE, tcrit=TRUE, hs=TRUE)
     rq.formula(formula, data=list(), subset, na.action, tau=-1,
              alpha = 0.10000000000000001, dual = TRUE,
              tol = 0.0001, ci = TRUE, method="score", interpolate = TRUE,
              tcrit = TRUE, hs=TRUE)

_A_r_g_u_m_e_n_t_s_:

       x: vector or matrix of explanatory variables.  If  a
          matrix, each  column represents a variable and
          each row represents an observation (or case).
          This should not contain  column of  1s unless the
          argument intercept is FALSE.  The number of rows
          of x should equal the number of elements of  y,
          and there  should  be fewer columns than rows.  If
          x is missing, rq() computes the ordinary sample
          quantile(s) of y.

       y: response vector with as many observations as the
          number of rows of x.

     tau: desired quantile. If tau is missing or outside the
          range [0,1] then all the regression quantiles are
          computed and the corresponding primal and dual
          solutions are returned.

   alpha: level of significance for the confidence inter-
          vals; default is set at 10%.

    dual: return the dual solution if TRUE (default).

     int: flag for intercept; if TRUE (default) an intercept
          term is included in the regression.

     tol: tolerance parameter for rq computations.

      ci: flag for confidence interval; if TRUE (default)
          the confidence intervals are returned.

  method: if method="score" (default), ci is computed using
          regression rank score inversion; if method="spar-
          sity", ci is computed using sparsity function.

interpolate: if TRUE (default), the smoothed confidence
          intervals are returned.

   tcrit: if tcrit=T (default), a finite sample adjustment
          of the critical point is performed using Student's
          t quantile, else the standard Gaussian quantile is
          used.

      hs: logical flag to use Hall-Sheather's sparsity esti-
          mator (default); otherwise Bofinger's version is
          used.

_V_a_l_u_e_:

    coef: the estimated parameters of the tau-th conditional
          quantile function.

   resid: the estimated residuals of the tau-th conditional
          quantile function.

    dual: the dual solution (if dual=T).

       h: the index of observations in the basis.

      ci: confidence intervals (if ci=T).

_M_E_T_H_O_D_:

     The algorithm used is a modification of the Barrodale
     and Roberts algorithm for l1-regression, l1fit in S,
     and is described in detail in Koenker and d"Orey(1987).

_S_E_E _A_L_S_O_:

     trq and qrq for further details and references.

_A_u_t_h_o_r_(_s_)_:

     Roger Koenker, roger@ysidro.econ.uiuc.edu, <URL:
     http://www.econ.uiuc.edu/~roger/research/rq/rq.html>.
     Ported to R, and added rq.formula, by Kjetil Halvorsen.

_R_e_f_e_r_e_n_c_e_s_:

     [1] Koenker, R.W. and Bassett, G.W. (1978). Regression
     quantiles, Econometrica, 46, 33-50.

     [2] Koenker, R.W. and d'Orey (1987). Computing Regres-
     sion Quantiles. Applied Statistics, 36, 383-393.

     [3] Gutenbrunner, C. Jureckova, J. (1991).  Regression
     quantile and regression rank score process in the lin-
     ear model and derived statistics, Annals of Statistics,
     20, 305-330.

     [4] Koenker, R.W. and d'Orey (1994).  Remark on Alg. AS
     229: Computing Dual Regression Quantiles and Regression
     Rank Scores, Applied Statistics, 43, 410-414.

     [5] Koenker, R.W. (1994). Confidence Intervals for
     Regression Quantiles, in P. Mandl and M. Huskova
     (eds.), Asymptotic Statistics, 349-359, Springer-Ver-
     lag, New York.

_E_x_a_m_p_l_e_s_:

     data(stackloss)
     rq(stack.x, stack.loss, .5)  #the l1 estimate for the stackloss data
     rq(stack.x, stack.loss, tau=.5, ci=T, method="score")  #same as above with
             #regression rank score inversion confidence interval
     rq(stack.x, stack.loss, .25)  #the 1st quartile,
             #note that 8 of the 21 points lie exactly
             #on this plane in 4-space
     rq(stack.x, stack.loss, -1)   #this gives all of the rq solutions
     rq(y=rnorm(10), method="sparsity")      #ordinary sample quantiles
     data(Patacamaya)               # an example with formula
      z0.1 <- rq.formula(y ~ a+tipo, data=Patacamaya, na.action=na.omit, tau=0.1)
     z0.1$coef
     z0.1$ci

