Learn R Programming

surveyoutliers (version 0.1)

robust.lm.onesided: Robust Regression using One-Sided Huber Function

Description

This function performs robust regression using M-estimation using the one-sided Huber function, with residuals truncated at Q / (data$gregwt-1) where data$gregwt is the generalized regression weight.

Usage

robust.lm.onesided(formula, data, Q, Qname, maxit = 100, stop = F)

Arguments

formula
The regression formula (e.g. income ~ employment + old.turnover if income is survey variable and employment and old.turnover are auxiliary variables).
data
A data frame including the variables in formula, and gregwt (generalized regression estimator weight), and regwt (weight to be used in regression - will be set to 1 if missing).
Q
The tuning parameter where large Q corresponds to no outlier treatment, and small Q corresponds to many outliers being flagged.
Qname
Gives a variable name on data which contains a separate tuning parameter Q for every observation (either Q or Qname should be specified but not both).
maxit
The maximum number of iterations.
stop
Set to T to open a browser window (for debugging purposes)

Value

The final linear model fit (an object of class "lm").

Details

Uses iteratively reweighted least squares.

References

Clark, R. G. (1995), "Winsorisation methods in sample surveys," Masters thesis, Australian National University, http://hdl.handle.net/10440/1031.

Kokic, P. and Bell, P. (1994), "Optimal winsorizing cutoffs for a stratified finite population estimator," J. Off. Stat., 10, 419-435.

Examples

Run this code
robust.lm.onesided(formula=y~x1+x2,data=survdat.example,Q=250)

Run the code above in your browser using DataLab