I am using rlm in the R MASS package to regress a multivariate linear model. It works well for a number of samples but I am getting quasi-null coefficients for a particular model:
Call: rlm(formula = Y ~ X1 + X2 + X3 + X4, data = mymodel, maxit = 50, na.action = na.omit)
Residuals:
Min 1Q Median 3Q Max
-7.981e+01 -6.022e-03 -1.696e-04 8.458e-03 7.706e+01
Coefficients:
Value Std. Error t value
(Intercept) 0.0002 0.0001 1.8418
X1 0.0004 0.0000 13.4478
X2 -0.0004 0.0000 -23.1100
X3 -0.0001 0.0002 -0.5511
X4 0.0006 0.0001 8.1489
Residual standard error: 0.01086 on 49052 degrees of freedom
(83 observations deleted due to missingness)
For comparison, these are the coefficients calculated by lm():
Call:
lm(formula = Y ~ X1 + X2 + X3 + X4, data = mymodel, na.action = na.omit)
Residuals:
Min 1Q Median 3Q Max
-76.784 -0.459 0.017 0.538 78.665
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.016633 0.011622 -1.431 0.152
X1 0.046897 0.004172 11.240 < 2e-16 ***
X2 -0.054944 0.002184 -25.155 < 2e-16 ***
X3 0.022627 0.019496 1.161 0.246
X4 0.051336 0.009952 5.159 2.5e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.574 on 49052 degrees of freedom
(83 observations deleted due to missingness)
Multiple R-squared: 0.0182, Adjusted R-squared: 0.01812
F-statistic: 227.3 on 4 and 49052 DF, p-value: < 2.2e-16
The lm plot doesn't show any particularly high outlier, as measured by Cook's distance:
EDIT
For reference and after confirming results based on the answer provided by Macro, the R command to set the tuning parameter, k
, in the Huber estimator is (k=100
in this case):
rlm(y ~ x, psi = psi.huber, k = 100)
rlm
weight function is throwing out almost all the observations. Are you sure it's the same Y in the two regressions? (Just checking...) Trymethod="MM"
in yourrlm
call, then try (if that fails)psi=psi.huber(k=2.5)
(2.5 is arbitrary, just bigger than the default 1.345) which spreads out thelm
-like region of the weight function. $\endgroup$ – jbowman May 31 '12 at 13:44