Hi,
List , i have 6 predictor variables and i want to make possible combinations
of these 6 predictors ,all the data is in matrix form ,
if i am having 6 predictors than possible combination of sets are 64 2 power 6,
or 63 ,whatever it may be i want to store the result in another variable to
Hi,
List , i have 6 predictor variables and i want to make possible combinations
of these 6 predictors ,all the data is in matrix form ,
if i am having 6 predictors than possible combination of sets are 64 2 power 6,
or 63 ,whatever it may be i want to store the result in another variable to
You don't say what model you want to do. It isn't necessary to store
each combination of predictors in a separate matrix unless you really
need to do this for some other reason, in which case I imagine you
could adopt this idea. I dare say there are better ways, but this
should work (assuming you
You might find the following code useful. It's part of a package I'm
developing for interactive model exploration.
Hadley
# Generate all models
# Fit all combinations of x variables ($2^p$)
#
# This technique generalises \code{\link{fitbest}}. While it is much
# slower it will work for any