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)
0 Response to Creating dummy variable based on another dummy variable within a group (panel data)
Post a Comment