Announcement

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

  • Get overview of my (unbalanced) panel data

    Hello everyone,

    I have to say at first that I'm far from being a Stata expert, but I have to use it for my master's thesis and I hope you can help me.

    So I have panel data from four different sources in total and I managed to merge them together, but the data set is unbalanced; the data sources neither cover all the same years nor all the same countries, but of course they overlap to great extend. Is there a command to get an overview for every country (id) for which timespan (year) my explanatory variables are available and drop specific countries and years afterwards to get a balanced panel?

    And a second question where I don't know whether I should open a seperate thread for it: When I use the command
    xtsum id year var1 var2 etc.
    there is no within variation (standard deviation) in countries, but some between variation in years. I thought that shouldn't exist? Or does it have to do with the unbalanced data? What do I do about it?

    Help would be highly appreciated! Btw of course I googled before asking, but didn't find anything that helped me. If there is more information you need, please tell me. Thank you in advance.

  • #2
    You don't say how many countries or how many years, which will affect what is easy and not so easy to think about. You could just go

    Code:
    scatter id year
    Let's suppose that there are 30 countries. Then something like

    Code:
    scatter id year, yla(1/30, valuelabel ang(h))
    might work better. If your value is not 30, then revise accordingly. Then something like



    Code:
    scatter id year if !missing(whatever), yla(1/30, valuelabel ang(h))
    is a way to see where and when there are non-missing values for whatever.

    Comment

    Working...
    X