Announcement

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

  • Graph for panel data that combines and plots average

    Dears,
    I want to generate linear plots for 18 countries' panel data in one graph.
    I use the command xtline but it gives of every country plots separately. when I add overlay, it overlays all together. however, what I need is if I want to see the debt-GDP ratio of some SSA countries, can I see it in a single plot sothat I can say the average debt-GDP ratio of SSA countries is increasing/decreasing and so forth.
    May you please drop me the syntax for that. Thanks
    * xtline credit_gdp
    * xtline credit_gdp, overlay



    Attached Files

  • #2
    perhaps,
    Code:
    bys year: egen mean_credit_gdp = mean(credit_gdp)
    bys year: replace mean_credit_gdp = . if _n>1
    tw (line mean_credit_gdp year)

    Comment


    • #3
      Data like that make me think that the median or the geometric mean might work as well or better.

      Comment


      • #4
        It works. Thanks Oyvind Snilsberg

        Comment

        Working...
        X