Hello StataList, first time poster, long time admirer of your work.
I am running diff-in-diffs with panel data using xtdidregress (Stata 18), and along with the output I recieve the following note:
Treatment occurs at different times and estimation sample contains units that switch in and out of treatment.
It is correct that treatment occurs at different times, but after several checks in and out of Stata, it does not appear that the sample has units that switch in and out of treatment.
One such check is as follows, with fips being the unit identifier and hs_treat being the treatment var:
This generates missing values for all observations, which leads me to believe no units switch..
Am I spotting these changes correctly? Or can someone tell me why I'm getting that message? I can't seem to find an answer online.
Thanks in advance!
I am running diff-in-diffs with panel data using xtdidregress (Stata 18), and along with the output I recieve the following note:
Treatment occurs at different times and estimation sample contains units that switch in and out of treatment.
It is correct that treatment occurs at different times, but after several checks in and out of Stata, it does not appear that the sample has units that switch in and out of treatment.
One such check is as follows, with fips being the unit identifier and hs_treat being the treatment var:
Code:
gen switch = . by fips: replace switch = 1 if hs_treat == 0 & hs_treat[n-1] == 1 & !missing(hs_treat)
Am I spotting these changes correctly? Or can someone tell me why I'm getting that message? I can't seem to find an answer online.
Thanks in advance!
Comment