Hi everyone,
I am trying to carry out a DID with panel data using the command xtdidregress. There are thre pre-treatment periods and three post-treatment periods. I have two countries, and within each country multiple companies, however, only the companies from one country receive the treatment >=2018. My biggest challenge is running the xtdidregress, as I either get the error of repeated time values witin panel or incorrect group() specification.
Which unit of analysis makes more sense to take? In other words, should I move from firm-level to country level and how do I do that? for xtset command
Thank you all tons in advance!
I am trying to carry out a DID with panel data using the command xtdidregress. There are thre pre-treatment periods and three post-treatment periods. I have two countries, and within each country multiple companies, however, only the companies from one country receive the treatment >=2018. My biggest challenge is running the xtdidregress, as I either get the error of repeated time values witin panel or incorrect group() specification.
Which unit of analysis makes more sense to take? In other words, should I move from firm-level to country level and how do I do that? for xtset command
Code:
gen id = _n order id reshape long x , i(id) j(year) rename x esgscore egen panel_id = group (id year) xtset panel_id year g lCompanysize=ln(Companysize) g post= year>=2018 g treated = Country == "treatecountry" g posttreated = post*treated
Thank you all tons in advance!
Comment