[R] lmRobMM vs rlm
daniel schubert
schubert at prodigal.murdoch.edu.au
Tue Apr 27 10:55:18 CEST 2004
I am needing some expertise with regard
to the S-Plus command lmRobMM and its R counterpart
rlm(formula,data,method="MM")
I have used lmRobMM(formula,data) in S-Plus on the Stackloss data and
obtained for my residuals
6.217777 1.150717 6.427946 8.174019 -0.6713005 -1.248641 -0.4236203
0.5763797 -1.057899 0.3593823
11 12 13 14 15 16 17
18 19 20
0.9629239 0.4732042 -2.506497 -1.346176 1.344408 0.1432279 -0.3729551
0.09646618 0.5861859 1.934193
21
-8.629863
(Intercept) V1 V2 V3
-37.65246 0.7976856 0.5773405 -0.06706018
but when I use rlm(formula,data,method="MM") in R my residuals are
1 2 3 4 5 6
2.82002948 -2.29288550 3.78605126 7.23168396 -1.60941126 -2.18886365
7 8 9 10 11 12
-1.09082616 -0.09082616 -1.43350203 -0.32664493 0.68958988 0.15612729
13 14 15 16 17 18
-3.10081497 -1.43820259 2.20031311 0.86156818 -0.29869392 0.49171093
19 20 21
1.02517352 1.61796106 -10.50956979
(Intercept) VAR00001 VAR00002 VAR00003
-41.5230433 0.9388404 0.5794524 -0.1129150
I am very worried by this discrepancy what have I done wrong?
I read in R:Robust Fitting of Linear Models: MM estimation is M-Estimation
with Tukey's biweight initialized by a specific S-estimator
and so I alter my S-Plus code to
ct<-lmRobMM.robust.control(weight=c("Optimal","Bisquare"))
fit<-lmRobMM(formula=V4~V1+V2+V3,data=data, robust.control=ct)
and obtain for my residuals
1 2 3 4 5 6 7
8 9 10 11 12 13 14
6.132346 1.061665 6.342018 8.212728 -0.7022119 -1.244742 -0.3631877
0.6368123 -1.001597 0.2162886 0.8524152 0.3242646 -2.64235 -1.407392
15 16 17 18 19 20 21
1.338706 0.1266635 -0.4053969 0.08936822 0.6175189 1.894162 -8.820719
(Intercept) V1 V2 V3
-37.35298 0.8107863 0.5425301 -0.07068073
then I try
ct<-lmRobMM.robust.control(weight=c("Bisquare","Bisquare"))
fit<-lmRobMM(formula=V4~V1+V2+V3,data=data, robust.control=ct)
and obtain
1 2 3 4 5 6 7 8
9 10 11 12 13 14
5.954287 0.880977 6.206231 8.16344 -0.7473658 -1.291963 -0.3966992
0.6033008 -1.020411 0.1894031 0.8491936 0.3204805 -2.663977 -1.402163
15 16 17 18 19 20 21
1.392297 0.1723669 -0.3985709 0.1145995 0.6433127 1.882605 -8.908035
(Intercept) V1 V2 V3
-37.56484 0.8178879 0.5445969 -0.07331006
no matter what I try I cannot reproduce my R-fit?
thank you for the time you spend with this query
cheers
Daniel
More information about the R-help
mailing list