Hi all,
Apologies if this seems trivial, but I can assure you that I've spent two days solidly trying to sort this out independently, with no luck.
I've got a dataset concerning foreign aid flows, with each observation containing a recipient/donor pair, year + other information about the type of aid etc. Each dyad pair appears only once for each year within my temporal range, but individually each recipient and each donor appear in many observations for each year. Below is a visual example.
Year---recipient (str)---recipientcode---donor (str)---donorcode---dyadid------value...
2004---Ghana----------------234------------USA-------------12------------1661-------0.325...
2004---Benin----------------234------------Belgium----------18------------1300-------0.515...
2005---Ghana----------------234------------USA--------------12------------1661------0.250...
2005---Benin-----------------234------------Belgium----------18------------1300------0.850...
2006---Ghana-----------------234------------USA-------------12------------1661-------0.015...
2006---Benin-----------------234------------Belgium----------18------------1300------0.210...
So each observation is uniquely defined by the year, donor and recipient together, as individually (or as a pair) these variables are duplicated many times. I need to merge this dyadic data with a dataset containing monadic information about the recipient countries. These variables include a dummy for whether the recipient sat on the UN Security Council in a given year, quality of governance, number of natural disasters etc. This dataset contains one observation per recipient country per year, and does not contain the donor countries at all. e.g:
Year----------Country------scmember------coruptioncontrol------politicalviolence...
2004----------Ghana-------------0----------------------1.3-----------------------1.8--------...
2004----------Benin--------------1----------------------0.3------------------------1.4-------...
2005----------Ghana-------------0----------------------1.4------------------------1.7-----...
2005----------Benin--------------1----------------------0.25-----------------------1.1------...
Every time I try to merge, I'm told that the variables I've specified don't uniquely identify observations in the master data. What I really want Stata to do is import the monadic information about the recipient for each year, and insert the relevant information into every observation containing the correct recipient/year combination. Is this possible, and what steps do I need to take in order to obtain this result?
Any help will be much appreciated, as I've been stuck on this for a really long time. Thanks
Apologies if this seems trivial, but I can assure you that I've spent two days solidly trying to sort this out independently, with no luck.
I've got a dataset concerning foreign aid flows, with each observation containing a recipient/donor pair, year + other information about the type of aid etc. Each dyad pair appears only once for each year within my temporal range, but individually each recipient and each donor appear in many observations for each year. Below is a visual example.
Year---recipient (str)---recipientcode---donor (str)---donorcode---dyadid------value...
2004---Ghana----------------234------------USA-------------12------------1661-------0.325...
2004---Benin----------------234------------Belgium----------18------------1300-------0.515...
2005---Ghana----------------234------------USA--------------12------------1661------0.250...
2005---Benin-----------------234------------Belgium----------18------------1300------0.850...
2006---Ghana-----------------234------------USA-------------12------------1661-------0.015...
2006---Benin-----------------234------------Belgium----------18------------1300------0.210...
So each observation is uniquely defined by the year, donor and recipient together, as individually (or as a pair) these variables are duplicated many times. I need to merge this dyadic data with a dataset containing monadic information about the recipient countries. These variables include a dummy for whether the recipient sat on the UN Security Council in a given year, quality of governance, number of natural disasters etc. This dataset contains one observation per recipient country per year, and does not contain the donor countries at all. e.g:
Year----------Country------scmember------coruptioncontrol------politicalviolence...
2004----------Ghana-------------0----------------------1.3-----------------------1.8--------...
2004----------Benin--------------1----------------------0.3------------------------1.4-------...
2005----------Ghana-------------0----------------------1.4------------------------1.7-----...
2005----------Benin--------------1----------------------0.25-----------------------1.1------...
Every time I try to merge, I'm told that the variables I've specified don't uniquely identify observations in the master data. What I really want Stata to do is import the monadic information about the recipient for each year, and insert the relevant information into every observation containing the correct recipient/year combination. Is this possible, and what steps do I need to take in order to obtain this result?
Any help will be much appreciated, as I've been stuck on this for a really long time. Thanks
Comment