bys id: gen yes = 1 if year == 2002&2003&2004&2005&2006 --> this does not work.
I cannot proceed with reshape command, as I have 10,000 observations.
I would like variable "yes" that looks like:
| id | year | yes |
| A | 2002 | 1 |
| A | 2003 | 1 |
| A | 2004 | 1 |
| A | 2005 | 1 |
| A | 2006 | 1 |
| B | 2003 | 0 |
| B | 2005 | 0 |
Thanks.

Leave a comment: