Announcement

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

  • panel data graph

    Hey there,

    I have a problem with a panel data graph. I have 24 countries in my data but stata only gives 15 of them a own color. I want that in the legend all 24 countries are listed with a own color. How can I achieve this?

    my command is:

    . xtset id date

    . xtline variable1 , overlay t(date) i(id)


    Thank you in advance, Flora
    Last edited by Flora Oblasser; 06 Feb 2019, 07:07.

  • #2
    I think you need to specify the 24 distinct colours you want explicitly. Good luck with that:

    1. The legend alone eats up about half your total space.

    2. 24 really different colours are hard to find.

    3. Hard to see that the back and forth of "this colour is ... " "such and such country is ..." is going to appeal to any scientific or statistical reader.


    I'd suggest thinking more broadly e.g. 9 panels (3 x 3) with 2 or 3 countries in each or a front-and-back plot.


    https://www.statalist.org/forums/for...ailable-on-ssc
    Last edited by Nick Cox; 06 Feb 2019, 12:16.

    Comment


    • #3
      Thanks a lot for your answer, yeah I think I'll just mention the interesting outliers in my legend then and put the splitted graphs in the appendix. Thank you!

      Comment


      • #4
        I believe that you could do better. How many data points for each country? Can you list the data here?

        Comment


        • #5
          112 but thanks, I think I got it (: But I have another problem, I'm running panel data regressions, but I want to find out the coefficients for each country separately.

          So for example I use xtreg y x i.countryid i.time, fe

          Now the coefficients are same for all the countries. Is there a possibility to get to the coefficients for each country, beside running a time series regression for each country (I don't really want to do this)?

          But maybe I should start a new post with this, thank you anyway!


          Comment


          • #6
            New thread please.

            Comment

            Working...
            X