Announcement

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

  • Timeline graph for presentation

    Hello
    I just wasted a day trying to get excel to make me a timeline. I have failed.
    I have four registries for every registry there are 3-4 dates of interest.
    So i have the following
    Reg_var start_date date1 date2 end_of_study
    Is it possible to create time lines using Stata that indicate start date, dates of interest and end_of_study.

    I what them to be horisontal lines with a point indicating a date of interest. It would be lovly if i could get different color on the connecting lines from one point to the next.

    Does this make sense?


    Hope i can crowdsource me a Stata do file here.

    Lars

  • #2
    Can't help with your Stata graphics, but the attached Excel workbook would seem to be a start at what you wanted.
    Attached Files

    Comment


    • #3
      Lars

      You should be able to get what you're describing with rspike. If Reg_var is coded say 1–4, your graph could be something like:
      Code:
      twoway ///
        (rspike start_date date1 Reg_var, horizontal lcol(red)) ///
        (rspike date1 date2 Reg_var, horizontal lcol(yellow)) ///
        (rspike date2 end_of_study Reg_var, horizontal lcol(blue))
      The lines will be pretty thin so you'll probably want play with something like lwidth(vvthick).

      If you want a point at each date as well as the lines joining them you would do this for date1 by adding this to the twoway command:
      Code:
      (scatter Reg_var start_date)
      Likewise for other dates.

      Tim

      Comment


      • #4
        Your right Tim. That was just what i wanted.
        Du you know how i can get the verticAl Line that indicates zero in a X-Y system to go through a certain date fx 1977?

        Comment


        • #5
          sounds like you want the "xline" option; see
          Code:
          help added_line_options

          Comment

          Working...
          X