Announcement

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

  • Creating Multi-Line Graphs

    Hi all,

    I'm working on a project whereby I look at the monthly data of goods passing through a port over a ten year span. I've been able to make individual and twoway line graphs, but want to create a graph with multiple lines and have had no luck finding any resources outlining how to do this. I'm thinking of having six variables in the graph to compare trends of goods.

    Cheers

  • #2
    If you had given us example data, as is suggested in section 12.2 in the Statalist FAQ (link is in the black bar near the top of this page), then we could have given you a complete command. Now we cannot, as it depends on how exactly your data is organized. All we can give you is a link to resources how to create graphs in Stata: https://www.stata.com/support/faqs/g.../stata-graphs/
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      You don't need luck here, but we do need details on what you want but think isn't provided. Maarten Buis is right on the point. twoway line supports multiple variables directly and there are related wrappers for time series and panel data in tsline and xtline, and yet other commands too.

      Comment


      • #4
        Hi, this is an example of what the data looks like. I have created months with the following code:

        gen month=tm(2013m1)+_n-1

        format month %tm

        tsset month

        I am just unable to sort out how to create multi line graphs.

        Thanks
        Year Month Wheat Canola Barley Soya Beans Oats
        2013 m1 2424 39283 100022 34532 5664
        2013 m2 6434 41843 115000 23422 3454
        2013 m3 5003 43928 123092 34322 3463
        2013 m4 5329 44229 127939 67554 2353

        Comment


        • #5
          Code:
          tsline wheat canola barley soya oats

          Comment

          Working...
          X