[R] a question regarding leaps
Rajarshi Guha
rxg218 at psu.edu
Fri Jan 30 00:43:22 CET 2004
Hi,
I'm using regsubsets from the leaps package to select subsets of
variables. I'm calling the function as
lp <- regsubsets(x,y,nbest=5,nvmax=9)
Then I call plot to see which variables turned up in the models. I use
the R^2 scale and see my best model had a R^2 of 0.62.
However when I make a linear model using lm() with the same x my R^2 is
0.45. Should'nt I be seeing the same value of R^2?
I must be making a mistake somewhere but I'm not sure where - could
anybody provide a pointer as to what I'm doing wrong?
Thanks,
-------------------------------------------------------------------
Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
If you believe in telekinesis, raise my hand.
More information about the R-help
mailing list