Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: iteration over all possible combinations of variables


From   Tomas.Konecny@cnb.cz
To   <statalist@hsphsun2.harvard.edu>
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index