Hello,
I am trying to calculate a difference in difference effect of a certain change in different locations. Each location is identified by a ID number.
As far as I know, to calculate a difference-in-difference effect I use:
my data is built like this (as an example):
Each ID number represents a district/location. Treatment represents control vs treated group. Period represents a before vs after the year that the change was taken into effect.
What I want to do is a calculate a difference-in-difference but doing the comparisons between each group within each ID number. Is there any way to do this?
I thought maybe to add i.ID as a variable in my regression, but I am not sure if that is correct.
Thanks
I am trying to calculate a difference in difference effect of a certain change in different locations. Each location is identified by a ID number.
As far as I know, to calculate a difference-in-difference effect I use:
HTML Code:
reg y Period##Treatment, r
ID | Treatment (0=control, 1=treated group) | Period (0=before, 1=after) | y |
1 | 0 | 0 | 2 |
1 | 0 | 1 | 7 |
1 | 1 | 0 | 9 |
1 | 1 | 1 | 8 |
2 | 0 | 0 | 1 |
2 | 0 | 1 | 10 |
2 | 1 | 0 | 4 |
2 | 1 | 1 | 2 |
What I want to do is a calculate a difference-in-difference but doing the comparisons between each group within each ID number. Is there any way to do this?
I thought maybe to add i.ID as a variable in my regression, but I am not sure if that is correct.
Thanks
Comment