Dear Statalisters,
I want to perform regressions on subsets of the data, and therefore I want to loop over all unique (numerical) values of this variable. However, using foreach or forvalues only results in a loop over the variable name!
foreach x in strata_id {
regress y x1 x2 if strata_id == `x'
}
Now the regression is performed if strata_id == "strata_id".
Any help would be appreciated!
Cheers, Peter
--
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games!
http://games.entertainment.web.de/de/entertainment/games/free
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/