

trq(quantreg)                                R Documentation

_F_u_n_c_t_i_o_n _t_o _c_o_m_p_u_t_e _a_n_a_l_o_g_u_e_s _o_f _t_h_e _t_r_i_m_m_e_d _m_e_a_n _f_o_r _t_h_e
_l_i_n_e_a_r _r_e_g_r_e_s_s_i_o_n _m_o_d_e_l_.

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

     The function returns a regression trimmed mean and some
     associated test statistics.  The proportion a1 is
     trimmed from the lower tail and a2 from the upper tail.
     If a1+a2=1 then a result is returned for the a1 quan-
     tile.  If a1+a2<1 two methods of trimming are possible
     described below as "primal" and "dual". The function
     "trq.print" may be used to print results in the style
     of ls.print.

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

     trq(x, y, a1=0.1, a2,  int=TRUE, z,  method="primal", tol=1e-4)

_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.
          Missing values are not  allowed.

       y: reponse vector with as many observations as the
          number of rows of x.  Missing value are not
          allowed.

      a1: the lower trimming proportion; defaults to .1 if
          missing.

      a2: the upper trimming proportion; defaults to a1 if
          missing.

     int: flag for intercept; if TRUE, an intercept term is
          included in regression model.  The default
          includes an intercept term.

       z: structure returned by the function 'rq' with tau
          <0 or >1. If missing, the function rq(x,y,int=int)
          is automatically called to generate this argument.
          If several calls to trq are anticipated for the
          same data this avoids recomputing the rq solution
          for each call.

  method: method to be used for the trimming.  If the choice
          is "primal", as is the default, a trimmed mean of
          the primal regression quantiles  is computed based
          on the sol array in the 'rq' structure.  If the
          method is "dual", a weighted least-squares fit is
          done using the dual solution in the 'rq' structure
          to construct weights.  The former method is dis-
          cussed in detail in Koenker and Potnoy(1987) the
          latter in Ruppert and Carroll(1980) and Gutenbrun-
          ner and Jureckova(1991).

     tol: Tolerance parameter for rq computions

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

    coef: estimated coeficient vector

   resid: residuals from the fit.

     cov: the estimated covariance matrix for the coeficient
          vector.

       v: the scaling factor of the covariance matrix under
          iid error assumption: cov=v*(x'x)^(-1).

      wt: the weights used in the least squares computation,
          Returned only when method="dual".

       d: the bandwidth used to compute the sparsity func-
          tion.  Returned only when a1+a2=1.

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

     details of the methods may be found in Koenker and
     Portnoy(1987) for the case of primal trimming and in
     Gutenbrunner and Jureckova(1991) for dual trimming.  On
     the estimation of the covariance matrix for individual
     quantiles, see Koenker(1987) and the discussion in Hen-
     dricks and Koenker(1991).  The estimation of the
     covariance matrix under  non-iid conditions is an open
     research problem.

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

     rq and qrq for further details.

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

     Bassett, G., and Koenker, R. (1982), "An Empirical
     Quantile Function for Linear Models With iid Errors,"
     Journal of the American Statistical Association,

     77, 407-415.

     Koenker, R.W. (1987), "A Comparison of Asymptotic Meth-
     ods of Testing based on L1 Estimation," in Y. Dodge
     (ed.)  Statistical Data Analysis Based on the L1 norm
     and Related Methods,

     New York:  North-Holland.

     Koenker, R. W., and Bassett, G.W (1978), "Regression
     Quantiles", Econometrica,

     46, 33-50.

     Koenker, R., and Portnoy, S. (1987), "L-Estimation for
     Linear Models", Journal of the American Statistical
     Association,

     82, 851-857.

     Ruppert, D. and Carroll, R.J. (1980), "Trimmed Least
     Squares Estimation in the Linear Model", Journal of the
     American Statistical Association, 75, 828-838.

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

     x <- -10:10; y <- 0.2 * x + rt(x, df=3)
     z <- rq(x,y)        #z gets the full regression quantile structure
     trq(x,y, .05, z=z)  #5% symmetric primal trimming # Error, which also occurs in S-Plus.
     trq(x,y, .01, .03, method="dual")  #1% lower and 3% upper trimmed least-
                                        #squares fit.
     trq.print(trq(x,y)) #prints trq results in the style of ls.print.

