Announcement

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

  • How to merge datasets with monadic and dyadic units of analysis?

    I want to combine datasets with monadic, country-year, with dyadic, interaction of two countries in a year, unit of analysis. I have ccode (unique country code) for every year in the monadic datasets and ccode1 and ccode2 (respective country codes for each country in a dyad for every year). I tried to combine the two datasets, but the combination only resulted in errors. How can I do that?

  • #2
    Well, it depends on how you want the result to look, which you haven't explained. I can imagine several possibilities that are equally consistent with your description. To get a useful answer, please show a brief example of each data set (including examples that should link to each other in the result) and then show what you want the final result to look like.

    Comment


    • #3
      Thanks for the reply. I want the monadic datasets to be converted in the form of dyadic dataset. I want the result in the form of dyad, two countries per year, instead of monadic, country-level analysis. For instance, I want to combine trade between two countries in a dyadic level with the level of democracy for each country, which is in the country level analysis. When I try to combine both the datasets, I do not get a merged dataset and there are many errors as well. I attached the screen shots of dyadic datasets(dyadic trade and contiguity) and monadic datasets(national capabilities and polity). I like to combine polity and national capabilities dataset with country year to contiguity and dyadic trade, dyadic country-year dataset.
      Attached Files

      Comment


      • #4
        I've looked at your past posts, and it seems you've yet to be given the following advice, so now is the time.

        Please 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.

        In particular, please read FAQ #12 and help those whose help you seek by posting example data using the dataex command. If you are running Stata 15.1 or later, it is already installed. For earlier versions of Stata, install dataex by typing ssc install dataex. Type help dataex to read the simple instructions for using it. Using dataex will enable those who want to help you to quickly and easily create a 100% faithful replica of your situation to test their ideas and code on.

        The more you help others understand your problem, the more likely others are to be able to help you solve your problem.

        Comment


        • #5
          William's advice is excellent. I would add to it the remark that screenshots of data are really not helpful. While they give a visualization of the data, if it is necessary to test out some code to solve your problem (as it likely will be), there is no way to import data from a screenshot into Stata. -dataex- makes importing data into Stata a simple copy/paste operation. It provides a complete and accurate replica of your example, including aspects of the data that cannot be seen in screenshots or tables. And, it will actually take you much less time and effort to post with -dataex- then it took you to post the screenshots. It's a win-win.

          In addition, you did not respond to my request that you show what you want the merged result to look like. You've tried to explain it twice now, and perhaps I am just thick, but I still have no idea what you want. I'm sure it's clear in your own mind, but it's not coming across to me. Showing a small example of the merged result you want (I realize you will need to work out an example by hand to do this) will be much clearer than repeated attempts to describe it in words.

          Comment

          Working...
          X