What is the difference between lm() and rlm()?

I just found "Robust Fitting of Linear Models" rlm() function in the MASS library.

I would like to know the difference between this function and the standard linear regression function, lm().

Could someone give me a short explanation?

migrated from stackoverflow.comAug 1 '11 at 8:28

This question came from our site for professional and enthusiast programmers.

3 Answers

It (rlm) is for robust linear models. It is describe in Venables & Ripley. However, details of the robust calculations would not fit in a "short answer": you need to look into several papers by Ripley, Tukey, and others.

It a form of robust regression that uses M-estimators.

Check out this paper by Ripley for more information: http://www.stats.ox.ac.uk/pub/StatMeth/Robust.pdf

• You can also see bits and pieces of the discussion in the relevant book (Venables and Ripley MASS) on Google books: books.google.com/… -- if you want the whole thing you need to buy the book or find it at the library ... very briefly, robust regression downweights the effects of outliers on the analysis. – Ben Bolker Jul 31 '11 at 19:20

lm function uses Ordinary Least Squares(OLS) method for reducing the residuals. whereas rlm function uses M-estimators. OLS is very sensitive to outliers, M-estimation method is not.

Short answer:
In rlm(), points are not treated equally. The weight of each point would be adjusted in an iterative process. rlm() is less sensitive to outliers, as outliers will get reduced weight.

If you want a short answer for the math, I suggest an article provided by Johns Hopkins Bloomberg School of Public Health