Announcement

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

  • How can I plot confidence Interval on a twoway graph?

    Hi all,

    I know it's a little bit silly question but I'll be glad if you will be able to help me.

    I estimated regression (of event study) and I plotted the results on graph the next way:
    Code:
    twoway (line income eventtime) (scatter income eventtime)
    Now I also have variables that are the upper bound and the lower bound of the confidence interval, and I want that my graph will show them as well. I tried to do:
    Code:
    twoway (line income eventtime) (scatter income eventtime) (rarea ci_lowerbound ci_upperbound)
    But this made the the confidence interval to shade the line and the dots.

    So I have two questions:
    1. What should I do that the "rarea" graph wouldn't shade the line and the dots, I want it to be "behind" them.
    2. What is the right command to plot the confidence interval simply as a vertical line from the lower bound to the upper bound of the confidence interval for every value of the x-axis variable ("eventtime")?

    Thank you!

    Fitz

  • #2
    Code:
    twoway (rarea ci_lowerbound ci_upperbound eventtime) (scatter income eventtime) (line income eventtime)

    Comment


    • #3
      Chen Samulsion has in effect answered your first question. Whatever is mentioned first in a twoway call is laid down first and whatever follows is plotted on top on what has already been plotted, so the order to calls to individual commands can matter, greatly.

      Your second question would seem to call for twoway rcap or twoway rspike or whatever else seemed appropriate with the variables calculated previously.

      Comment


      • #4
        Thank You all it was really helpful

        Comment

        Working...
        X