Der Stata list,
I need to separate IDs of a panel dataset for subsample analysis based on values they have for a perticular variable ( say for an example you want to seperate goods based on price increases and decreases).
An example of what I need is below. (
I need to separate IDs of a panel dataset for subsample analysis based on values they have for a perticular variable ( say for an example you want to seperate goods based on price increases and decreases).
An example of what I need is below. (
| Year | ID | Variable | ||||||
| 1990 | 1 | 1 | ||||||
| 1990 | 2 | 23 | ||||||
| 1990 | 3 | 5 | ||||||
| 1990 | 4 | -4 | ||||||
| 1990 | 5 | 0 | ||||||
| 1990 | 6 | . | ||||||
| 1991 | 1 | 4 | ||||||
| 1991 | 2 | 6 | ||||||
| 1991 | 3 | 0 | ||||||
| 1991 | 4 | 45 | ||||||
| 1991 | 5 | 0 | ||||||
| 1991 | 6 | 0 | ||||||
| 1992 | 1 | 0 | ||||||
| 1992 | 2 | 3 | ||||||
| 1992 | 3 | -3 | ||||||
| 1992 | 4 | 0 | ||||||
| 1992 | 5 | 0 | ||||||
| 1992 | 6 | . | ||||||
| Criteria | ||||||||
| 1) see what IDs have (at least ) one positive value throughout the panel (e.g IDs 1,2,3,4) | ||||||||
| 2) see what IDs have (at least ) one negative value throughout the sample (e.g IDs 4 and 3) | ||||||||
| 3) separate (create sub samples) above 1) and 2) IDs by providing them separate identifiers (probably by creating another variable) I appreciate if you could help me |
||||||||

Comment