I would like to use coefplot to compare the coefficients from different models and categorical variables. I am using different data, but I recreated a (nonsensical) example that shows my question using the auto-dataset:
Code:
webuse auto, clear gen dummy_weight = 0 // I define a categorical variable for the weight of a car replace dummy_weight = 1 if weight > 2000 & weight <= 3000 replace dummy_weight = 2 if weight > 3000 eststo est_1: reg headroom i.dummy_weight if foreign == 0 // I estimate a model separate for domestic and foreign car makers eststo est_2: reg headroom i.dummy_weight if foreign == 1 coefplot est_*, keep(1.dummy_weight 2.dummy_weight) swapnames asequation // I compare the coefficents
I am attaching a screenshot from the output and what I would like to have.
Thank you very much for your help!
All the best
Leon
Array
0 Response to coefplot plotting results from categorical variable
Post a Comment