orlm {MASS} | R Documentation

## Fit Robust Linear Regression Model

### Description

Fits a robust linear regression model, using an M-estimator with Huber's psi function.

### Usage

    orlm(formula, data, weights, subset, na.action,
         model=FALSE, k=1.345, sw=1000, ...)

### Arguments

`formula` | a formula object, with the response on the left of a `~` operator, and the terms, separated by `+` operators, on the right.
`data` | an optional `data.frame` in which to interpret the variables named in the formula, or in the `subset` and the `weights` argument.
`weights` | optional weights; if supplied, the algorithm fits to minimize the sum of the weights multiplied into the squared residuals. The weights must be strictly positive.
`subset` | optional expression saying that only a subset of the rows of the data should be used in the fit.
`na.action` | a missing-data filter function, applied to the `model.frame`, after any subset argument has been used.
`model` | flag to control what is returned. If this is `TRUE`, then the model frame is returned. `X` and `y` are always returned.
`k` | The control value for Winsorizing. The default gives 95% efficiency at the normal.
`sw` | switch to Huber proposal 2 scale at iteration `sw` and beyond.
`...` | additional arguments for the fitting routines. The most likely one is `maxit`, which sets the iteration limit, by default 20.

### Details

The fit uses Huber's M-estimator, and initially uses the median absolute deviation scale estimate based on the residuals. This can be changed to Huber's proposal 2 after `sw` iterations.

Generic functions such as `print` and `summary` have methods to show the results of the fit.

### Value

an object of class `"orlm"` representing the fit, inheriting from `lm`. This has all the components of an `lm` object, plus `k,` the scale `s` and `conv` which is a vector monitoring the convergence.

### See Also

`rlm`

### Examples

    data(phones)
    attach(phones)
    res <- orlm(calls ~ year)
    print(res)

    data(stackloss)
    rlm(stack.loss ~ stack.x)