[RsR] Translating .R file that uses MASS to robustbase and a question of weights when doing predicted values

Matias Salibian-Barrera m@t|@@ @end|ng |rom @t@t@ubc@c@
Thu Sep 6 23:54:16 CEST 2018


Hello Brenton,

Yes, lmrob() from robustbase can be expected to provide a better 
estimator, at least in the sense that the initial estimator used to 
solve the M-estimating equations is better.

You should be able to replace every call to rlm() with lmrob() pretty 
much asthey are, making sure you use method="MM", and you remove all 
other rlm-specific arguments. For example:

instead of
modelRF <- rlm(calls ~ year, maxit=50, data=phones, psi=psi.huber)

you can use
modelRF <- lmrob(calls ~ year, data=phones, method="MM")

all subsequent calls to summary, abline, etc. should work pretty much as 
they are.

Hope this helps.

Matias


On 2018-09-04 8:13 PM, Brenton Clarke wrote:
>
> Hi,
>
>      I have two questions.  The first one is in using the MASS library 
> I get a warning
>
> when I ask for predicted values…I’ve seen somewhere a suggestion that 
> one should
>
> use “weights = 1/hhat” …….can someone explain to me which weights I 
> should use?
>
> Secondly,  I am teaching this in an applied statistics course…but 
> using the library MASS.
>
> I am wondering if I should use robustbase and lmrob
>
> Can someone give me the code using lmrob that would do the same analysis
>
> as the attached file?
>
> I’m hoping this is not too onerous.
>
> Cheers,
>
> Brenton
>
> Dr Brenton R Clarke,
>
> Senior Lecturer in Mathematics and Statistics,
>
> School of Engineering and Information Technology,
>
> Murdoch University,
>
> Murdoch, WA 6150,
>
> Australia
>
> Tel +61 (0)8 93602578
>
>
>
> _______________________________________________
> R-SIG-Robust using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-robust

-- 
______________________________________________________________
Matias Salibian-Barrera - Professor
Department of Statistics - The University of British Columbia
matias using stat.ubc.ca | +1 (604) 822-3410



	[[alternative HTML version deleted]]




More information about the R-SIG-Robust mailing list