Hello all! I've been trying to determine the best way to generate a flag when a mass layoff happens at the firm level. In the example below, I have firm level data for the years 1990-1996, with employment totals at each firm. I also have information on if a firm changes its identifier to a new one (or multiple new ones) captured as firm_succ*. I'd like some advice on the best way to check how many employees transition to the new successor firms to verify if there was an event. To do this, I need the total employment at the new firms. What is the best way to calculate total employment transitioned to the new firm identifiers? I'd like to generate something like emp_firm_succ that shows the employment in the following year at the new firm_succ*.
Thanks!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str1 firmid float(year emp) str1(firm_succ1 firm_succ2) "1" 1990 50 "." "." "1" 1991 49 "." "." "1" 1992 52 "." "." "1" 1993 51 "2" "." "1" 1994 . "." "." "1" 1995 . "." "." "1" 1996 . "." "." "2" 1994 30 "." "." "2" 1995 31 "." "." "2" 1996 30 "." "." "3" 1990 100 "." "." "3" 1991 105 "." "." "3" 1992 104 "4" "5" "3" 1993 . "." "." "3" 1994 . "." "." "3" 1995 . "." "." "3" 1996 . "." "." "4" 1993 51 "." "." "4" 1994 50 "." "." "4" 1995 51 "." "." "4" 1996 51 "." "." "5" 1993 52 "." "." "5" 1994 52 "." "." "5" 1995 52 "." "." "5" 1996 52 "." "." end
Comment