Using _b, I have no problem to access the coefficients of contrinuous vairables in a regression. As in the below example, I can easily generate a variable for weight. But I am not sure how to get the equivalent for each value of make. I imagine it is a simple problem and I am not putting in the right search terms. Below is the code/output.
Code:
. use http://www.stata-press.com/data/r13/auto2, clear (1978 Automobile Data) . . encode(make), gen(nmake) . . qui: reg mpg weight i.nmake . . gen mpgcoef=_b[weight] . . di mpgcoef -.02083333 . gen makecoeff=_b[i.nmake] i: operator invalid
0 Response to Storing Coefficients of Dummy Variables
Post a Comment