Ziad wrote:
Hi again
i created new variable for weight, called weightcat and wants to replace is
as replace weightcat = 1 if weight <= 90 or weight >= 80
STATA gives 'invalid or', any kind tips about how to make such condition?
Thank you in advance and best regards
ziad
*
* 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/
Dear Ziad,
provided that I have understood your thread correctly, I tried successfully
what follows (please, see the example below):
-----------------------begin example----------------------------------------
clear
set obs 100
gen weightcat=70 in 1/20
replace weightcat=80 in 21/40
replace weightcat=85 in 41/50
replace weightcat=65 in 51/100
count if weightcat<= 90
count if weightcat >= 80
replace weightcat = 1 if weightcat <= 90 | weightcat >= 80
-----------------------end example----------------------------------------
Hope this helps and Kind Regards,
Carlo
*
* 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/