From | Richard Goldstein <[email protected]> |
To | [email protected] |
Subject | Re: st: Macros and dummy variables |
Date | Thu, 27 Oct 2005 08:38:34 -0400 |
Dear Statalisters,
I have the following dummies gen dummy1 = 1 if nearesthospital ==1
gen dummy2 = 1 if nearesthospital ==2
gen dummy3 = 1 if nearesthospital ==3
gen dummy4 = 1 if nearesthospital ==4
gen dummy5 = 1 if nearesthospital ==5
Etc. etc.
The number of dummies that have to be generated are up to 40 or more. I
was thus thinking of creating a local macro for generating the dummies
and avoiding typing the commands every single time. I read the macro
section on the Stata User's Guide, but unfortunately cannot see how to
apply the explanations to the above-mentioned case. Any idea?
Thank you very much,
Ilaria
* * 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/
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |