Announcement

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

  • Twoway Line: Deleting a straight line

    Hello, I am trying to create a figure using the code: twoway line sum mdate. The figure shows both a actual line and a straight fitted line. Please find attached. Is there anyway I can delete the straight fitted line. Any advice would be appreciated.



    Attached Files

  • #2
    I doubt that the straight line you are seeing is a fitted line. When you run -twoway y x-, Stata goes through the data set, in whatever order the observations happen to be in, and draws a line connecting each (x, y) data point to the next one in the data set. If the data are not sorted on x, this can result in some rather wild looking graphs. I'm pretty sure that's what's going on here.
    Code:
    twoway line sum mdate, sort
    will, I think give you what you want. It may also change the appearance of the rest of the graph.

    Comment

    Working...
    X