Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
"E. Paul Wileyto" <epwileyto@verizon.net> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Stata programming question |

Date |
Wed, 17 Feb 2010 21:13:04 -0500 |

Try this: foreach x of varlist [list of variables] { logistic `x' [predictor vars] predict p_`x' } Data Analytics Corp. wrote:

Hi,I have a simple programming problem, and since I'm not familiar withStata programming I need some help.I have to do 44 logit regressions and predictions where the only thingthat changes from regression to regression is the dependent variable.Each regression uses a subset of the data. At the end of eachregression, I predict the dependent variable for the remaining portionof the data, saving the prediction as p_dependentVariableName. I'dlike to create a loop where the dependent variable will change in eachpass through the loop and that variable name will be attached to p_for the prediction.How can I do this? Any help is appreciated. Thanks, Walt

* * 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/

**References**:**st: Stata programming question***From:*"Data Analytics Corp." <walt@dataanalyticscorp.com>

- Prev by Date:
**st: macro data 4 stata** - Next by Date:
**st: st: AW: using desmat svy reg with dependent variable _x_1 ?** - Previous by thread:
**st: RE: Stata programming question** - Next by thread:
**st: How do I execute the "intreg" command succcessfully?** - Index(es):