Announcement

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

  • Adding a vertical AND horizontal line using coefplot

    Hi statalist!

    I'm using coefplot for an event study where year -1 is the reference year. I have a horizontal line at 0, but I want to add a vertical line between year -2 and year 0 (where year -1 would be). I'm plotting pretty simply using:

    Code:
    reg outcome $treatments, absorb(id year) 
    coefplot, vertical keep($treatments) yline(0)
    And this is what the resulting graph looks like:



    Thanks in advance!
    Kait
    Attached Files

  • #2
    coefplot is from Stata Journal as you are asked to explain. You provide no data example, but I think you want

    Code:
    coefplot, vertical keep($treatments) yline(0) xline(2.5)
    Note you can also explicitly specify the inclusion of the base level using the option

    Code:
    baselevels
    The following link shows you how you can omit the base level marker and include a vertical line at that point.

    https://www.statalist.org/forums/for...-with-coefplot
    Last edited by Andrew Musau; 31 Oct 2019, 14:30.

    Comment


    • #3
      That works perfectly Andrew! Thanks so much!

      Comment

      Working...
      X