Skip to contents

IRLS with Huber weights and MAD scale, matching MASS::rlm's default method = "M", psi = psi.huber (k = 1.345), scale.est = "MAD" path. summary() reproduces MASS:::summary.rlm's XtX standard errors.

Usage

morie_rlm(formula, data, k = 1.345, maxit = 20L, acc = 1e-04)

Arguments

formula, data

Model formula and data.

k

Huber tuning constant (default 1.345).

maxit

Max IRLS iterations.

acc

Convergence tolerance on the residual change.

Value

A morie_rlm object.

References

Venables, W. N., & Ripley, B. D. (2002). Modern Applied Statistics with S. Springer.

Examples

set.seed(3)
n <- 100; x <- rnorm(n)
y <- 2 * x + rnorm(n)
y[1:3] <- y[1:3] + 40
rob <- morie_rlm(y ~ x, data = data.frame(y, x))
rob$coefficients
#> (Intercept)           x 
#>  0.03197016  1.90163830