Hi all,
I am trying to perform event study with the package cnsreg (constrained linear regression), which is recommended by this event study guide https://www.aeaweb.org/articles?id=10.1257/jep.37.2.203. I think the idea is it allows us to be more clear about the constraints we are actually using because we need to define them explicitly.
I think in packages like reghdfe the sum of all fixed effects is set to zero by default, but this is not the case with cnsreg. In the code provided by the author he writes out the constraints and then use them in the regression in the following way.
constraint define 2 1.i + 2.i + 3.i + 4.i + 5.i +
6.i + 7.i + 8.i + 9.i + 10.i = 0 ;
cnsreg y D_m* D_p*
ibn.t ibn.i , cluster(i) nocons constraints(2) collinear
My question is a simple one, instead of having 10 people I have 1000+, so I would need to have constraint define 2 1.i + 2.i + 3.i + 4.i + 5.i + 6.i + 7.i + 8.i + 9.i + 10.i +....+ 1000.i = 0. I am not sure what the easiest way to do this would be.
Apologies in advance if this is very obvious.
Best,
Angela
I am trying to perform event study with the package cnsreg (constrained linear regression), which is recommended by this event study guide https://www.aeaweb.org/articles?id=10.1257/jep.37.2.203. I think the idea is it allows us to be more clear about the constraints we are actually using because we need to define them explicitly.
I think in packages like reghdfe the sum of all fixed effects is set to zero by default, but this is not the case with cnsreg. In the code provided by the author he writes out the constraints and then use them in the regression in the following way.
constraint define 2 1.i + 2.i + 3.i + 4.i + 5.i +
6.i + 7.i + 8.i + 9.i + 10.i = 0 ;
cnsreg y D_m* D_p*
ibn.t ibn.i , cluster(i) nocons constraints(2) collinear
My question is a simple one, instead of having 10 people I have 1000+, so I would need to have constraint define 2 1.i + 2.i + 3.i + 4.i + 5.i + 6.i + 7.i + 8.i + 9.i + 10.i +....+ 1000.i = 0. I am not sure what the easiest way to do this would be.
Apologies in advance if this is very obvious.
Best,
Angela
Comment