[R] query on lqs

Prof Brian D Ripley ripley at stats.ox.ac.uk
Sat Mar 2 09:05:48 CET 2002

On Sat, 2 Mar 2002 markhall at gol.com wrote:

> Is there a way of getting a list of indices or something indicating which set
> of points lqs when doing a regression?  The $bestone, seems to return only
> 2 pts. no matter how good or bad the fit.  I checked the archive for the past
> few months, but didn't find anything.

That is what bestone does return.   It's on my agenda to document the lqs
return values, but I started with the commoner ones like lm!  In any case,
you have the code to read.

For example

     (fit <- lqs(stack.loss ~ ., data = stackloss))

> fit$bestone
[1]  7 10 11 15

That is the list of points used for the best fit found.  It always tries
subsets of size p.

lm (stack.loss ~ ., data = stackloss, subset = fit$bestone)

is slightly different: see the lqs help page for why.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list