Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: iteration over all possible combinations of variables


From   [email protected]
To   <[email protected]>
Subject   st: iteration over all possible combinations of variables
Date   Tue, 21 Jun 2011 17:09:14 +0200

Hi,
I would like to make a loop, where on the right-hand side of a regression would be all possible combinations of variables at hand.
For example, having a list of three independent variables a b c and a dependent variable y, the loop should run  ->
 
reg y a
reg y b
reg y c
reg y a b
reg y a c
reg y b c
reg y a b c
 
I somehow cannot get over the problem, even though it seems quite simple. I would be very grateful if anyone helped.
Thank you,
Tomas

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index