Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Difference in Difference with etherogenous treatment over time (xtreg vs xthdidregress)

    Hi all,
    I recently created a panel dataset covering companies (id) over 11 years (YEAR). I would like to evaluate what is the effect of implementing a given policy at company level on the number of negative news about the company (NegObs). Policy is introduced in different years in different companies. So far I've created two variables: 1. HRP_anyyear that distinguish the treatment and control group as it takes value 1 for all the years of observation over the 11 years if the company has introduced the policy, 0 otherwise; 2. HRP treatment that takes value 1 from the year of policy introduction and subsequent years for the companies that introduced a policy, 0 otherwise. NegObs counts the number of negative news the company has been involved in the given year.

    input long id int YEAR float(HRP_treatment HRP_anyyear) byte NegObs

    So far I've tried two model of dif in dif and I try to explain my doubts.
    1. xtreg NegObs i.HRP_anyyear##i.HRP_treatment covariates, fe. In this case my doubt is: it is correct to have the post treatment variable specified only for the treatment group and not for the control group? The results I got so far omit the interaction terms due to collinearity.
    2. As my treatment is eterogenous over years and cohort I've also tried to use: xthdidregress ra (NegObs covariates ) (HRP_treatment), group (id) time (YEAR). For this model I wonder if it is correct to use the ra option or should I use the tfwe estimator, in the latter case I face a memory problem unless I specify the option hettype(time)/hettype(cohort)
    Do you have any suggestion on how to best design a dif in dif model with this type of dataset? I've also considered matching the control and treatment group before running model 1 to get more reliable results, but read some cons about matching for dif in dif models.

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long id int YEAR float(HRP_treatment HRP_anyyear) byte NegObs
     1 2013 0 1  0
     1 2014 0 1  0
     1 2015 0 1  0
     1 2016 0 1  0
     1 2017 0 1  0
     1 2018 0 1  0
     1 2019 0 1  0
     1 2020 0 1  2
     1 2021 0 1  0
     1 2022 0 1  2
     1 2023 1 1  5
     2 2013 0 1  4
     2 2014 0 1  0
     2 2015 0 1  4
     2 2016 0 1  0
     2 2017 0 1  2
     2 2018 0 1  0
     2 2019 0 1  4
     2 2020 0 1  7
     2 2021 1 1  4
     2 2022 1 1  6
     2 2023 1 1  3
     3 2013 0 0  0
     3 2014 0 0  0
     3 2015 0 0  0
     3 2016 0 0  0
     3 2017 0 0  0
     3 2018 0 0  0
     3 2019 0 0  0
     3 2020 0 0  2
     3 2021 0 0  1
     3 2022 0 0  2
     3 2023 0 0  0
     4 2013 0 1  1
     4 2014 0 1  0
     4 2015 0 1  0
     4 2016 0 1  0
     4 2017 0 1  0
     4 2018 0 1  0
     4 2019 0 1  0
     4 2020 0 1  2
     4 2021 0 1  7
     4 2022 1 1  0
     4 2023 1 1  0
     5 2013 0 1  0
     5 2014 0 1  0
     5 2015 0 1  0
     5 2016 0 1  3
     5 2017 0 1  2
     5 2018 0 1  2
     5 2019 0 1  5
     5 2020 0 1 11
     5 2021 1 1  7
     5 2022 1 1  3
     5 2023 1 1  5
     6 2013 0 1  4
     6 2014 0 1  1
     6 2015 1 1  4
     6 2016 1 1  0
     6 2017 1 1  1
     6 2018 1 1  2
     6 2019 1 1  0
     6 2020 1 1  2
     6 2021 1 1  0
     6 2022 1 1  3
     6 2023 1 1  0
     7 2013 0 1  7
     7 2014 0 1  6
     7 2015 0 1  9
     7 2016 0 1  8
     7 2017 0 1 14
     7 2018 0 1  4
     7 2019 0 1  8
     7 2020 0 1 15
     7 2021 0 1 14
     7 2022 1 1 23
     7 2023 1 1 16
     8 2013 0 0  1
     8 2014 0 0  0
     8 2015 0 0  0
     8 2016 0 0  0
     8 2017 0 0  2
     8 2018 0 0  1
     8 2019 0 0  7
     8 2020 0 0  7
     8 2021 0 0  6
     8 2022 0 0  3
     8 2023 0 0  6
     9 2013 0 1  2
     9 2014 0 1  3
     9 2015 0 1  2
     9 2016 0 1  0
     9 2017 0 1  0
     9 2018 0 1  0
     9 2019 0 1  0
     9 2020 0 1  2
     9 2021 1 1  1
     9 2022 1 1  4
     9 2023 1 1  0
    10 2013 0 1  2
    end
    label values id id
    label def id 1 "AEON", modify
    label def id 2 "ALDI", modify
    label def id 3 "ANTA", modify
    label def id 4 "ASICS", modify
    label def id 5 "ASOS", modify
    label def id 6 "Abercrombie & Fitch Co", modify
    label def id 7 "Adidas", modify
    label def id 8 "Amazon", modify
    label def id 9 "American Eagle Outfitters", modify
    label def id 10 "Armani", modify
    label var id "Name" 
    label var YEAR "YEAR" 
    label var NegObs "NegObs"
    Thanks in advance
    B
Working...
X