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: Adding regression variables one step at a time using a macro


From   sara khan <sarakhanum84@googlemail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: Adding regression variables one step at a time using a macro
Date   Wed, 10 Mar 2010 16:52:47 +0000

Dear Statalisters

Please could you advise me on how to write a macro so that I can add
regression variables one step at a time for only non-missing cases. It
is similar to a forward stepwise except that I want to choose which
variables I add.

At the moment, I am doing the following:

Model 1
reg y x1 if y<. & x1<.


Model 2 - add another var
reg y x1 x2 if y<. & x1<. &x2<.

Many thanks
*
*   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