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