Hi
I have a dataset with suicides for several regions in a country over many years.
Some regions are intervention regions, while remaining are control.
I would like to combine all suicides across intervention regions and similarly add all suicides across control regions for a dummy variable with suicides in intervention and control regions. The variable also needs to account for time as I plan to use the variable to examine the common trend assumption in a DD-design. I suspect the contruction of this variable is pretty straightforward, but I've not found a solution with either -gen- or -egen-.
I've tried,
But this does not solve the problem.
I have a dataset with suicides for several regions in a country over many years.
Some regions are intervention regions, while remaining are control.
I would like to combine all suicides across intervention regions and similarly add all suicides across control regions for a dummy variable with suicides in intervention and control regions. The variable also needs to account for time as I plan to use the variable to examine the common trend assumption in a DD-design. I suspect the contruction of this variable is pretty straightforward, but I've not found a solution with either -gen- or -egen-.
I've tried,
Code:
gen suicide_intervention=suicide if region==1+suicide if region==2+suicide if region==3
Comment