Hello all,
I got a question about why these incorrect uses of the OR operator would end up with behaviors. I think because this is not a proper use, so I was not able to find any clue in the documentation. Here are the data and the incorrect codes:
Question: Why does the first code below show only cases where x = 1, but the second code prints everything?
I fully understand that this is not correct, but am curious why the different outcomes.
Thanks, and I look forward to your thoughts.
I got a question about why these incorrect uses of the OR operator would end up with behaviors. I think because this is not a proper use, so I was not able to find any clue in the documentation. Here are the data and the incorrect codes:
Code:
clear set obs 20 set seed 776 gen x = runiform() >= 0.5
Code:
. list if x == 1|0
+---+
| x |
|---|
1. | 1 |
2. | 1 |
3. | 1 |
9. | 1 |
13. | 1 |
|---|
17. | 1 |
18. | 1 |
+---+
.
. list if x == 0|1
+---+
| x |
|---|
1. | 1 |
2. | 1 |
3. | 1 |
4. | 0 |
5. | 0 |
|---|
6. | 0 |
7. | 0 |
8. | 0 |
9. | 1 |
10. | 0 |
|---|
11. | 0 |
12. | 0 |
13. | 1 |
14. | 0 |
15. | 0 |
|---|
16. | 0 |
17. | 1 |
18. | 1 |
19. | 0 |
20. | 0 |
+---+
Thanks, and I look forward to your thoughts.

Comment