Hello,
I have a panel and I have an event (turnover). The thing is sometimes i have this event twice and i need only to consider the first event. So when turnover=1 twice for the same id, y want to replace the second turnover to zero. In the example below, you can see turnover happens twice on id=2, once in 1930 and once in 1933. I want to change the 1933 turnover dummy to zero. This for a long panel data, so replace turnover=0 if id==2 & year==1933 would take me days. Is there a simpler way?
thanks
I have a panel and I have an event (turnover). The thing is sometimes i have this event twice and i need only to consider the first event. So when turnover=1 twice for the same id, y want to replace the second turnover to zero. In the example below, you can see turnover happens twice on id=2, once in 1930 and once in 1933. I want to change the 1933 turnover dummy to zero. This for a long panel data, so replace turnover=0 if id==2 & year==1933 would take me days. Is there a simpler way?
Code:
id year turnover 2 1926 . 2 1927 . 2 1928 0 2 1929 0 2 1930 1 2 1931 0 2 1932 0 2 1933 1 2 1934 0 2 1935 . 3 1926 . 3 1927 . 3 1928 0 3 1929 0 3 1930 0 3 1931 0 3 1932 0 3 1933 0 3 1934 0 3 1935 . 4 1926 . 4 1927 . 4 1928 0 4 1929 0 4 1930 1 4 1931 0 4 1932 0 4 1933 0 4 1934 0 4 1935 . end
Comment