Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sorting and Labelling coeffecient from different models using coefplot.

    Hello Stata family!

    My data is divided into 10 equal groups by a categorical variable called decile which takes the value from 1 to 10.

    I am running 10 separate regression on different data and then plotting only the "m2sc" coefficient using "coefplot"

    Code:
    foreach i of numlist 1/10 {
    display `i'
    reghdfe avg_light m2sc m4sc if decile==`i', absorb(i.key i.year) vce(cluster AC_YEAR) 
    estimates store d_`i'
    }
    coefplot d_*, keep(m2sc) xline(0) order(d_1 d_2 d_3 d_4 d_5 d_6 d_7 d_8 d_9 d_10)
    The problem is that I want to sort the coefficient by decile (the first line is d_1, d_2, d_3.....) but I am not able to do that. (See attached image)

    Additionally is it possible to put the label "decile 1", "decile 2" on y-axis or on the C.I(graph region) line of the coeff ?
    Click image for larger version

Name:	statalist.png
Views:	1
Size:	9.1 KB
ID:	1565324



Working...
X