Error in leaps.setup

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error in leaps.setup

thedoctor81877
Hullo,
I am trying to use the leaps package, & keep getting the following error:
Error in leaps.setup(x, y, wt = wt, nbest = nbest, nvmax = NCOL(x) + int,  :
  y and x different lengths

My data set is attached below.
I am rather new to R, & would appreciate any help that could be given.

Thanks.

lr04.txt
Reply | Threaded
Open this post in threaded view
|

Re: Error in leaps.setup

Thomas Lumley
On Wed, 7 Apr 2010, thedoctor81877 wrote:

>
> Hullo,
> I am trying to use the leaps package, & keep getting the following error:
> Error in leaps.setup(x, y, wt = wt, nbest = nbest, nvmax = NCOL(x) + int,  :
>  y and x different lengths

x might be a data frame rather than a matrix.

In any case, although you don't say, my psychic debugging powers tell me that you are using the leaps() function from the package.  Use regsubsets() instead. As the help page indicates, leaps() is just there for compatibility with S-PLUS.

> My data set is attached below.

No, it isn't.  It may have been stripped off by the mailing list.

     -thomas

Thomas Lumley Assoc. Professor, Biostatistics
[hidden email] University of Washington, Seattle

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.