Dear Statalisters,
My panel data is organized by firm year industry. Below is a sample demo of my data.
Question: how do I count the number of unique firms that have event_d dummy ==1? Expected results is 3 , for firm 1001, 1002, 1006.
input firm str2 industry year event event_d
1001 A 1998 0 1
1001 A 2000 0 1
1001 A 1999 0 1
1001 A 1997 1 1
1002 A 1999 0 1
1002 A 2000 0 1
1002 A 1998 1 1
1006 B 1997 0 1
1006 B 1998 0 1
1006 B 1999 1 1
1008 C 1998 0 0
1008 C 1997 0 0
end
Thanks so much!
Rochelle
My panel data is organized by firm year industry. Below is a sample demo of my data.
Question: how do I count the number of unique firms that have event_d dummy ==1? Expected results is 3 , for firm 1001, 1002, 1006.
input firm str2 industry year event event_d
1001 A 1998 0 1
1001 A 2000 0 1
1001 A 1999 0 1
1001 A 1997 1 1
1002 A 1999 0 1
1002 A 2000 0 1
1002 A 1998 1 1
1006 B 1997 0 1
1006 B 1998 0 1
1006 B 1999 1 1
1008 C 1998 0 0
1008 C 1997 0 0
end
Thanks so much!
Rochelle
Comment