[R] Problem with leaps (long)

F. Tusell etptupaf at bs.ehu.es
Fri Sep 13 08:03:47 CEST 2002


>  Date: Thu, 12 Sep 2002 07:58:52 -0700 (PDT)
>  From: Thomas Lumley <tlumley at u.washington.edu>
>  cc: r-help at stat.math.ethz.ch
>  
>  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
>  
   Thank  you very much.  Yes, within  a model  size all  criteria are
   equivalent  to RSS,  so for  all-subsets regression  this is  a non
   issue.  I  was rather thinking  in the stepwise algorithms  that do
   not compute all  models, but rather perform a  greedy search (and I
   understand regsubsets with  method="forward" or "backward" would do
   some of this).

   In that  case, the search  needs some criterion (in  some packages,
   one can  set an  F-to-enter or F-to-remove  value to decide  when a
   variable is worth adding or removing). I thought perhaps some other
   criterion like Cp might be used in regsubsets, hence my question.

   Perhaps  I  am  misunderstanding  something. Your  corrections  are
   welcomed, or else I will try  to understand the source and see what
   is being done.

   Best, ft.

-- 
Fernando TUSELL                                e-mail:
Departamento de Econometría y Estadística           etptupaf at bs.ehu.es 
Facultad de CC.EE. y Empresariales             Tel:   (+34)94.601.3733
Avenida Lendakari Aguirre, 83                  Fax:   (+34)94.601.3754
E-48015 BILBAO  (Spain)                        Secr:  (+34)94.601.3740
PGP: finger etptupaf at bsdx01.bs.ehu.es          http://etdx01.bs.ehu.es
----------------------------------------------------------------------


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