I’m sorry to bother the list with a rather basic question, and though I am sure it's been answered, I couldn’t find an answer on the list or in the Stata FAQs.
My data look like this:
id poor70 poor71 poor72 poor73 poor74 observns |
|-----------------------------------------------------------------------|
1. | 1 0 0 0 0 1 1 |
2. | 2 0 0 1 1 . 1 |
3. | 2 0 0 1 1 . 2 |
4. | 3 1 1 . . . 1 |
5. | 3 1 1 . . . 2 |
|-----------------------------------------------------------------------|
6. | 4 1 1 1 1 0 1 |
7. | 4 1 1 1 1 0 2 |
8. | 4 1 1 1 1 0 3 |
9. | 4 1 1 1 1 0 4 |
10. | 5 0 1 1 0 . 1 |
|-----------------------------------------------------------------------|
11. | 5 0 1 1 0 . 2 |
Thus, I have 1 observation for each person for each year she is poor. What I would like to do is tell stata to treat each observation as a separate year for those the person is poor. So for person 1, for 1974, for person 2, one for 1973, one for 1974, etc. I would do this through do loops in SAS, but I am unsure how to do so in Stata. Any help is much appreciated.
Best,
Brendan
My data look like this:
id poor70 poor71 poor72 poor73 poor74 observns |
|-----------------------------------------------------------------------|
1. | 1 0 0 0 0 1 1 |
2. | 2 0 0 1 1 . 1 |
3. | 2 0 0 1 1 . 2 |
4. | 3 1 1 . . . 1 |
5. | 3 1 1 . . . 2 |
|-----------------------------------------------------------------------|
6. | 4 1 1 1 1 0 1 |
7. | 4 1 1 1 1 0 2 |
8. | 4 1 1 1 1 0 3 |
9. | 4 1 1 1 1 0 4 |
10. | 5 0 1 1 0 . 1 |
|-----------------------------------------------------------------------|
11. | 5 0 1 1 0 . 2 |
Thus, I have 1 observation for each person for each year she is poor. What I would like to do is tell stata to treat each observation as a separate year for those the person is poor. So for person 1, for 1974, for person 2, one for 1973, one for 1974, etc. I would do this through do loops in SAS, but I am unsure how to do so in Stata. Any help is much appreciated.
Best,
Brendan
Comment