Announcement

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

  • Custom labels in a coefplot.

    Dear All,

    I am estimating a regression postestimation plot using a user written coefplot. Following is my code and attached graph it generates:

    Code:
    coefplot, drop(treated2 wk_* post _cons) ///
     title("(1) Prescriptions") xline(29.5) yline(0) /*xsc(r(-4))*/  ///
     ytitle(Change) xtitle(Week relative to KY's new laws) vertical omitted addplot(dot y x, mfcolor(white))  ///
     xlabel(1 10 20 30 40 50 60 70 80 90 100) coeflabels(t1="" t10="2012w10" t20="2012w20" t30="2012w30" t40="2012w40" t50="2012w50" t60="2012w60" ///
     t70="2012w70" t80="2012w80" t90="2012w90",  angle(45))
    Despite specifying the custom coeflabels the resulting plot does not have the right labels. How much I change the labelling?

    Sincerely,
    Sumedha.
    Click image for larger version

Name:	Coeflabels.png
Views:	1
Size:	95.4 KB
ID:	1542732


  • #2
    It's not totally clear which labels you're asking about in your question.
    You appear to have specified the labels for the x-axis (the one where the coefficient labels go) twice. First you specify an option, xlabels(), which is not a documented in the coefplot documentation. This option appears to be taking precedence over the next option coeflabels()since the x-axis is specified without the "2012w" that it seems you are trying to add.

    I achieve a similar goal using the coefplot, rename option which allows regex so you may not need to specify the same change repeatedly. I'm not perfectly happy with my own implementation of this option so I'll refer you to the documentation.

    Comment


    • #3
      how can I use string labels on the X axis? I need to use X axes labels with super and sub scripts.

      Comment

      Working...
      X