Announcement

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

  • How to merge two panel data sets?

    Dear Statalist members,

    I want to merge two panel data sets. One contains information regarding 2000 firms over 4 years, and one of the variables is the country they are from, but it also contains time-sensitive information such as net income and total assets. The other data set contains country-information concerning the same four years. I want to match the country information in a particular year to the firm information in that same year based on the country the firm is from. For example, the GDP per capita of Germany in 2013 needs to be added to the observations regarding German firms in 2013, and the GDP per capita of Germany in 2014 needs to be added to the observations regarding German firms in 2014, etc.

    How do I do this? Many-to-one merging does not work in this case and I've heard that many-to-many merging provides useless results.

    Can anyone help me?

    Kind regards,
    Elles

  • #2
    Welcome to Statalist.

    I'm sure there are members who can help you, if you first help them with a better presentation of your problem.

    Please take a few moments to review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. Note especially sections 9-12 on how to best pose your question. It's particularly helpful to copy commands and output from your Stata Results window and paste them into your Statalist post using code delimiters [CODE] and [/CODE], and to use the dataex command to provide sample data, as described in section 12 of the FAQ.

    Section 12.1 is particularly pertinent

    12.1 What to say about your commands and your problem

    Say exactly what you typed and exactly what Stata typed (or did) in response. N.B. exactly!
    ...
    Never say just that something "doesn't work" or "didn't work", but explain precisely in what sense you didn't get what you wanted.
    The more you help others understand your problem, the more likely others are to be able to help you solve your problem.

    Comment

    Working...
    X