[R] Problem with leaps (long)

Thomas Lumley tlumley at u.washington.edu
Thu Sep 12 16:58:52 CEST 2002


On Wed, 11 Sep 2002, F. Tusell wrote:

> On looking at object "mods", I see that indeed mods$Cp is full of NaNs.
>
> Exactly the same file worked last year. What is more strange, if I
> type or paste the commands interactively, I get plausible Cp values in
> mods$Cp. It is only in BATCH that the thing goes stray.

Strange. I'll look at this.

>
> While on the same topic, the help on line advocates the use of function
> regsubsets, which is said to improve on leaps on several ways. However,
> I see no way to select different criteria (Cp, R2, adjR2) in said
> function.

You don't need to select different criteria in fitting.  You always get
the best model(s) of each size, and within a model size the criteria are
all equivalent to the residual sum of squares.  The summary() method
computes all these criteria, so you can use whichever you like.

The leaps() function works the same way, it's just that it doesn't even
report the other criteria.  In the actual Fortran it's all just residual
sums of squares.

	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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