Hello,
This is more of a theoretical question. I am looking at the impact of a reform on recidivism rates. My dataset is of about 181,000+ observations. I have copied part of it below.
When I run reg, xtreg, and diff (user-defined) commands (all the codes written down below) on Stata 17.0, I get similar results for the did variable(0.0314). When I run xtdidregress command, my results are of the opposite sign and much larger values for did variable(-0.1927). These are contradictory results at the first glance. My understanding was that both -diff- and -xtdidregress- calculated ATET effects for panel data. Is there something I'm understanding completely wrong about these commands and what they do? Or are the differences arising due to the way I'm specifying my commands?
Variable NYC is an indicator variable that is 1 for the treatment group and 0 for comparison group.
Variable period is an indicator variable that is 1 for post-reform years and 0 for pre-reform years.
Variable did is the interaction variable between NYC and period.
P.S: I am currently running these commands without any covariates, robustness or fixed effects. I just wanted to understad the difference between the results of diff and xtdidregress command.
Commands I'm running:
Data:
Thank you,
Tessie
This is more of a theoretical question. I am looking at the impact of a reform on recidivism rates. My dataset is of about 181,000+ observations. I have copied part of it below.
When I run reg, xtreg, and diff (user-defined) commands (all the codes written down below) on Stata 17.0, I get similar results for the did variable(0.0314). When I run xtdidregress command, my results are of the opposite sign and much larger values for did variable(-0.1927). These are contradictory results at the first glance. My understanding was that both -diff- and -xtdidregress- calculated ATET effects for panel data. Is there something I'm understanding completely wrong about these commands and what they do? Or are the differences arising due to the way I'm specifying my commands?
Variable NYC is an indicator variable that is 1 for the treatment group and 0 for comparison group.
Variable period is an indicator variable that is 1 for post-reform years and 0 for pre-reform years.
Variable did is the interaction variable between NYC and period.
P.S: I am currently running these commands without any covariates, robustness or fixed effects. I just wanted to understad the difference between the results of diff and xtdidregress command.
Commands I'm running:
Code:
reg recid NYC period did diff recid, t(NYC) p(period) xtset id xtreg recid NYC period did xtdidregress (recid) (did), group(id) time(period)
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float recid long id float year int courtid float(NYC period did) byte age_at_referral float(female black months_disposition crime sentence) 0 17944 2007 93 0 0 0 16 0 0 5 1 1 0 21153 2005 93 0 0 0 16 0 0 3 1 0 0 22210 2005 93 0 0 0 15 1 1 3 0 0 0 28858 2005 93 0 0 0 16 0 0 2 0 1 0 32454 2005 93 0 0 0 16 1 0 1 0 0 0 5183618 2006 106 1 0 0 15 0 0 6 1 1 0 5184303 2006 106 1 0 0 15 0 0 . . . 0 5184596 2005 106 1 0 0 15 1 0 7 1 0 0 5188710 2006 106 1 0 0 15 0 0 3 0 0 0 5189440 2005 106 1 0 0 16 0 0 3 0 0 0 58956 2015 93 0 1 0 15 1 1 1 1 1 0 66815 2013 93 0 1 0 16 0 0 8 0 1 0 74530 2014 93 0 1 0 14 0 0 10 0 1 0 83336 2013 93 0 1 0 14 0 0 4 1 1 0 83664 2017 93 0 1 0 16 0 0 8 0 1 0 5554707 2013 106 1 1 1 16 0 0 12 1 1 0 5613580 2013 106 1 1 1 16 1 1 3 1 0 0 5623310 2013 106 1 1 1 15 0 0 18 1 1 0 5639877 2015 106 1 1 1 15 0 0 7 1 1 0 5647375 2014 106 1 1 1 15 0 1 2 1 0 end label values courtid labels5 label def labels5 93 "Dutchess", modify label values age_at_referral labels4 label def labels4 11 "Eleven", modify label def labels4 12 "Twelve", modify label def labels4 13 "Thirteen", modify label def labels4 14 "Fourteen", modify label def labels4 15 "Fifteen", modify label def labels4 16 "Sixteen", modify label def labels4 17 "Seventeen", modify label values age_at_referral labels4 label def labels4 15 "Fifteen", modify label def labels4 16 "Sixteen", modify label var recid "Recidivism Non-status offenses" label var id "Resp entity ID" label var courtid "Court entity ID" label var period "PostR" label var did "PNYC X Post R" label var age_at_referral "Age at referral" label var female "Female" label var black "Black"
Tessie

Comment