Hi Stata Users,
I am using Stata version 15 to calculate the number of distinct cases (firm) by a group of two variables (entity and year). For instance, for entity 1, year 2010 I would have 2 (The aim is to avoid double counting!). Below is example of dataset
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte entity int year str1 firm float value
1 2010 "A" 15
1 2010 "A"  8
1 2010 "B" 12
1 2011 "B" 25
1 2012 "B"  8
2 2010 "A"  7
2 2011 "A"  5
2 2011 "A" 12
2 2011 "C" 13
2 2012 "A" 19
2 2012 "B" 25
2 2011 "B" 14
2 2012 "C" 18
2 2012 "D" 16
end
Thanks in advance!