[RsR] choosing and plotting a model

Pep Serra jo@ep@@err@ @end|ng |rom u@b@c@t
Mon Nov 29 15:52:08 CET 2010


Dear all,

Trying to choose between different curve fittings within different 
robust models (what we would get with cftools in MATLAB, but I am 
definetly R-addicted).

Maybe it is a trivial questions:

lm1<-lmrob(y ~  x, data=a)
pl2<-lmrob(y ~   poly (x,2), data=a)
pl3<-lmrob(y ~   poly (x,3), data=a)
pl4<-lmrob(y ~   poly (x,4), data=a)
pl5<-lmrob(y ~   poly (x,5), data=a)
pl6<-lmrob(y ~   poly (x,6), data=a)

I want to choose between different models according to the best fit, but 
the problem is that there is no "best fit" in robust (or R2). How could 
I do that?

In addition, I would love to plot these models (scatterplot and than 
later add the lines to see how the models look like)

I tried, for instance:

lines (x,predict (pl2),col="red")

but I get many curves (I think) or a filled polygon. Is there any way to 
get a simple line out of the model?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: josep_serra.vcf
Type: text/x-vcard
Size: 448 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-robust/attachments/20101129/e3029d89/attachment.vcf>


More information about the R-SIG-Robust mailing list