I'm working with repeated cross-section data and have been trying to work with all the recent DID literature. After collapsing I successfully executed Stackdev, CS , did_2s and DiD_Multiplegt. However, with my collapsed dataset for some reason, I wasn't able to run the did_computation. It returns me the error : ( I attached my collapsed data which I made a panel from repeated CS).
DID Imputation Code
EVENT STUDY INTERACT Sun and Abraham Code
This returns me the error that :
I usued statefip as my id for the previous recent DiD like CS, Stackdev, DiD_Mupltiplegt and did_2s. So, there shouldnt be any problem with statefip as being id of my panel data.
----------------------- copy starting from the next line -----------------------
Code:
There are no untreated observations, i.e. those with year<treat or mi(treat). Please double-check the period & event time variables. something that should be true of your data is not r(459);
Code:
ssc install did_imputation, replace ** did_imputation did_imputation ln_incwage statefip year treat, horizons(0/10) pretrend(10) did_imputation ln_incwage statefip year treat, allhorizons pretrends(5)
Code:
ssc install eventstudyinteract, replace ********Preparation sum treat gen lastcohort = treat==r(max) // dummy for the latest- or never-treated cohort forvalues l = 0/5 { gen L`l'event = time_to_treat==`l' } forvalues l = 1/14 { gen F`l'event = time_to_treat==-`l' } drop F1event // normalize K=-1 (and also K=-15) to zero eventstudyinteract ln_incwage L*event F*event, vce(statefip) absorb(statefip year) cohort(treat) control_cohort(lastcohort)
This returns me the error that :
Code:
(obs=3,678) vcetype 'statefip' not allowed r(9);
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float ln_incwage int year byte statefip float(treat time_to_treat) 10.20175 1 2012 0 -4 10.118625 1 2013 0 -3 10.121947 1 2014 0 -2 10.162588 1 2015 0 -1 10.164964 1 2016 0 0 10.240293 1 2017 0 1 10.226054 1 2018 0 2 10.18818 1 2019 0 3 10.28508 1 2020 0 4 10.265915 2 2012 0 0 10.276074 2 2013 0 0 10.251534 2 2014 0 0 10.223777 2 2015 0 0 10.36559 2 2016 0 0 10.327884 2 2017 0 0 10.340085 2 2018 0 0 10.288028 2 2019 0 0 10.350742 2 2020 0 0 10.349242 8 2012 0 1 10.370746 8 2013 0 2 10.39272 8 2014 0 3 10.357117 8 2015 0 4 10.36257 8 2016 0 5 10.390102 8 2017 0 6 10.448965 8 2018 0 7 10.453508 8 2019 0 8 10.482086 8 2020 0 9 10.196277 32 2012 0 -4 10.197188 32 2013 0 -3 10.215773 32 2014 0 -2 10.18137 32 2015 0 -1 10.180758 32 2016 0 0 10.227181 32 2017 0 1 10.18598 32 2018 0 2 10.25193 32 2019 0 3 10.35258 32 2020 0 4 10.29493 6 2012 0 0 10.31255 6 2013 0 0 10.324828 6 2014 0 0 10.297793 6 2015 0 0 10.35929 6 2016 0 0 10.38448 6 2017 0 0 10.395014 6 2018 0 0 10.40755 6 2019 0 0 10.431263 6 2020 0 0 end label values statefip statefip_lbl label def statefip_lbl 6 "California", modify
Comment