Announcement

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

  • Adding coefficient when plotting coefficients from an event study

    Hi, all Stata lovers,

    I am plotting coefficients from an event study and I would really like to have the coefficient from the base year 2014 in the same plot. The coefficient for the base year should be 0. Is it possible to just add it when I making the plot with coefplot?

    Code event study:
    xtreg income ib2014.aar##c.T_iv2 i.decile1#c.aar, fe (cluster couple)


    Code plotting coefficients (using coefplot): coefplot, xline(0) levels(95 50) ciopts(recast(. rcap)) drop(_cons 2009.aar 2010.aar 2011.aar 2012.aar 2013.aar 2014.aar 2015.aar 2016.aar ab.decile1#c.aar 2.decile1#c.aar 3.decile1#c.aar 4.decile1#c.aar 5.decile1#.c.aar 6.decile1#.c.aar 7.decile1#.c.aar 8. .decile1#.c.aar 9. .decile1#.c.aar 100.decile1#co.aar)

    (It's only the coefficients from aar#c.T_i_v2 I want.)

    I have attached the results from the event study and plotting the coefficients.

    Thank you so much in advance!

    Attached Files

  • #2
    coefplot is from SSC (FAQ Advice #12). It's difficult to give precise code without a reproducible example, but I think this should do it:

    Code:
    coefplot, keep(*.aar#c.T_iv2) omitted baselevels

    Comment


    • #3
      Thank you Andrew, it almost worked perfectly! Just one thing, is it possible to get the "Base Year (2014)#T_i" down between 2013 and 2015 instead of having it on top?
      Attached Files

      Comment


      • #4
        Use the -order()- option, specifying the order of coefficients the same way as you have done using the -keep()- option. In the command window, type

        Code:
        mat list e(b)
        to find how the base level coefficient is named.

        Comment


        • #5
          Nice! Thank you so much! :D

          Comment

          Working...
          X