Hello Pep,

If NPP is the response variable (the "y" variable) and WPROB is the explanatory variable (the "x" variable), then you should have used

lmrob(NPP ~ WPROB, data=a)

Also, I recommend you use the latest version of the "robustbase" package

> install.packages('robustbase')
> library(robustbase)

There the function for a robust regression fit is called lmrob (not lmRob, which is now deprecated).

Finally, based on your plot, you might also want to consider a model incorporating log(WPROB), since the relationship does not appear to be quite linear to the naked eye.

Hope this helps.

Matias




On 10-10-19 07:32 AM, Pep Serra sat down at the computer and wrote:
   Dear RsR list members,

I somehow got stuck wth lmRob and I am sure I am missing something and I
do not know what. It is my first time using robust statistics and I have
read all your posts and pdfs recommended

I think it is likely to be a newbie question. I ploted two variables and
the pictures shows a number of outliers that I want to identify given
that the main trend between those two measurements is positive.
(although they look like a lot, it is more or less 800 points out of 6000)





I used then

robust<-lmRob(WPROB~NPP,data=a)


lmRob(formula = WPROB ~ NPP, data = a)

Coefficients:
(Intercept) NPP
499.86274538 -0.00990502

Degrees of freedom: 6002 total; 6000 residual
Residual standard error: 250.3199

1) I do not really understand the slope of the regression, why is it
negative???

then used plot.lmRob(robust) and choose for option 11 (scatter plot with
fits)



What is meant to be the x axis (WPROB) turns into the y axis.
The regression line and the confidence intervals shown have nothing to
do, of course, with the coefficients retrieved...what am I doing wrong?

Thank you in advance,

pep



_______________________________________________
R-SIG-Robust@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-robust


--
_____________________________________________________
Matias Salibian-Barrera - Department of Statistics
The University of British Columbia
Phone: (604) 822-3410 - Fax: (604) 822-6960
"The plural of anecdote is not data" (George Stigler?)

_______________________________________________
R-SIG-Robust@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-robust

Reply via email to