I'm not sure why the "condition" function is not coding z with 2 missing
values. If I'm reading the functions command correctly, z should be
coded as missing:
cond(a>2,"this","that","missing") = "missing" if a > .
cond(a>2,"this","that","missing") = "this" if a > 2 and a < .
Any ideas?
Thanks.
. gen z=cond(x>5,1,0,.)
. list
+-------+
| x z |
|-------|
1. | 1 0 |
2. | 2 0 |
3. | 3 0 |
4. | 4 0 |
5. | 5 0 |
|-------|
6. | 6 1 |
7. | 7 1 |
8. | 8 1 |
9. | . 1 |
10. | . 1 |
+-------+
______________________________________
Paul F. Visintainer, PhD
*
* 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/