On Nov 12, 2011, at 6:52 PM, Phil Schumm wrote:
> On Nov 12, 2011, at 5:08 PM, Daifeng He wrote:
>> . local state & st=="CA"
>
> Note that for what you're doing, you're better off creating an indicator variable, and then using that to restrict your sample (as opposed to trying to store part of a command string in a local macro). For example:
>
> mark ca if state & st == "CA"
> reg depvar [indepvars] if ca
Sorry, I misread what you had written. The equivalent would instead be
mark ca if st == "CA"
I would still assert, however, that you are better off using indicator variables in this case, especially when you are working with the intersection of several conditions (which you may express by combining them with "&" or simply multiplying them together).
-- Phil
*
* 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/