I have a data set of 7 variables and I want to run all possible combinations. What I exactly want is to run is different equations which choose different variables, for instance:
Y = b_0 + b_1*X_1 + b_2*X_2
Y = b_0 + b_1*X_1 + b_2*X_3
Y = b_0 + b_1*X_1 + b_2*X_2 + b_3*X_3
Y = b_0 + b_1*X_1 + b_2*X_2 + b_3*X_3 + b_2*X_4
Y = b_0 + b_1*X_1 + b_2*X_2 + b_2*X_4
Y = b_0 + b_1*X_1 + b_2*X_4
All possible combination in this order. How should I setup my loop function?