Suppose I have panel data with "id" as the identifier. Regressing:
Code:
reg i.pid mat def B = e(b)
I'd like to make the row names of matrix "B" the corresponding "id" value. That way, I can create a new .dta with "id" and "fixed_effects" variables and simply merge that to the database.
This would be easier if every id was included in the regression; however, some are dropped out (e.g. the base has 500 unique values for id and e(b) is a 432x1 vector).
Since Stata report legends from coefficients, I'm wondering if it's possible to connect those with the row names in a simple way.
0 Response to Matrix row names as legends from coefficients
Post a Comment