Statalist


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

st: replace var with if range condition


From   "Ziad El-Khatib" <[email protected]>
To   [email protected]
Subject   st: replace var with if range condition
Date   Wed, 22 Aug 2007 09:23:53 -0700

Dear StataLister,
Any tips how to write condition replace to make condition in case of range?
Example:
variable name is age

gen age1 = 0
replace age1 = 1 if age is between 20 and 24  ?


Thank you in advance and best regards
ziad
















-- 
Ziad El-Khatib
AIDS Unit
National Institute for Communicable Diseases (NICD)
1 Modderfontein Road
Private Bag X4, Sandringham, 2131
Johannesburg, South Africa

Division of International Health (IHCAR)
Karolinska Institutet
Stockholm, Sweden
www.phs.ki.se/ihcar
*
*   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