Hello!
I'm trying to produce something similar to the figure 3 of Beck, Levine, and Levkov (2010). Unlike the paper has 10 pre periods and 15 post periods, I have 3 pre periods and 2 post periods. I wonder how this part of the code can be revised to reflect I have 3 pre and 2 post periods?
So for i = -10(1)15 I shall change it to i = -3(1)2, what about the part below?
As for scalar x = x/10, I suppose I need to change it to 3, as I have 3 pre periods.
Thanks a lot,
Flora
I'm trying to produce something similar to the figure 3 of Beck, Levine, and Levkov (2010). Unlike the paper has 10 pre periods and 15 post periods, I have 3 pre periods and 2 post periods. I wonder how this part of the code can be revised to reflect I have 3 pre and 2 post periods?
Code:
matrix M = r(table) scalar x = 0 forvalues i = -10(1)15 { if `i' != 0 { local j = cond(`i' < 0, `i'+11, `i'+10) replace b = M[1, `j'] if _tintra == `i' replace LB = M[5, `j'] if _tintra == `i' replace UB = M[6, `j'] if _tintra == `i' } if `i' < 0 { scalar x = x + M[1, `j'] } } scalar x = x/10
Code:
local j = cond(`i' < 0, `i'+11, `i'+10) replace b = M[1, `j'] if _tintra == `i' replace LB = M[5, `j'] if _tintra == `i' replace UB = M[6, `j'] if _tintra == `i'
Thanks a lot,
Flora
Comment