Hi everyone,
I am working on a DiD analysis. I have performed both didregress and reg, but the coefficients that came out differ slightly. The analysis is about the effect of a policy change in certain hospitals on the mean healthcare costs per insured year, compared to other hospitals that did not implement this policy change. The years of interest go from 2011 until 2019.
Moreover, when I want to perform estat trendplots after the didregress command, I get the error "treatment assignment times vary; not allowed with estat trendplots"
I hope anyone can help me solve this problem!
Thank you!!
I am working on a DiD analysis. I have performed both didregress and reg, but the coefficients that came out differ slightly. The analysis is about the effect of a policy change in certain hospitals on the mean healthcare costs per insured year, compared to other hospitals that did not implement this policy change. The years of interest go from 2011 until 2019.
Moreover, when I want to perform estat trendplots after the didregress command, I get the error "treatment assignment times vary; not allowed with estat trendplots"
I hope anyone can help me solve this problem!
Thank you!!
Code:
jaar geslacht leeftijdsklasse postcode_3 aantal_bsn aantal_verzekerdejaren kosten_medisch_specialistische_z zorgkosten_totaal kosten_medspeczorg_per_verzjaar Sex HospitalName post1 treat TreatmentEffect 2011 M 0 0 399 161.19 673,096 799,513 4,176 1 Other 0 0 0 2011 M 0 101 608 314.16 1,141,314 1,248,520 3,633 1 Other 0 0 0 2011 M 0 102 300 142.04 570,652 637,409 4,018 1 Other 0 0 0 2011 M 0 103 287 137.22 1,459,150 1,692,445 10,634 1 Other 0 0 0 2011 M 0 105 1049 509.1 3,036,502 3,300,447 5,964 1 Other 0 0 0 2011 M 0 106 1099 557.27 2,918,753 3,214,812 5,238 1 Other 0 0 0 2011 M 0 107 744 353.84 1,819,640 1,982,995 5,143 1 Other 0 0 0 2011 M 0 108 315 153.85 778,080 837,113 5,057 1 Other 0 0 0
Code:
gen post1 = (jaar >= 2015) if !missing(jaar) * A dummy variable is created which distincts if a hospital is part of the treatment group or the control group. gen treat = 1 if HospitalName == "Ommelander" |HospitalName == "Bernhoven" | HospitalName == "Pantein" replace treat = 0 if treat == . * A variable is created which calculates the difference-in-difference estimator for the regression analysis. gen TreatmentEffect = post1 * treat * A difference-in-difference analysis is being performed. didregress (kosten_medspeczorg_per_verzjaar leeftijdsklasse Sex) (TreatmentEffect), group(postcode_3) time(jaar) * A regression analysis is being performed which includes the difference-in-difference effect. reg kosten_medspeczorg_per_verzjaar TreatmentEffect i.leeftijdsklasse Sex i.jaar i.postcode_3, vce(cluster postcode_3)
Comment