Announcement

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

  • Multiple Line Graph assistance

    Hi,

    I have read many papers on redistribution which have illustrated several graphs of total fiscal redistribution effects for each country over a specific period - all countries have their own graph with distribution effects displayed over the corresponding years.

    When attempting to do this myself, I am using a dataset which I have imported from excel into stata. Within my dataset I have a set of countries with varying years (period from 1985 - 2010) so when I attempt to compose line graphs for the 12 countries, it will not let me do this (tsset year, generic) and I receive the subsequent response: .repeated time values in sample.

    For instance, I import just the data for Canada and these are the commands which I run:
    tsset year, generic
    twoway (tsline tot_fisc_red)

    Is there anyway I can use all my data and countries and run this to produce multiple graphs?

    Any help will be much appreciated.

    Best,

    Craig



  • #2
    Well, the error message means exactly what it says. When you have a data set with multiple countries and multiple yearly observations of those countries, each year will appear more than once. That's not a time series. That's panel data. You need -xtset country year-, not -tsset year-. Then you can use -xtline tot_fisc_red- and you will get a graph for each country. Read -help xtline- for more details which will enable you to customize the graph (including all 12 lines in a single panel if you prefer it that way.)

    Comment


    • #3
      Hi,

      Thank you so much - I eventually realised and figured I would return to see whether anyone replied to my post.

      Thank you Clyde

      Comment

      Working...
      X