I have panel data and I'm trying to create an indexed column (here ET) based on the first occurrence in an adjacent column (E). The data looks like the following:
FirmID CountryID YEAR F_RD C_RD T E ET
1 1 1995 1896209.822 1785573897 1 0 0
1 1 1996 1362147.818 1785573897 2 0 0
1 1 1997 2104438.406 1785573897 3 1 0
1 1 1998 1836605.362 1785573897 4 1 1
1 1 1999 1404572.073 1785573897 5 1 2
1 1 2000 1264150.002 1785573897 6 1 3
1 1 2001 2090266.546 1785573897 7 1 4
I've tried code in in stata manual: https://www.stata.com/support/faqs/d...t-occurrences/
but can't seem to figure out indexing to get ET column. Any help would be appreciated.