rlm                   package:MASS                   R Documentation

_R_o_b_u_s_t _F_i_t_t_i_n_g _o_f _L_i_n_e_a_r _M_o_d_e_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     Fit a linear model by robust regression using an M estimator.

_U_s_a_g_e:

     rlm(x, ...)

     ## S3 method for class 'formula':
     rlm(formula, data, weights, ..., subset, na.action = na.fail,
         method = c("M", "MM", "model.frame"),
         wt.method = c("case", "inv.var"),
         model = TRUE, x.ret = TRUE, y.ret = FALSE, contrasts = NULL)

     ## Default S3 method:
     rlm(x, y, weights, ..., w = rep(1, nrow(x)),
         init, psi = psi.huber, scale.est, k2 = 1.345,
         method = c("M", "MM"), wt.method = c("case", "inv.var"),
         maxit = 20, acc = 1e-4, test.vec = "resid")

_A_r_g_u_m_e_n_t_s:

 formula: a formula of the form 'y ~ x1 + x2 + ...'. 

    data: data frame from which variables specified in 'formula' are
          preferentially to be taken. 

 weights: prior weights for each case. 

  subset: An index vector specifying the cases to be used in fitting. 

na.action: A function to specify the action to be taken if 'NA's are
          found. The default action is for the procedure to fail. An
          alternative is 'na.omit', which leads to omission of cases
          with missing values on any required variable. 

       x: a matrix or data frame containing the explanatory variables. 

       y: the response: a vector of length the number of rows of 'x'. 

  method: currently either M-estimation or find the model frame. MM
          estimation is M-estimation with Tukey's biweight initialized
          by a specific S-estimator. See the details section. 

wt.method: are the weights case weights (giving the relative importance
          of case, so a weight of 2 means there are two of these) or
          the inverse of the variances, so a weight of two means this
          error is twice as variable? 

   model: should the model frame be returned in the object? 

   x.ret: should the model matrix be returned in the object? 

   y.ret: should the response be returned in the object? 

contrasts: optional contrast specifications: se 'lm'. 

       w: (optional) initial down-weighting for each case. 

    init: (optional) initial values for the coefficients OR a method to
          find initial values OR the result of a fit with a 'coef'
          component. Known methods are '"ls"' (the default) for an
          initial least-squares fit using weights 'w*weights', and
          '"lqs"' for an unweighted least-trimmed squares fit with 200
          samples. 

     psi: the psi function is specified by this argument. It must give
          (possibly by name) a function 'g(x, ..., deriv)' that for
          'deriv=0' returns psi(x)/x and for 'deriv=1' returns psi'(x).
          Tuning constants will be passed in via '...'. 

scale.est: method of scale estimation: re-scaled MAD of the residuals
          or Huber's proposal 2. 

      k2: tuning constant used for Huber proposal 2 scale estimation. 

   maxit: the limit on the number of IWLS iterations. 

     acc: the accuracy for the stopping criterion. 

test.vec: the stopping criterion is based on changes in this vector. 

     ...: additional arguments to be passed to 'rlm.default' or to the
          'psi' function. 

_D_e_t_a_i_l_s:

     Fitting is done by iterated re-weighted least squares (IWLS).

     Psi functions are supplied for the Huber, Hampel and Tukey
     bisquare proposals as 'psi.huber', 'psi.hampel' and
     'psi.bisquare'. Huber's corresponds to a convex optimization
     problem and gives a unique solution (up to collinearity). The
     other two will have multiple local minima, and a good starting
     point is desirable.

     Selecting 'method = "MM"' selects a specific set of options which
     ensures that the estimator has a high breakdown point. The initial
     set of coefficients and the final scale are selected by an
     S-estimator with 'k0 = 1.548'; this gives (for n >> p) breakdown
     point 0.5. The final estimator is an M-estimator with Tukey's
     biweight and fixed scale that will inherit this breakdown point
     provided 'c > k0'; this is true for the default value of 'c' that
     corresponds to 95% relative efficiency at the normal.

_V_a_l_u_e:

     An object of class '"rlm"' inheriting from '"lm"'. The additional
     components not in an 'lm' object are

       s: the robust scale estimate used 

       w: the weights used in the IWLS process 

     psi: the psi function with parameters substituted 

    conv: the convergence criteria at each iteration 

converged: did the IWLS converge? 

_R_e_f_e_r_e_n_c_e_s:

     P. J. Huber (1981) _Robust Statistics_. Wiley.

     F. R. Hampel, E. M. Ronchetti, P. J. Rousseeuw and W. A. Stahel
     (1986) _Robust Statistics: The Approach based on Influence
     Functions_. Wiley.

     A. Marazzi (1993) _Algorithms, Routines and S Functions for Robust
     Statistics_. Wadsworth & Brooks/Cole.

     Venables, W. N. and Ripley, B. D. (2002) _Modern Applied
     Statistics with S._ Fourth edition.  Springer.

_S_e_e _A_l_s_o:

     'lm', 'lqs'.

_E_x_a_m_p_l_e_s:

     data(stackloss)
     summary(rlm(stack.loss ~ ., stackloss))
     rlm(stack.loss ~ ., stackloss, psi = psi.hampel, init = "lts")
     rlm(stack.loss ~ ., stackloss, psi = psi.bisquare)

