Hi, my data is sorted by caseid, year and episodes. I want to find the first non zero value in variable event by caseid, year. If the data was in wide format anymatch command could have solved the purpose but since it is in long form. I am not sure how to solve it. Also I am not very acquainted of looping in stata. If anybody have any ideas about it please share. Thanks!! The format of my data is given below
caseid | year | episode | event |
1100122 | 1 | 1 | 0 |
1100122 | 1 | 2 | B |
1100122 | 2 | 1 | B |
1100122 | 2 | 2 | 0 |
1100122 | 2 | 3 | B |
Comment