Dear members
I have an unbalanced dataset spanning from 2005 to 2020 to assess the effect of a policy mandate on a firm's outcome. The policy mandate is effective in some countries from the sample beginning period (2005) so firms in these countries should be coded as "treated". In another country, the mandate becomes effective during the sample period so firms in these countries should be coded as "newly treated" and firms located in countries that never have the mandate should be coded as zero. I already have the treaedfirm indicator equal to one if the firm operates in a country with a mandate and zero otherwise. However, I need to be able to identify the number of distinct firms that are treated through the sample period (2005-2020) the newly treated firms, and the control distinct firms that have never been treated. I further need to be able to graph them where on the Y-axis it shows the number of observations, and on the x-axis, it shows the type of the firm treatment. I greatly appreciate your help in advance. Here is an example of my dataset:
input str44 Country int Year float(policy_in_effect treatedfirm firm_id)
"United Arab Emirates" 2017 0 0 1
"United Arab Emirates" 2019 0 0 1
"United Arab Emirates" 2018 0 0 1
"United Arab Emirates" 2016 0 0 2
"United Arab Emirates" 2018 0 0 2
"United Arab Emirates" 2015 0 0 2
"United Arab Emirates" 2014 0 0 2
"United Arab Emirates" 2013 0 0 2
"United Arab Emirates" 2017 0 0 2
"United Arab Emirates" 2019 0 0 2
"United States" 2014 0 0 3
"United States" 2011 0 0 3
"United States" 2009 0 0 3
"United States" 2008 0 0 3
"United States" 2010 0 0 3
"United States" 2019 0 0 3
"United States" 2012 0 0 3
"United States" 2006 0 0 3
"United States" 2018 0 0 3
"United States" 2015 0 0 3
"United States" 2005 0 0 3
"United States" 2013 0 0 3
"United States" 2017 0 0 3
"United States" 2007 0 0 3
"United States" 2016 0 0 3
"Argentina" 2015 0 0 4
"Argentina" 2016 0 0 4
"Argentina" 2018 0 0 4
"Argentina" 2017 0 0 4
"Argentina" 2014 0 0 4
"Argentina" 2019 0 0 4
"Argentina" 2020 0 0 5
"Argentina" 2015 0 0 5
"Argentina" 2019 0 0 5
"Argentina" 2017 0 0 5
"Argentina" 2016 0 0 5
"Argentina" 2018 0 0 5
"Argentina" 2019 0 0 6
"Argentina" 2018 0 0 6
"Argentina" 2017 0 0 6
"Argentina" 2016 0 0 6
"Argentina" 2015 0 0 6
"Argentina" 2017 0 0 7
"Argentina" 2015 0 0 7
"Argentina" 2019 0 0 7
"Argentina" 2014 0 0 7
"Argentina" 2016 0 0 7
"Argentina" 2018 0 0 7
"Argentina" 2013 0 0 7
"Argentina" 2010 0 0 7
"Argentina" 2018 0 0 8
"Argentina" 2019 0 0 8
"Austria" 2018 0 0 9
"Austria" 2013 0 0 9
"Austria" 2012 0 0 9
"Austria" 2011 0 0 9
"Austria" 2014 0 0 9
"Austria" 2019 0 0 9
"Austria" 2017 0 0 9
"Austria" 2015 0 0 9
"Austria" 2010 0 0 9
"Austria" 2016 0 0 9
"Austria" 2019 0 0 10
"Austria" 2020 0 0 10
"Austria" 2018 0 0 10
"Austria" 2018 0 0 11
"Austria" 2011 0 0 11
I have an unbalanced dataset spanning from 2005 to 2020 to assess the effect of a policy mandate on a firm's outcome. The policy mandate is effective in some countries from the sample beginning period (2005) so firms in these countries should be coded as "treated". In another country, the mandate becomes effective during the sample period so firms in these countries should be coded as "newly treated" and firms located in countries that never have the mandate should be coded as zero. I already have the treaedfirm indicator equal to one if the firm operates in a country with a mandate and zero otherwise. However, I need to be able to identify the number of distinct firms that are treated through the sample period (2005-2020) the newly treated firms, and the control distinct firms that have never been treated. I further need to be able to graph them where on the Y-axis it shows the number of observations, and on the x-axis, it shows the type of the firm treatment. I greatly appreciate your help in advance. Here is an example of my dataset:
input str44 Country int Year float(policy_in_effect treatedfirm firm_id)
"United Arab Emirates" 2017 0 0 1
"United Arab Emirates" 2019 0 0 1
"United Arab Emirates" 2018 0 0 1
"United Arab Emirates" 2016 0 0 2
"United Arab Emirates" 2018 0 0 2
"United Arab Emirates" 2015 0 0 2
"United Arab Emirates" 2014 0 0 2
"United Arab Emirates" 2013 0 0 2
"United Arab Emirates" 2017 0 0 2
"United Arab Emirates" 2019 0 0 2
"United States" 2014 0 0 3
"United States" 2011 0 0 3
"United States" 2009 0 0 3
"United States" 2008 0 0 3
"United States" 2010 0 0 3
"United States" 2019 0 0 3
"United States" 2012 0 0 3
"United States" 2006 0 0 3
"United States" 2018 0 0 3
"United States" 2015 0 0 3
"United States" 2005 0 0 3
"United States" 2013 0 0 3
"United States" 2017 0 0 3
"United States" 2007 0 0 3
"United States" 2016 0 0 3
"Argentina" 2015 0 0 4
"Argentina" 2016 0 0 4
"Argentina" 2018 0 0 4
"Argentina" 2017 0 0 4
"Argentina" 2014 0 0 4
"Argentina" 2019 0 0 4
"Argentina" 2020 0 0 5
"Argentina" 2015 0 0 5
"Argentina" 2019 0 0 5
"Argentina" 2017 0 0 5
"Argentina" 2016 0 0 5
"Argentina" 2018 0 0 5
"Argentina" 2019 0 0 6
"Argentina" 2018 0 0 6
"Argentina" 2017 0 0 6
"Argentina" 2016 0 0 6
"Argentina" 2015 0 0 6
"Argentina" 2017 0 0 7
"Argentina" 2015 0 0 7
"Argentina" 2019 0 0 7
"Argentina" 2014 0 0 7
"Argentina" 2016 0 0 7
"Argentina" 2018 0 0 7
"Argentina" 2013 0 0 7
"Argentina" 2010 0 0 7
"Argentina" 2018 0 0 8
"Argentina" 2019 0 0 8
"Austria" 2018 0 0 9
"Austria" 2013 0 0 9
"Austria" 2012 0 0 9
"Austria" 2011 0 0 9
"Austria" 2014 0 0 9
"Austria" 2019 0 0 9
"Austria" 2017 0 0 9
"Austria" 2015 0 0 9
"Austria" 2010 0 0 9
"Austria" 2016 0 0 9
"Austria" 2019 0 0 10
"Austria" 2020 0 0 10
"Austria" 2018 0 0 10
"Austria" 2018 0 0 11
"Austria" 2011 0 0 11
Comment