I am performing an event study in Stata with the following specification:
reghdfe numPixelsLost tee_1##db_1 tee_2##db_1 tee_3##db_1 tee_4##db_1 tee_5##db_1 tee_6##db_1 tee_7##db_1 tee_8##db_1 tee_9##db_1 tee_10##db_1 if biome==6, absorb(year case_id) vce(cluster case_id)
When I inspect the full results, I can see that Stata estimated coefficients and standard errors for all of my variables of interest (the interaction terms).
Then I tried to use a loop to take this information and store it as matrices:
forvalues j = 1/10 {
matrix co1`j' = [_b[1.tee_`j'#1.db_1], _b[1.tee_`j'#1.db_1] - 1.96*_se[1.tee_`j'#1.db_1], _b[1.tee_`j'#1.db_1] + 1.96*_se[1.tee_`j'#1.db_1]]
}
Then I then try to stitch all of these matrices together into one matrix (that I can use to make graphs) like this:
matrix all1 = [co11 \ co12 \ co13 \ co14 \ col5 \ col6 \ col7 \ col8 \ col9 \ col10]
But Stata will not produce the matrix because it claims some of the vectors are "not found". That is odd since all of the coefficients are estimated. I'd like help understanding why the loop does not seem to recognize estimated coefficients and how to produce the matrix.
matrix dir
should throw some light on this, as it should show whethercol1
tocol10
do not all exist (and are of the same size and shape). The immediate problem is whether those vectors are all visible. which Stata appears to be denying; whatreghdfe
did or did not do upstream may then come into play. – Nick Coxcol
andco1
as prefix, i.e. confusing letterl
and numeral1
. – Nick Cox