Hello Xperts,
I have the following panel data set (this is just a sample since I cannot use the real dataset for copyright reasons):
I need to implement the following FE model (diff-in-diff) :
Wit = Ai+ Xit*Beta + Dit*Sigma + Ci*Xit*Beta + Ci*Dit*Sigma + Errorit
Ai = Individual fixed effects
Wit = Salary
Xit = contains observed time-varying characteristics of individuals
Ci = treatment variable
Dit = Dummy variable indicating the pre and post period
I have the following code implemented in stata:
Is my code correct?
I am wondering the Ai component of the model that needs to capture the individual fixed effects. Does my code capture the individual fixed effects?
Thanks a lot as usual for all your inputs.
Regards,
Jason
I have the following panel data set (this is just a sample since I cannot use the real dataset for copyright reasons):
Id | year | age | treatment | prepost | salary | CapInc | OccId |
1 | 1990 | 23 | 0 | 0 | 100 | 234 | 33 |
1 | 1991 | 24 | 0 | 0 | 212 | 23 | 33 |
1 | 1992 | 25 | 0 | 0 | 122 | 23 | 33 |
1 | 1993 | 26 | 0 | 1 | 345 | 23 | 33 |
1 | 1994 | 27 | 0 | 1 | 234 | 2 | 33 |
1 | 1995 | 28 | 0 | 1 | 11 | 45 | 33 |
2 | 1990 | 33 | 0 | 0 | 223 | 23 | 33 |
2 | 1991 | 34 | 0 | 0 | 678 | 9 | 22 |
2 | 1992 | 35 | 0 | 0 | 121 | 9 | 22 |
2 | 1993 | 36 | 0 | 1 | 33 | 9 | 22 |
2 | 1994 | 36 | 0 | 1 | 45 | 12 | 22 |
2 | 1995 | 38 | 0 | 1 | 67 | 0 | 22 |
2 | 1995 | 39 | 0 | 1 | 78 | 5 | 22 |
3 | 1990 | 56 | 1 | 0 | 23 | 3 | 11 |
3 | 1991 | 57 | 1 | 0 | 88 | 5 | 11 |
3 | 1992 | 58 | 1 | 0 | 99 | 7 | 11 |
3 | 1993 | 59 | 1 | 1 | 44 | 21 | 11 |
3 | 1994 | 60 | 1 | 1 | 11 | 23 | 11 |
3 | 1995 | 61 | 1 | 1 | 33 | 3453 | 11 |
4 | 1990 | 45 | 1 | 0 | 44 | 3 | 77 |
4 | 1991 | 46 | 1 | 0 | 12 | 454 | 77 |
4 | 1992 | 47 | 1 | 0 | 12 | 5 | 77 |
4 | 1993 | 48 | 1 | 1 | 34 | 45 | 77 |
4 | 1994 | 49 | 1 | 1 | 66 | 454 | 77 |
4 | 1995 | 50 | 1 | 1 | 777 | 56 | 77 |
I need to implement the following FE model (diff-in-diff) :
Wit = Ai+ Xit*Beta + Dit*Sigma + Ci*Xit*Beta + Ci*Dit*Sigma + Errorit
Ai = Individual fixed effects
Wit = Salary
Xit = contains observed time-varying characteristics of individuals
Ci = treatment variable
Dit = Dummy variable indicating the pre and post period
I have the following code implemented in stata:
Code:
xtset id year
Code:
xtreg salary i.treatment##i.prepost i.treatment##c.age i.treatment##c.CapInc, fe robust
I am wondering the Ai component of the model that needs to capture the individual fixed effects. Does my code capture the individual fixed effects?
Thanks a lot as usual for all your inputs.
Regards,
Jason
Comment