Hello
I am trying to run a model where the number of observations is less than
the number of predictors. When I've tried to run the regsubsets on a dummy
dataset of random normally distributed numbers it gives me an error
whenever I set n to be less than p. For instance, when number of
observations=150, number of predictors=151.
My code is as following:
a<-regsubsets
(X,Y,nbest=1,nvmax=5,really.big=T,method="exhaustive",intercept=FALSE)
X is a matrix of 150 rows and 151 columns. Y is a vector of 150 rows
It gives a following error:
Reordering variables and trying again:
Error in if (any(index[force.out] == -1)) stop("Can't force the same
variable in and out") :
missing value where TRUE/FALSE needed
I am new to R and would appreciate your help. Is it possible to run all
subsets selection search when n<p or I am doing something wrong in my code?
Thank you
--
Best regards,
Varvara
--
View this message in context:
http://r.789695.n4.nabble.com/Regsubsets-n-p-tp4684438.html
Sent from the R help mailing list archive at Nabble.com.
[[alternative HTML version deleted]]