Daniel-Pailanir / sdid

Synthetic Difference in Differences for Stata
GNU General Public License v3.0
72 stars 36 forks source link

Data Requirements and error #25

Closed Arthur-Langlois closed 1 year ago

Arthur-Langlois commented 2 years ago

Hi, I am just confused as to what are the different data format requirements, specifically, what is supposed to be T ? Where do we input the time of treatment ? I passed my Year variable, to T and as I expected I received an error repeated time values within panel

sdid CrudeRate State Year Treated, vce(placebo) reps(50)
Daniel-Pailanir commented 2 years ago

Hi Arthur, your data must be a balanced panel, that's why you get the error repeated time values ​​within panel is an error when we do xtset in the command. You should check this before running sdid, try duplicate report State Year or something similar to make sure you don't have more than 1 repeated year for the same state. On the other hand, T is a variable that can take years, months, days, etc. As long as it's numerical.

Arthur-Langlois commented 2 years ago

Hi Daniel, thank you for your response. I am running into a different issue. After inputing the following code: sdid cruderate state year after_treatment vce(bootstrap) reps(50) I get the following error: factor-variable and time-series operators not allowed. My data looks as follows: Screen Shot 2022-04-18 at 23 40 30

Am I using the right data format ?

damiancclarke commented 2 years ago

Hi Arthur, I believe there is a missing comma following after_treatment and before vce(bootstrap). If you add the comma, all should be fine. Best wishes, Damian