[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
Kit Baum <kitbaum@mac.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: Re: if vs if |

Date |
Sat, 17 Apr 2004 11:30:43 -0400 |

On Apr 17, 2004, at 2:33 AM, Renzo wrote:

I would like to do the following thingYou are confusing the 'if' that may appear as a component of many Stata commands, e.g. summarize income if sex==1, and the programmer's 'if'. Furthermore, since each observation of var2 may take on a different value, what does it mean to generate one macro with value equalling the first observation of var1 in this context? Do you mean if any observation of var2 takes on 'value'? Or if all observations of var2 are equal to 'value'?

. local macroname = var1 if var2==value

This is not legal syntax though. I looked on [U] and [P] to see if there

were any extended macro function to help me but I did not find any.

Your workaround looks only at the first observation of var2. Is that what you really mean? Please clarify.

Kit

*

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

- Prev by Date:
**st: Re: How do I do -local macroname = var1 if var2==value** - Next by Date:
**re: st: simple (?) graph question** - Previous by thread:
**st: Re: How do I do -local macroname = var1 if var2==value** - Next by thread:
**More on passing one value inside a variable to a local macro [was: st: How do I do -local macroname = var1 if var2==value-] and [was: st: Re: if vs if]** - Index(es):

© Copyright 1996–2015 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |