Announcement

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

  • Panel Data Graphs with xtline - Restricting ID variable

    Dear All,

    I have a data set with panel data, which covers 27 countries and 100 years. I want to show one variable in one xtline graph for only 8 of those 27 countries. Currently, I am coding:

    . xtline var1 if var1 > 5, overlay i(country) t(year)

    The result is a graph with 27 countries, which is quite confusing because it uses the same labels and colours for some of them.

    I would like to restrict i(country) to show only countries 1, 7, 8, 17, 20, 22, 24 and 27. Is there a way to do that?

    Kind regards,

    Mark



  • #2
    Code:
    xtset country year
    xtline var1 if inlist(country,  1, 7, 8, 17, 20, 22, 24, 27), overlay

    Comment


    • #3
      Dear Andrew,

      It works great. Thank you very much for your help.

      Kind regards,

      Mark

      Comment

      Working...
      X