Hi!

In my dataset, I have variable firm_id, year, industry_id and acquisition_dummy (=1 if an event happened in that year, 0 otherwise). I am now trying to create a dummy activity_industry that would equal to one for all firms with the same industry_id if an an acquisition occurred in the previous year in that industry. I tried the following code:

Code:
generate activity_industry = 1 if L1.acquisition_dummy == 1 (by industry_id)
After searching for answers and reaching to manual, I couldn't find what I am looking for. Any help would be appreciated. Thank you.