Bookmark and Share

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

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

st: foreach command

From   Caliph Omar Moumin <>
To   "" <>
Subject   st: foreach command
Date   Tue, 22 May 2012 09:13:46 -0700 (PDT)

Hello every one.
I wanted to regress a data with many categories so i used this command
 by subchapter2, sort: xtreg cost duration sex agegroup group, re robust
the problem is this command does not accept xi: command to change the var 'agegroup' into dummy variable
then i try to use foreach command, and i appplied it like this
 foreach subchapter2_value in 1 2 3 4 5 6 7 8 9 10 11 {
xi: xtreg cost duration sex i.agegroup group if subchapter2== `subchapter2_value', re robust
Now the problem is i cannot see the label name in the later case
Does anyone knows how to add the label name with each regression when using foreach command?
I would appreciate if you could help
Kind Regards,


*   For searches and help try:

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